MCP Server

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 is currently in Beta and requires Directus v11.12+. For older versions, use the Local MCP alternative.

Quick Setup

Enable MCP in Directus

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

Generate Access Token

  1. Navigate to User Directory
  2. Click Create User with these settings:
    • Email: ai-assistant@yourcompany.com (or similar)
    • Role: Create a new role or use existing role with appropriate permissions
  3. Generate an access token:
    • Open the user profile
    • Scroll to Token field → Generate new token
    • Copy the token (you'll need it next)
    • Save the user

Connect Your AI Client

Choose your AI tool and follow the setup:

Verify Connection

Test your setup with a simple question:

I have this blog post in Google Docs about AI trends in 2024. Can you import it as a new article in my blog collection?
I'll help you import that article. Let me first check your blog collection structure to understand the available fields... I can see you have fields for title, content, author, category, tags, and published_date. Please share the Google Doc content and I'll create a properly formatted blog post entry with the correct relationships.

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

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. 🐰