home / mcp / strapi mcp server
Provides a unified MCP interface to query, modify, and manage Strapi CMS content via REST and media operations.
Configuration
View docs{
"mcpServers": {
"adityarapid-strapi_mcp": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"STRAPI_API_KEY": "your-jwt-token-from-strapi-admin",
"STRAPI_API_URL": "http://localhost:1337",
"STRAPI_VERSION": "5.*",
"STRAPI_SERVER_NAME": "default"
}
}
}
}You can use the Strapi MCP Server to interact with your Strapi CMS through a consistent, model-aware interface. It lets AI assistants perform content-type aware operations, REST API interactions, media handling, and version-aware requests across Strapi v4 and v5.
You use this MCP server by running it as a local or remote service and then connecting your MCP client to it. The server exposes a set of tools you can call to inspect Strapi content types, fetch components, and perform CRUD operations against the Strapi REST API. Use it to query data, create or update content, upload media, and navigate content structures with version-aware behavior for Strapi v4 and v5.
Prerequisites: you need Node.js and npm available on your machine. Ensure you have access to an environment where you can run MCP configurations and connect to your Strapi instance.
Install and run the Strapi MCP Server using the provided MCP command snippet.
Configuration supports two methods: environment variables (recommended for deployment) or a configuration file. The server expects a Strapi instance URL and an API token acquired from Strapi. You can optionally specify the Strapi version you target.
Environment variables to set when running the server:
{
"mcpServers": {
"strapi": {
"command": "npx",
"args": ["-y", "[email protected]"]
}
}
}Option 1: Environment Variables (Recommended for Deployment). Set these variables in your runtime environment.
STRAPI_API_URL=http://localhost:1337 STRAPI_API_KEY=your-jwt-token-from-strapi-admin STRAPI_SERVER_NAME=default # Defaults to 'default' STRAPI_VERSION=5.* # e.g., "5.*", "4.1.5", "v4"
Option 2: Configuration File. Create a config at ~/.mcp/strapi-mcp-server.config.json with entries for each Strapi instance.
Example config file content:
1. Log in to your Strapi admin panel 2. Create an API token with appropriate permissions 3. Add the token to your config file under the appropriate server name
- List available content types and components from your Strapi instance - Retrieve, create, update, or delete content via REST API calls - Upload and process media with optional format conversion - Work with version-aware endpoints and data structures for v4 and v5
The server supports a write-protection policy that requires explicit authorization for write operations (POST, PUT, DELETE, and media uploads). Each operation is logged and validated to help you monitor changes and maintain security.
Use filters, sorting, pagination, and selective population to optimize queries and control the data you fetch.
Common issues include authentication problems (invalid or expired tokens), version-specific data structure mismatches, and write-protection violations. Verify your token, confirm the configured Strapi version, and ensure you follow the write-protection policy for write operations.
The MCP server handles v4 and v5 differences, including ID formats, data structure, and endpoint behavior, so you can work against the correct model expectations for your Strapi instance.
List available Strapi MCP servers with version info and differences between v4 and v5.
Fetch all content types from a specified server to understand available structures.
Retrieve component definitions with pagination support.
Perform REST API operations (GET, POST, PUT, DELETE) against Strapi endpoints with validation and version-aware handling.
Upload and process media assets with optional format conversion and metadata.