# Directus MCP

> Connect AI assistants directly to your Directus instance. Let Claude, ChatGPT, and other AI tools manage your content without manual copy-pasting.

AI assistants can now directly access your Directus content using the [Model Context Protocol](https://modelcontextprotocol.io/introduction) (MCP). Instead of copying data back and forth, your AI tools connect directly to your Directus instance.

<callout color="info" icon="i-lucide-info">

**MCP requires Directus v11.12+**. For older versions, use the [Local MCP alternative](/guides/ai/mcp/local-mcp).

</callout>

## How can this help me?

- **Content editors**: Migrate content from Google Docs, organize individual files, and manage content with AI assistance.
- **Developers**: Rapidly prototype data models, create collections, and build automation workflows.
- **Teams**: Dramatically speed up content operations while maintaining brand consistency.

## Get started with the Directus MCP Server

<card-group>
<card icon="i-lucide-rocket" title="Quick Setup" to="/guides/ai/mcp/installation">

Enable MCP and connect your AI tools in under 5 minutes.

</card>

<card icon="i-lucide-zap" title="See What's Possible" to="/guides/ai/mcp/use-cases">

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

</card>

<card icon="i-lucide-wrench" title="Available Tools" to="/guides/ai/mcp/tools">

Complete reference of MCP tools and their capabilities.

</card>

<card icon="i-lucide-message-circle" title="Custom Prompts" to="/guides/ai/mcp/prompts">

Create reusable prompt templates for consistent AI interactions.

</card>

<card icon="i-lucide-shield" title="Security Guide" to="/guides/ai/mcp/security">

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

</card>

<card icon="i-lucide-circle-question-mark" title="Troubleshooting" to="/guides/ai/mcp/troubleshooting">

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

</card>

<card icon="i-lucide-server" title="Local Alternative" to="/guides/ai/mcp/local-mcp">

Node.js-based MCP server for advanced setups and older Directus versions.

</card>
</card-group>

---

## What you can do with the Directus MCP Server?

### For Content Editors

**Use LLMs and AI to create and manage content.**

- Import blog posts from Google Docs with proper field mapping
- Build landing pages using page builder components and relationships
- Add metadata to individual images (alt text, descriptions, tags)
- Organize files into logical folder structures
- Create content entries with proper relationships to authors, categories, etc.

### For Developers

**Rapidly prototype data models and build automation using natural language.**

- Create collections with proper field types and validation rules
- Set up complex relationships (M2O, O2M, M2M, M2A) between collections
- Generate automation flows triggered by database events
- Build approval workflows with custom operations
- Prototype entire data models through conversation

---

## How it works

1. Enable MCP in Directus Settings → AI
2. Generate an access token for your MCP user (we recommend creating a dedicated user for MCP operations)
3. Connect your AI tool to the Directus MCP server
4. Use AI to create, edit, and manage your content

Your AI assistant operates through your existing Directus permissions - no middleware or data copying required.

---

## Security built-in

- Uses your existing Directus permissions
- Complete audit trail of all changes
- Global delete protection (disabled by default)

<callout color="info" icon="i-lucide-shield">

**Security**: For production deployments, review our comprehensive [**Security Guide**](/guides/ai/mcp/security) covering threat mitigation, compliance requirements, and enterprise security controls.

</callout>

---

## Supported clients

- **ChatGPT**
- **Claude Desktop**
- **Cursor**
- **Claude Code**
- **VS Code**
- **Raycast**

---

## Real-world examples

### Content Creation

<chat :messages="[{"role":"user","content":"Can you convert this blog post over to Directus for me - with all the proper fields?"},{"role":"assistant","content":"I'll help you convert this blog post to Directus! First, let me get the system prompt to understand the role better, then I'll examine the current schema to see what collections exist.","toolInvocations":[{"toolCallId":"system-prompt","toolName":"system-prompt","state":"result"},{"toolCallId":"schema","toolName":"schema","state":"result"}]},{"role":"assistant","content":"Perfect! I can see you have a posts collection already. Let me examine its schema to understand the current structure:","toolInvocations":[{"toolCallId":"schema-detailed","toolName":"schema","state":"result"}]},{"role":"assistant","content":"Great! Your posts collection has all the essential fields for blog content. Now I'll create this blog post in your Directus instance. The structure looks perfect for this content - I'll populate the title, slug, content, excerpt, and tags fields.","toolInvocations":[{"toolCallId":"create-post","toolName":"items","state":"result","result":"Created blog post"}]},{"role":"assistant","content":"✅ **Perfect!** I've successfully created your blog post in Directus with:\n\n- **Title**: \"Why Content Workflows Suck (And What to Do About It)\"\n- **Status**: Set to \"draft\" for review\n- **Content**: Full markdown content with proper formatting\n- **Tags**: Added relevant tags including \"content management\", \"workflow\", \"CMS\"\n\nThe post is now available in your Directus admin. Would you like me to set the status to \"published\" or make any other adjustments?"}]" chatId="content-creation">



</chat>

### Asset Organization

<chat :messages="[{"role":"user","content":"I just uploaded a product photo but forgot to add alt text. Can you analyze this image and add proper metadata?"},{"role":"assistant","content":"I'll analyze the image and add appropriate metadata. Let me retrieve the image first:","toolInvocations":[{"toolCallId":"get-image","toolName":"assets","state":"result","result":"Retrieved image data"}]},{"role":"assistant","content":"I can see it's a photo of a red leather handbag with gold hardware on a white background. Let me update the file metadata:","toolInvocations":[{"toolCallId":"update-metadata","toolName":"files","state":"result","result":"Updated file metadata"}]},{"role":"assistant","content":"✅ **Done!** I've updated your image with:\n\n- **Title**: \"Red Leather Handbag with Gold Hardware\"\n- **Alt Text**: \"Red leather handbag with gold chain strap on white background\"\n- **Description**: \"Premium red leather handbag with gold-tone hardware for product catalog\"\n- **Tags**: Added \"handbag\", \"leather\", \"red\", \"gold-hardware\"\n\nThe file metadata has been updated. Would you like me to organize it into a specific folder as well?"}]" chatId="asset-organization">



</chat>

### Data Modeling

<chat :messages="[{"role":"user","content":"Help me build a custom CRM inside my Directus instance. Organizations and contacts with many-to-many, deals with relations to both, activities for tracking emails/calls, deal stages collection."},{"role":"assistant","content":"I'll help you build a custom CRM! Let me start by understanding your current setup and then create the collections with proper relationships.","toolInvocations":[{"toolCallId":"system-prompt","toolName":"system-prompt","state":"result"},{"toolCallId":"schema-check","toolName":"schema","state":"result"}]},{"role":"assistant","content":"Perfect! Clean instance. I'll create your CRM collections step by step:","toolInvocations":[{"toolCallId":"create-organizations","toolName":"collections","state":"result","result":"Created organizations collection"},{"toolCallId":"create-contacts","toolName":"collections","state":"result","result":"Created contacts collection"},{"toolCallId":"create-deal-stages","toolName":"collections","state":"result","result":"Created deal_stages collection"}]},{"role":"assistant","content":"Collections created! Now creating deals with proper relationships:","toolInvocations":[{"toolCallId":"create-deals","toolName":"collections","state":"result","result":"Created deals collection"},{"toolCallId":"create-activities","toolName":"collections","state":"result","result":"Created activities collection"},{"toolCallId":"create-org-contacts-junction","toolName":"collections","state":"result","result":"Created M2M junction table"}]},{"role":"assistant","content":"✅ **CRM is ready!** Your collections:\n\n- **Organizations** & **Contacts** (M2M via junction table)\n- **Deals** → Organizations, Contacts, Deal Stages, Users (owner)\n- **Activities** → Organizations, Contacts, Deals (emails, calls, tasks)\n- **Deal Stages** for pipeline management\n\nAll owners linked to directus_users. Ready to start managing your sales pipeline!"}]" chatId="data-modeling">



</chat>
