strapi-mcp-connect
v1.1.1Model Context Protocol (MCP) server for Strapi CMS.
An enterprise-ready Model Context Protocol (MCP) server that connects AI assistants such as Claude Desktop, Cursor, VS Code, Windsurf, Claude Code, and Antigravity directly to your Strapi Headless CMS. Use natural-language requests to work with Strapi content through MCP tools for CRUD operations, Single Types, Collection Types, filtering, pagination, relations, media population, and draft/published content workflows. The executable exposed by the package is:
Summary extracted from the README.
strapi-mcp-connect
An enterprise-ready Model Context Protocol (MCP) server that connects AI assistants such as Claude Desktop, Cursor, VS Code, Windsurf, Claude Code, and Antigravity directly to your Strapi Headless CMS.
Use natural-language requests to work with Strapi content through MCP tools for CRUD operations, Single Types, Collection Types, filtering, pagination, relations, media population, and draft/published content workflows.
๐๏ธ Architecture & How It Works
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ AI Client / Assistant โ
โ Claude Desktop โข Cursor โข VS Code โข Windsurf โข etc. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Standard I/O (stdio)
โ JSON-RPC MCP Protocol
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ strapi-mcp-connect โ
โ Type-Safe Zod Schema & Validation Engine โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Authenticated REST API
โ Bearer Token / API Token
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Strapi CMS (v4 / v5) โ
โ http://localhost:1337 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Request Flow
Natural-language request
โ
AI Client / Assistant
โ
MCP Tool Selection
โ
Schema Validation
โ
Strapi REST API
โ
Create / Read / Update / Delete / Publish
โ
Result returned to the AI client
โจ Key Highlights
- โก Zero-Clone Setup with
npx: Run the MCP server directly without manually downloading or cloning the repository. - ๐ง Auto Schema Discovery: Automatically fetches content types and components schemas so the AI knows exactly how to map data (including Dynamic Zones).
- ๐ผ๏ธ Media Uploads: Directly uploads images and local files to the Strapi Media Library and links them to entries.
- ๐ฆ Full Collection CRUD: Complete create, read, update, and delete support across Collection Types.
- ๐ Native Single Types: First-class support for Single Types such as
homepage,navigation,footer, andglobal. - ๐ Strapi v4 & v5 Ready: Supports Strapi v4 numeric IDs and Strapi v5
documentId-based content workflows. - ๐ Deep Population & Filters: Supports filtering, sorting, pagination, relations, and media population such as
populate=*. - ๐ก๏ธ Type-Safe Validation: Built with the Model Context Protocol TypeScript SDK and Zod schemas.
- ๐ Token-Based Authentication: Uses a Strapi API Token for authenticated REST API access.
๐ฆ Installation
Install from npm
npm install strapi-mcp-connect
Run directly with npx
npx -y strapi-mcp-connect
CLI command
The executable exposed by the package is:
strapi-mcp-connect
โ๏ธ Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
STRAPI_URL |
Yes | http://localhost:1337 |
Base URL of your Strapi CMS. |
STRAPI_API_TOKEN |
Yes | โ | Strapi API Token used to authenticate REST API requests. |
Example:
STRAPI_URL=http://localhost:1337
STRAPI_API_TOKEN=YOUR_STRAPI_API_TOKEN
Security: Never commit real Strapi API tokens to GitHub or hard-code them in source code. Use environment variables or your AI client's secure environment configuration.
๐ Quick Setup Guide
1. Claude Desktop
Add this configuration to your Claude Desktop configuration file.
Windows
%APPDATA%\Claude\claude_desktop_config.json
macOS
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"strapi": {
"command": "npx",
"args": [
"-y",
"strapi-mcp-connect"
],
"env": {
"STRAPI_URL": "http://localhost:1337",
"STRAPI_API_TOKEN": "YOUR_STRAPI_API_TOKEN"
}
}
}
}
Restart Claude Desktop after changing the configuration.
2. Cursor IDE
Open Cursor Settings โ Features โ MCP, or configure MCP in your project using .cursor/mcp.json.
{
"mcpServers": {
"strapi": {
"command": "npx",
"args": [
"-y",
"strapi-mcp-connect"
],
"env": {
"STRAPI_URL": "http://localhost:1337",
"STRAPI_API_TOKEN": "YOUR_STRAPI_API_TOKEN"
}
}
}
}
3. Windsurf IDE
Add the server to:
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"strapi": {
"command": "npx",
"args": [
"-y",
"strapi-mcp-connect"
],
"env": {
"STRAPI_URL": "http://localhost:1337",
"STRAPI_API_TOKEN": "YOUR_STRAPI_API_TOKEN"
}
}
}
}
4. VS Code
For MCP-compatible VS Code clients or extensions, configure the server in .vscode/mcp.json when supported:
{
"servers": {
"strapi": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"strapi-mcp-connect"
],
"env": {
"STRAPI_URL": "http://localhost:1337",
"STRAPI_API_TOKEN": "YOUR_STRAPI_API_TOKEN"
}
}
}
}
5. Antigravity IDE
Add to your global or workspace MCP configuration:
~/.gemini/config/mcp_config.json
{
"mcpServers": {
"strapi": {
"command": "npx",
"args": [
"-y",
"strapi-mcp-connect"
],
"env": {
"STRAPI_URL": "http://localhost:1337",
"STRAPI_API_TOKEN": "YOUR_STRAPI_API_TOKEN"
}
}
}
}
6. Claude Code CLI
Add the MCP server with:
claude mcp add strapi -- npx -y strapi-mcp-connect
๐ ๏ธ Available MCP Tools & Parameters
| Tool | Purpose | Parameters |
|---|---|---|
test_connection |
Verifies Strapi availability and token authentication. | None |
get_content_types_schema |
Fetches the schema of all Collections and Single Types. | None |
get_components_schema |
Fetches the schema of all components (Dynamic Zones). | None |
upload_media |
Uploads a local file to the Strapi Media Library. | filePath |
get_entries |
Fetches Collection Type entries with pagination, sorting, filters, population, and status. | pluralApiId, page, pageSize, filters, populate, sort, status |
get_entry |
Fetches a Collection Type entry by id or documentId. |
pluralApiId, id, populate, status |
get_single_type |
Fetches Single Type content such as homepage or footer. |
singularApiId, populate, status |
update_single_type |
Updates Single Type content. | singularApiId, data |
create_entry |
Creates a new Collection Type entry. | pluralApiId, data, status |
update_entry |
Updates an existing Collection Type entry. | pluralApiId, id, data |
delete_entry |
Deletes a Collection Type entry. | pluralApiId, id |
raw_query |
Sends a direct request to a custom Strapi endpoint. | endpoint, method, body |
๐ก Practical Examples
1. Fetch entries with relations
Tool: get_entries
{
"pluralApiId": "articles",
"populate": "*",
"sort": "createdAt:desc",
"pageSize": 10
}
2. Create a published entry
Tool: create_entry
{
"pluralApiId": "pages",
"data": {
"title": "Pricing Plans",
"slug": "pricing",
"description": "Explore our subscription plans"
},
"status": "published"
}
3. Fetch a Single Type
Tool: get_single_type
{
"singularApiId": "homepage",
"populate": "*"
}
๐ Generating Your Strapi API Token
- Open your Strapi Admin Panel:
http://localhost:1337/admin - Go to Settings โ API Tokens.
- Click Create new API Token.
- Use a name such as:
MCP Connector - Choose the permissions required for your content operations.
- Save the token and copy it securely.
Then configure:
STRAPI_API_TOKEN=YOUR_STRAPI_API_TOKEN
For production environments, use the minimum permissions required for the workflow instead of granting unnecessary access.
๐ฌ Natural Language Prompt Examples
After configuration, you can ask your AI assistant:
List all entries from my articles collection in Strapi.
Fetch the homepage single type content and summarize it.
Create a new product in Strapi with title "Wireless Headphones" and price 149.
Update the about-page entry and change the contact email.
Find all draft pages in Strapi.
Create a 2BHK property in Ahmedabad with a price of 45 lakh.
๐ Security & Permissions
This MCP server communicates with Strapi through authenticated REST API requests.
Recommended practices:
- Never hard-code Strapi API tokens in source code.
- Never commit
.envfiles containing real credentials. - Grant only the Strapi permissions required by your workflow.
- Keep production credentials separate from local development credentials.
- Review
raw_queryusage carefully because it can access custom endpoints supported by the configured token.
โ Troubleshooting & FAQs
| Issue | Root Cause | Solution |
|---|---|---|
| 401 Unauthorized | Invalid, expired, or missing Strapi API Token. | Generate a valid API token and update STRAPI_API_TOKEN. |
| 403 Forbidden | The token does not have sufficient permissions. | Update the token permissions for the required content type/action. |
| 404 Not Found | Incorrect Collection Type name, Single Type name, or endpoint. | Verify the exact API ID in Strapi. |
| Connection Refused | Strapi is not running or STRAPI_URL is incorrect. |
Start Strapi and verify the configured URL. |
| Tools Not Showing | MCP configuration is incorrect or the AI client has not reloaded the server. | Check the JSON configuration and restart the AI client. |
| Invalid Data | Request fields do not match the Strapi content-type schema. | Check the content-type schema and provide the correct fields. |
๐บ๏ธ Roadmap
- Automated Schema & Content-Type Discovery
- GraphQL query execution support
- Advanced Strapi Media Library management
- Batch entry creation & bulk updates
- More granular permission-aware tool discovery
โ ๏ธ Known Limitations
- REST API Dependency: This MCP server communicates with Strapi through the REST API.
- Permissions: Available operations depend on the permissions assigned to the configured Strapi API Token.
- Custom Plugins: Custom plugins with non-standard route structures can be accessed using
raw_querywhen the token has sufficient permissions. - Schema Discovery & Uploads: The
STRAPI_API_TOKENmust have specific permissions for the Content-Type Builder and Upload plugins to use the schema discovery and media upload tools.
๐ค Contributing
Contributions, issues, and feature requests are welcome.
- Fork the repository.
- Create a feature branch.
- Make your changes.
- Run the build.
- Verify the MCP server locally.
- Open a pull request.
๐ฎ Future Vision & Enterprise Roadmap
As strapi-mcp-connect grows, we are planning a major Enterprise-Level architecture update. In the future, this project will be refactored into a scalable, modular structure (separating tools, schemas, and API logic) and will include the following highly advanced features:
1. AI-Driven Schema Generation (The Holy Grail)
The AI won't just read schemasโit will write them. By hooking into Strapi's Content-Type Builder API, you can tell the AI: "I need a blog system with authors and categories." The MCP server will automatically generate the databases, build the relations, and restart your Strapi server autonomously.
2. Semantic Search & RAG (Retrieval-Augmented Generation)
Integration with Vector Databases (like Pinecone) or deep search plugins. You will be able to ask the AI, "Find any articles in Strapi that talk about the feeling of sadness," and it will search the underlying meaning of your Strapi content to return results.
3. Bi-Directional Real-Time Sync (Webhooks + SSE)
Strapi Webhooks will ping the MCP server whenever human editors update data in the Strapi Admin Panel. The MCP server will push notifications back into your AI chat: "Warning: The marketing team just updated the Homepage schema. Do you want me to fetch the new schema?"
4. Automated i18n (Internationalization) Engine
For multi-language projects, the AI can scan an English article in Strapi, automatically translate it into Spanish, French, and German, and push all new localized entries into Strapi simultaneously, perfectly linking the locales.
5. Advanced Asset Processing Pipeline
The upload_media tool will intercept local images, automatically compress them, resize them for responsive web, convert them to .webp format for lightning-fast loading, and then upload them to Strapi.
6. High-Performance Enterprise Features
- Caching Layer: Redis or in-memory caching for schema discovery to save Strapi server resources.
- Batch Operations: Bulk CSV uploads and multi-entry payloads to prevent rate-limiting on massive jobs.
- GraphQL Support: Full GraphQL support for deeply nested relational data.
- Advanced Telemetry: Winston/Pino logging connected to Datadog, Sentry, or AWS CloudWatch.
๐ License
Distributed under the MIT License.
Authored with โค๏ธ by Kevin Patel