MCP server
Page summary:Strapi includes a built-in Model Context Protocol (MCP) server. Once enabled, it lets AI clients create, read, update, delete, publish, and unpublish content directly through Strapi's Content Manager. All operations are gated by Admin token permissions.
The MCP server exposes a set of content management tools to AI clients such as Claude Desktop, Claude Code, Cursor, or any MCP-compatible tool. An AI client connected to the MCP server can, for example, create a blog article, list recent entries, or publish a page. Which tools are available depends on the permissions granted to the Admin token used for authentication.
Configuration
Before first use, the Strapi MCP server must be:
- enabled through the server configuration file and authenticated with Admin tokens created in the admin panel
- connected to your AI client.
Strapi code-based configuration
Enable the MCP server by adding the mcp object to the server configuration file:
- JavaScript
- TypeScript
module.exports = ({ env }) => ({
host: env('HOST', '0.0.0.0'),
port: env.int('PORT', 1337),
app: {
keys: env.array('APP_KEYS'),
},
mcp: {
enabled: true,
},
});
import type { Core } from '@strapi/strapi';
const config = ({ env }: Core.Config.Shared.ConfigParams): Core.Config.Server => ({
host: env('HOST', '0.0.0.0'),
port: env.int('PORT', 1337),
app: {
keys: env.array('APP_KEYS'),
},
mcp: {
enabled: true,
},
});
export default config;
Once the setting is in place, restart Strapi. The MCP endpoint becomes available at /mcp on your Strapi server (e.g., http://localhost:1337/mcp).
Advanced options
The following optional keys can be added to the mcp configuration object:
| Option | Type | Default | Description |
|---|---|---|---|
enabled | Boolean | false | Enable or disable the MCP server. |
connectTimeoutMs | Number | 5000 | Maximum time (in ms) for the internal MCP transport to connect before the request is aborted. |
requestTimeoutMs | Number | 60000 | Maximum time (in ms) for a single MCP request to complete before it times out. |
mcp: {
enabled: true,
connectTimeoutMs: 10000, // 10 seconds
requestTimeoutMs: 120000, // 2 minutes
},
Strapi admin panel configuration
The MCP server authenticates requests using Admin tokens. Each MCP session is scoped to the permissions of the token used to connect:
- Create a new Admin token (see Creating an Admin token on the Admin tokens feature page).
- Copy the token value. You will need it when configuring the AI client.
The token's permissions determine which MCP tools are exposed to the AI client. For instance, if the token only grants read on an Article content-type, the AI client will only see listing and reading tools for articles.
AI client configuration
Once you have enabled the MCP server through the server configuration file and created an Admin token in the admin panel, connect your AI client to the Strapi MCP server.
http://localhost:1337/ is used in configuration examples on this page. If your Strapi server is hosted on another URL or port, please update the code accordingly.
Connecting Claude Desktop
Open Claude Desktop's configuration file. The location varies depending on your system:
| OS | File location |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
You can also open the configuration file for Claude Desktop from Claude's settings: go to Settings > Desktop app > Developer, then click on the Edit config button.
Add the Strapi MCP server to Claude's configuration file, as in the following example, replacing YOUR_ADMIN_TOKEN with the Admin token value copied from the Strapi admin panel configuration:
{
"mcpServers": {
"strapi-mcp": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"http://localhost:1337/mcp",
"--header",
"Authorization: Bearer YOUR_ADMIN_TOKEN"
]
}
}
}
Restart Claude Desktop for the changes to take effect.
Connecting Claude Code
Run the following command, replacing YOUR_ADMIN_TOKEN with the Admin token value copied from the Strapi admin panel configuration:
claude mcp add strapi-mcp --transport http http://localhost:1337/mcp -H "Authorization: Bearer YOUR_ADMIN_TOKEN"
Restart Claude Code, then run /mcp to confirm strapi-mcp reports as connected.
Connecting Cursor
Add the server to your .cursor/mcp.json file:
{
"mcpServers": {
"strapi-mcp": {
"type": "streamable-http",
"url": "http://localhost:1337/mcp",
"headers": {
"Authorization": "Bearer YOUR_ADMIN_TOKEN"
}
}
}
}
Connecting Windsurf
Add the server to your ~/.codeium/windsurf/mcp_config.json file:
{
"mcpServers": {
"strapi-mcp": {
"serverUrl": "http://localhost:1337/mcp",
"headers": {
"Authorization": "Bearer YOUR_ADMIN_TOKEN"
}
}
}
}
Connecting other MCP clients
Any client that supports the MCP Streamable HTTP transport can connect. The generic configuration is as follows:
| Setting | Value |
|---|---|
| Transport type | streamable-http |
| URL | http://localhost:1337/mcp (adjust host and port to your Strapi instance) |
| Authorization header | Bearer YOUR_ADMIN_TOKEN |
Usage
The MCP server uses the Streamable HTTP transport protocol. Any MCP-compatible client can connect by pointing to the /mcp endpoint with a Bearer token in the Authorization header. Once connected, the AI client can interact with your Strapi content using natural language prompts.
Available tools
The MCP server exposes 3 categories of tools: content management tools generated from your schema, built-in utility tools, and Media Library tools.