Installation

Set up the Directus MCP server and connect your AI tools in under 5 minutes.

Get AI assistants connected to your Directus instance in three simple steps. The MCP server is built into Directus with no additional setup required.

MCP requires Directus v11.12+. For older versions, use the Local MCP alternative.

Quick Setup

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.

Choose an Authentication Method

Directus supports two ways to authenticate remote MCP clients. Use OAuth when your client supports remote server OAuth discovery and browser authorization. Use a static access token when your client requires a manually configured bearer token, header, or query parameter.

Enable MCP in Directus

  1. Log into your Directus admin as an administrator
  2. Go to Settings → AI → Model Context Protocol
  3. Click Enabled under MCP Server to activate the MCP server MCP Server Enabled
  4. Save the AI settings
Most users can keep the default settings. The MCP server is now ready at https://your-directus-url.com/mcp.

Configure Authentication

OAuth lets users sign in to Directus in the browser and approve MCP access from a consent page. The issued token is scoped to the MCP endpoint.

For self-hosted projects, enable the OAuth server and a client registration method. Prefer Client ID Metadata Document registration when your client supports it because it avoids unauthenticated local client creation:

.env
MCP_OAUTH_ENABLED=true
MCP_OAUTH_CIMD_ENABLED=true
PUBLIC_URL=https://directus.example.com

Use MCP_OAUTH_CIMD_ENABLED=true for Client ID Metadata Document registration, MCP_OAUTH_DCR_ENABLED=true for Dynamic Client Registration, or both if you intentionally support both onboarding paths.

After restarting Directus, go to Settings > AI > Model Context Protocol, enable OAuth Enabled, and enable the matching client registration setting for the project.

MCP OAuth settings with OAuth, Dynamic Client Registration, and Client ID Metadata Document enabled

Read the MCP OAuth guide for the full authorization flow, client registration behavior, and revocation steps.

Fallback: Static Access Token

Static access tokens work with clients that do not support MCP OAuth. Use a dedicated Directus user when possible.

  1. Navigate to User Directory.
  2. Click Create User.
  3. Configure the user:
    • Name: Your Name - MCP User or similar
    • Email: Email is not required for MCP operations.
    • Role: Create a new role or use an existing role with appropriate permissions.
  4. Open the user profile.
  5. Scroll to the Token field and generate a new token.
  6. Copy the token, then save the user.
Avoid using your personal admin account for AI operations. If you must use an existing user, open that user profile, generate a token from the Token field, copy it, and save the user.

Connect Your AI Client

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.

If your client supports MCP OAuth, connect to https://your-directus-url.com/mcp without adding an access token to the URL or headers. Use Client ID Metadata Document registration when your client supports it. Use Dynamic Client Registration when the client requires it.

Verify Connection

Once connected, test your setup with a simple question about your Directus instance:

Can you tell me about my Directus schema?
I'll help you explore your Directus schema. Let me start by getting my role information and then examine your database structure.
Called system-prompt
Called schema

User Permissions

Configure your AI user's role based on what you want them to do:

Content Editor Role (recommended for most users):

  • Collections: Read/Create/Update on your content collections
  • Files: Read/Create/Update/Delete
  • Folders: Read/Create/Update/Delete
  • System Collections: Read only

Developer Role (required for schema management):

  • All content permissions above, plus:
  • Collections: Full CRUD access
  • Fields: Full CRUD access
  • Relations: Full CRUD access
  • Flows: Full CRUD access

or add the administrator role to your MCP user.

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.

MCP Server Settings

MCP Server Settings

Access advanced options in Settings → AI → Model Context Protocol:

SettingTypeDefaultDescription
MCP ServerToggleDisabledConnect 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 DeletesToggleDisabledEnable deletion of items, files, flows, fields, relations, and collections through MCP tools. WARNING: May cause data loss. Disabled by default for safety.
AI Prompts CollectionSelectNo collection selectedSelect a collection to enable reusable prompt templates. Select existing collection or click "Generate AI Prompts collection..." to create one automatically.
Use System PromptToggleEnabledUse the default system prompt to guide LLM behavior. Disable to remove or override with your own prompt below.
Custom System PromptRich TextEmptyCustom system prompt to replace the default. Leave empty to use default (if enabled above).

Next Steps

Your MCP server is ready! Here's what to explore:

See What's Possible

Real examples of AI-powered content workflows that save hours of manual work.

Available Tools

Complete reference of MCP tools and their capabilities.

Custom Prompts

Create reusable prompt templates for consistent AI interactions.

Security Guide

Essential security practices for using MCP safely with your Directus data.

Troubleshooting

Common issues and solutions when setting up and using the Directus MCP server.

Get once-a-month release notes & real‑world code tips...no fluff. 🐰