content/guides/11.ai/2.mcp/1.installation.md
Get AI assistants connected to your Directus instance in three simple steps. The MCP server is built into Directus with no additional setup required.
::callout{icon="material-symbols:info" color="info"} MCP requires Directus v11.12+. For older versions, use the Local MCP alternative. ::
The Directus MCP server is disabled by default and must be manually enabled. When enabled, it uses the same permissions as the user account you connect with. AI tools can only access what that user is allowed to see and do.
System administrators can completely disable MCP functionality through configuration environment variables.
::steps{level="3"}
::callout{color="primary"}
Most users can keep the default settings. The MCP server is now ready at https://your-directus-url.com/mcp.
::
::tabs
::
You control the LLM integration. This tool connects to your own language model - either self-hosted or via a public service like OpenAI, Anthropic, or others.
Choose your AI tool and follow the setup:
::accordion{type="single"}
:::accordion-item{label="ChatGPT" icon="i-simple-icons-openai"}
https://your-directus-url.com/mcp?access_token=your-generated-token:::
:::accordion-item{label="Claude Desktop" icon="i-simple-icons-anthropic"}
https://your-directus-url.com/mcp?access_token=your-generated-token:::
:::accordion-item{label="Cursor" icon="vscode-icons:file-type-cursorrules"}
.cursor/mcp.json in your project root:{
"mcpServers": {
"directus": {
"url": "https://your-directus-url.com/mcp",
"headers": {
"Authorization": "Bearer your-generated-token"
}
}
}
}
your-directus-url.com and your-generated-token with your values:::
:::accordion-item{label="Claude Code" icon="i-simple-icons-anthropic"}
claude mcp add --transport http directus https://your-directus-url.com/mcp \
--header "Authorization: Bearer your-generated-token"
# Start Claude Code
claude
# Ask Claude to test the connection
> "Can you tell me about my Directus schema?"
:::
:::accordion-item{label="VS Code" icon="i-simple-icons-visualstudiocode"}
mcp.json in your workspace .vscode folder or user settings{
"servers": {
"directus": {
"type": "http",
"url": "https://your-directus-url.com/mcp",
"headers": {
"Authorization": "Bearer ${input:directus-token}"
}
}
},
"inputs": [
{
"id": "directus-token",
"type": "promptString",
"description": "Directus Access Token",
"password": true
}
]
}
:::
:::accordion-item{label="Raycast" icon="i-simple-icons-raycast"}
https://your-directus-url.com/mcp?access_token=your-generated-token@directus to interact with your instance:::
::
::
Once connected, test your setup with a simple question about your Directus instance:
chatId: "verify-connection" messages:
:::
Configure your AI user's role based on what you want them to do:
Content Editor Role (recommended for most users):
Developer Role (required for schema management):
or add the administrator role to your MCP user.
::callout{icon="material-symbols:info" color="info"} Note: The MCP server uses your existing permissions and access policy settings. AI tools can only access what you explicitly allow - just like any other Directus user. See Access Control for more information. ::
Access advanced options in Settings → AI → Model Context Protocol:
| Setting | Type | Default | Description |
|---|---|---|---|
| MCP Server | Toggle | Disabled | Connect AI/LLM tools to your Directus project via Model Context Protocol (MCP). This enables AI assistants to read and interact with your Directus data securely. |
| Allow Deletes | Toggle | Disabled | Enable deletion of items, files, flows, fields, relations, and collections through MCP tools. WARNING: May cause data loss. Disabled by default for safety. |
| AI Prompts Collection | Select | No collection selected | Select a collection to enable reusable prompt templates. Select existing collection or click "Generate AI Prompts collection..." to create one automatically. |
| Use System Prompt | Toggle | Enabled | Use the default system prompt to guide LLM behavior. Disable to remove or override with your own prompt below. |
| Custom System Prompt | Rich Text | Empty | Custom system prompt to replace the default. Leave empty to use default (if enabled above). |
Your MCP server is ready! Here's what to explore:
::card-group
:::card{title="See What's Possible" icon="material-symbols:bolt" to="/guides/ai/mcp/use-cases"} Real examples of AI-powered content workflows that save hours of manual work. :::
:::card{title="Available Tools" icon="material-symbols:construction" to="/guides/ai/mcp/tools"} Complete reference of MCP tools and their capabilities. :::
:::card{title="Custom Prompts" icon="material-symbols:chat" to="/guides/ai/mcp/prompts"} Create reusable prompt templates for consistent AI interactions. :::
:::card{title="Security Guide" icon="material-symbols:security" to="/guides/ai/mcp/security"} Essential security practices for using MCP safely with your Directus data. :::
:::card{title="Troubleshooting" icon="material-symbols:help" to="/guides/ai/mcp/troubleshooting"} Common issues and solutions when setting up and using the Directus MCP server. :::
::