MCP server
The DatoCMS MCP server connects DatoCMS directly to AI assistants through the Model Context Protocol (MCP). It allows MCP-compatible tools, such as Claude Code, Cursor, VS Code, and Windsurf, to interact with your DatoCMS projects using natural language commands. Log in once via OAuth and work across every project you have access to in a single session.
The DatoCMS MCP server acts as a bridge between AI assistants and the DatoCMS Content Management API, allowing large language models (LLMs) to interact with your DatoCMS projects in a structured, secure, and standardized way. Unlike traditional MCP servers that simply expose raw API endpoints, this server uses a layered tool design that guides LLMs through discovery, planning, and execution stages, significantly improving success rates and reliability.
What you can do
The DatoCMS MCP server allows AI assistants to:
Explore the API: Discover available resources, actions, and methods with complete documentation
Inspect your schema: Retrieve detailed information about your content models, fields, and relationships
Execute API operations: Perform both read-only and destructive operations on your DatoCMS project
Write and run scripts: Create TypeScript scripts that batch multiple operations together
Work across multiple projects: Log in once via OAuth and switch between any project you have access to in the same session, without restarting the server or swapping environment variables
Users report excellent success rates for operations like:
Create new records with content across multiple fields
Upload and attach images to records
Add translations to existing records
Link records together (establishing relationships)
Update content across multiple records
Modify your content schema
Most operations complete fast and accurately, with occasional minor refinements needed (which can be requested in follow-up prompts).
Requirements
A DatoCMS account (you will authenticate via OAuth on first use)
An MCP-compatible client: Claude Code (recommended), ChatGPT Codex, VS Code, Cursor, Windsurf, or other MCP clients
Recommended clients
Claude Code is strongly recommended for the best experience - fast, responsive performance with excellent success rates. Claude Desktop may experience significant lag and UI issues.
⭐ Claude Code (Recommended)
Claude Code provides the best experience with the DatoCMS MCP server:
Fast and responsive performance
Reliable execution without lag or UI issues
Excellent success rate for complex operations
Works seamlessly with all MCP tools
Other supported clients:
ChatGPT Codex: Works reliably, though may be slower than Claude Code
VS Code / Cursor: Good performance, works reliably
Claude Desktop: ⚠️ Not recommended - can experience significant lag and UI issues that may affect usability
Below, we list the installation instructions for multiple popular IDEs and apps, but the above are the ones we have the most experience with and recommend.
Installation
The DatoCMS MCP server can be installed using standard MCP configuration. Choose the installation method for your client:
Before running any of the MCP clients, please make sure your system has Node 18+ installed so the npx command will work. Download the latest Node.js versions here.
Claude Code
Use the Claude Code CLI to add the DatoCMS MCP server:
claude mcp add datocms -- npx -y @datocms/mcp@latestChatGPT Codex
Use the ChatGPT Codex CLI to add the DatoCMS MCP server:
codex mcp add datocms -- npx -y @datocms/mcp@latestCursor
Go to Cursor Settings → Tools & Integrations → New MCP Server, then paste:
{ "mcpServers": { "datocms": { "command": "npx", "args": ["-y", "@datocms/mcp@latest"] } }}VS Code
Follow the MCP installation guide or use the VS Code CLI:
code --add-mcp '{"name":"datocms","command":"npx","args":["-y", "@datocms/mcp@latest"]}'Windsurf
Follow Windsurf MCP documentation. Add to ~/.codeium/windsurf/mcp_config.json:
{ "mcpServers": { "datocms": { "command": "npx", "args": ["-y", "@datocms/mcp@latest"] } }}Claude Desktop
Edit your config file at:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%/Claude/config.json
Or go to Settings → Developer → Edit Config in Claude Desktop.
Add the following configuration:
{ "mcpServers": { "datocms": { "command": "npx", "args": ["-y", "@datocms/mcp@latest"] } }}Restart Claude Desktop after saving.
Google Antigravity
In Antigravity Settings → Customizations → Installed MCP Servers, click the Open MCP Config button. You can also directly open or create the file ~/.gemini/antigravity/mcp_config.json and use this configuration:
{ "mcpServers": { "datocms": { "command": "npx", "args": ["-y", "@datocms/mcp@latest"] } }}How it works
Unlike traditional MCPs that expose every API endpoint, the DatoCMS MCP server takes a different approach designed to guide AI assistants through API interactions effectively.
Layered tools, not raw endpoints
DatoCMS has 40+ resources and 150+ API endpoints. Exposing all of them would overwhelm any LLM. Instead, we provide 10 carefully designed tools organized in three layers (discovery → planning → execution) that guide the AI through a natural workflow:
Discovery layer - Tools that help explore what's available:
resources: List all available API resources grouped by theme
resource: Get details about a specific resource and its available actions
resource_action: Show available methods for a specific action with usage examples
Planning layer - Tools that provide detailed documentation:
resource_action_method: Get complete TypeScript definitions for a specific method, including argument types, return types, and all dependencies
schema_info: Retrieve detailed information about your content models, fields, relationships, and nested blocks (requires login)
Execution layer - Tools that perform operations (require login):
resource_action_readonly_method_execute: Execute read-only operations (list, find, queries)
resource_action_destructive_method_execute: Execute write operations (create, update, destroy)
Script tools (create_script, view_script, update_script, execute_script): Create, manage, and execute TypeScript scripts that batch multiple operations together
This layered structure reduces malformed API calls and helps AI assistants understand the full context before executing operations.
Documentation-aware
Each tool retrieves detailed method documentation and concrete examples from the official DatoCMS documentation. This is token-intensive, but it significantly improves success rates by giving the LLM the context it needs to make correct API calls.
Script-based execution
Instead of making one API call at a time, the DatoCMS MCP server enables AI assistants to write complete TypeScript programs that batch multiple operations to reduce round-trips and token overhead, provide full context for complex multi-step operations, support incremental editing when errors occur, and get validated before execution to catch errors early.
Performance & reliability
Real-world performance
When using Claude Code (our recommended client), users report:
Fast execution: Most common operations complete quickly without noticeable delays
High success rates: Operations like creating records, adding images, managing translations, and linking records work reliably
Minimal iteration needed: Most tasks succeed on the first attempt, with occasional minor refinements needed through follow-up prompts
No missteps: The layered approach effectively prevents malformed API calls
What to expect
Common operations (fast & reliable):
Creating records with content across multiple fields
Uploading and attaching images to records
Adding translations to existing content
Linking records together
Copying content between models
Listing and querying records
Complex operations (slower but functional):
Very complex operations like generating complete landing pages may take 5-10 minutes
Large batch operations involving many records
Schema modifications across multiple models
Token consumption
The documentation-aware approach retrieves full method documentation and examples for each operation. This consumes more tokens than traditional MCPs but significantly improves success rates. For most practical tasks, the token cost is acceptable given the reliability and accuracy of results.
Success tips
Results improve with:
Clear, specific prompts: "Create a blog post with title 'Hello' and attach the uploaded image" works better than "add a post"
Iterative refinement: If something is missing (like an image), a simple follow-up request handles it quickly
Using Claude Code: The recommended client provides the best experience with fast, reliable execution
Limitations to be aware of
Output limits: Very large records or complex batch operations may hit timeout or output limits
Default limits: Script execution times out after 60 seconds, output limited to 2KB
Client-specific issues: Claude Desktop may experience lag and UI issues - use Claude Code instead
When it works best
The DatoCMS MCP server excels at:
Everyday content management tasks (creating, updating, translating records)
Complex multi-step operations that require understanding your content model
Tasks that would be tedious to do manually (bulk updates, content migration)
Operations that benefit from type safety and validation
Security
The DatoCMS MCP server implements multiple security layers:
Script validation
All scripts undergo strict validation before execution:
Package whitelist: Scripts can only import from:
@datocms/*- DatoCMS official packagesdatocms-*- DatoCMS-prefixed packages./schema- Local schema definitions
Enforced function signature: Scripts must export a default async function with exactly one
Clientparameter. This ensures scripts can only interact with the DatoCMS API through the provided client.Type safety: Scripts cannot use
anyorunknowntypes, preventing type-unsafe operations.AST-level validation: The TypeScript compiler API validates the script's structure before any code execution.
For implementation details, see src/lib/scripts/validation.ts.
OAuth credential security
OAuth credentials are stored locally at
~/.config/datocms-mcp/credentials.jsonwith restrictive file permissionsUse scoped access during the OAuth authorization step to limit which projects the MCP server can access
Use
datocms_logoutto revoke tokens — this contacts the server to invalidate the token before removing local credentialsRevoked or expired tokens are detected automatically and prompt a re-login
Troubleshooting
Server not connecting
Verify Node.js version is 18 or newer:
node --versionCheck that
npxis available:which npxEnsure your MCP client configuration is correct
Restart your IDE or client after configuration changes
Authentication issues
Run
datocms_loginto re-authenticate if your token has been revoked or has expiredUse
datocms_whoamito verify which account is currently logged inCheck that you granted access to the correct projects during the OAuth authorization step
Try
datocms_logoutfollowed bydatocms_loginto start a fresh session
Tools not appearing
Check if the server is running in your MCP client's server list
Review server logs for errors (method varies by client)
Verify network access to DatoCMS endpoints
For Claude Code, use:
claude mcp logs datocmsFor Claude Desktop, check the Developer tools console
Script execution failures
Review the validation errors - they indicate specific issues with script structure
Ensure you're using the correct TypeScript syntax
Verify all imports are from allowed packages
Check that the function signature matches the required format
Make sure you've called the appropriate documentation tools before using API methods
Performance issues
If operations are taking too long:
Switch to Claude Code: If you're using Claude Desktop and experiencing lag, switch to Claude Code for significantly better performance
Consider breaking very complex tasks into smaller steps
Use more specific prompts to reduce exploration time
Consider breaking very long-running operations into smaller steps
Check if you can use simpler API methods for your use case
Client-specific issues
Claude Desktop lag/freezing:
This is a known issue with Claude Desktop when using MCP servers
Solution: Switch to Claude Code for a much better experience
Claude Code handles the same MCP with fast, responsive performance
ChatGPT Codex slower performance:
ChatGPT Codex works reliably but may be slower than Claude Code
This is normal and doesn't indicate a problem
Operations will still complete successfully
Feedback & Contributing
We value your feedback to improve the DatoCMS MCP server:
Report issues: Open an issue on GitHub
Share your experience: Let us know what works well and what doesn't
Suggest improvements: Tell us about use cases that succeed or fail
Contact us: Reach out at support@datocms.com
Your feedback helps us identify common issues, improve documentation, and enhance the server's capabilities.