Strapi CMS Integration
STDIOModel Context Protocol server for interacting with Strapi CMS through standardized interface.
Model Context Protocol server for interacting with Strapi CMS through standardized interface.
A Model Context Protocol server for interacting with Strapi CMS. This server enables AI assistants to interact with your Strapi instance through a standardized interface, supporting content types and REST API operations.
⚠️ IMPORTANT DISCLAIMER: This software has been developed with the assistance of AI technology. It is provided as-is and should NOT be used in production environments without thorough testing and validation. The code may contain errors, security vulnerabilities, or unexpected behavior. Use at your own risk for research, learning, or development purposes only.
For complete version history, see CHANGELOG.md.
You can use this server directly with npx in your Claude Desktop configuration:
{ "mcpServers": { "strapi": { "command": "npx", "args": ["-y", "@bschauer/[email protected]"] } } }
Create a configuration file at ~/.mcp/strapi-mcp-server.config.json
:
{ "myserver": { "api_url": "http://localhost:1337", "api_key": "your-jwt-token-from-strapi-admin", "version": "5.*" // Optional: Specify Strapi version (e.g., "5.*", "4.1.5", "v4") } }
You can configure multiple Strapi instances by adding them to this file.
The server now supports various version formats:
This helps the server provide version-specific guidance and handle API differences appropriately.
strapi_list_servers(); // Now includes version information and differences between v4 and v5
// Get all content types from a specific server strapi_get_content_types({ server: "myserver", }); // Get components with pagination strapi_get_components({ server: "myserver", page: 1, pageSize: 25, });
The REST API provides comprehensive CRUD operations with built-in validation and version-specific handling:
// Query content with filters strapi_rest({ server: "myserver", endpoint: "api/articles", method: "GET", params: { filters: { title: { $contains: "search term", }, }, }, }); // Create new content strapi_rest({ server: "myserver", endpoint: "api/articles", method: "POST", body: { data: { title: "New Article", content: "Article content", category: "news", }, }, }); // Update content strapi_rest({ server: "myserver", endpoint: "api/articles/123", method: "PUT", body: { data: { title: "Updated Title", content: "Updated content", }, }, }); // Delete content strapi_rest({ server: "myserver", endpoint: "api/articles/123", method: "DELETE", });
// Upload image with automatic optimization strapi_upload_media({ server: "myserver", url: "https://example.com/image.jpg", format: "webp", quality: 80, metadata: { name: "My Image", caption: "Image Caption", alternativeText: "Alt Text", }, });
Key differences between Strapi versions that the server handles automatically:
The server implements a strict write protection policy:
strapi_get_content_types
// Filter by field value params: { filters: { title: "Exact Match"; } } // Contains filter params: { filters: { title: { $contains: "partial"; } } } // Multiple conditions params: { filters: { $and: [{ category: "news" }, { published: true }]; } }
params: { sort: ["createdAt:desc"]; }
params: { pagination: { page: 1, pageSize: 25 } }
// Basic request without population params: { } // Selective population when needed params: { populate: ["category"]; } // Detailed population with field selection params: { populate: { category: { fields: ["name", "slug"]; } } }
Common issues and solutions:
404 Errors
Authentication Issues
Version-Related Issues
Write Protection Errors
Contributions are welcome! Please feel free to submit a Pull Request.
MIT