Provides comprehensive tools for interacting with Directus instances, including collection and item CRUD operations, schema management, relationship creation, flow automation, user management, file operations, and diagnostics capabilities.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Directus MCP Servershow me the latest 5 blog posts from the articles collection"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@staminna/directus-mcp-server
Enhanced MCP (Model Context Protocol) server for Directus with TypeScript, WebSocket support, and full API coverage.
Features
🔐 Full Authentication - Token-based authentication with Directus
📦 Collection Management - CRUD operations for collections and items
📁 File Operations - Upload, download, and manage files
🔄 Flow Management - Create, update, trigger, and manage Directus Flows
👥 User Management - User CRUD and role management
🔍 Schema Tools - Analyze and validate collection schemas
🩺 Diagnostics - Collection access diagnostics and troubleshooting
⚡ WebSocket Support - Real-time subscriptions (coming soon)
Installation
Via npm (Recommended)
From Source
Environment Variables
Variable | Required | Description |
| Yes | Your Directus instance URL (e.g., |
| Yes | Static API token with appropriate permissions |
| No | Enable AI prompts collection ( |
| No | Collection name for AI prompts (default: |
| No | Enable resources feature ( |
| No | Exclude system collections from resources ( |
| No | Environment mode ( |
IDE Configuration
🟣 Cursor
Open Cursor Settings:
Cmd+,(macOS) orCtrl+,(Windows/Linux)Search for "MCP" or navigate to Features → MCP Servers
Click "Edit in settings.json"
Add the following configuration:
Or if installed locally:
Save the file and restart Cursor
🌊 Windsurf
Open Windsurf Settings:
Cmd+,(macOS) orCtrl+,(Windows/Linux)Search for "MCP Servers"
Click "Edit in settings.json"
Add the following configuration:
Or if installed locally:
Save the file
Quit Windsurf completely (
Cmd+QorCtrl+Q)Reopen Windsurf and wait ~10 seconds for MCP to initialize
🤖 Claude Desktop
Locate your Claude Desktop config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Create or edit the config file:
Or if installed locally:
Save the file and restart Claude Desktop
🔮 Claude.ai (Web with MCP)
For Claude.ai web interface with MCP support:
Navigate to Claude.ai settings
Find the MCP configuration section
Add a new MCP server with:
Note: Claude.ai MCP support may require a Pro subscription and specific browser extensions.
Available Tools
Collection Management
Tool | Description |
| List all collections in Directus |
| Get schema for a specific collection |
| Get items from a collection with filtering |
| Create a new collection |
| Create a new item in a collection |
| Update an existing item |
| Delete items from a collection |
| Execute bulk create, update, delete |
Schema & Fields
Tool | Description |
| Create a new field in a collection |
| Update an existing field |
| Delete a field from a collection |
| Create relationships (O2O, O2M, M2O, M2M, M2A) |
| Analyze schema with relationship mapping |
| Validate schema and relationships |
| Analyze relationships across collections |
Flow Management
Tool | Description |
| Get all flows with optional filtering |
| Get a specific flow by ID |
| Create a new automation flow |
| Update an existing flow |
| Delete a flow |
| Manually trigger a flow |
| Get flow operations |
User Management
Tool | Description |
| Get all users with filtering |
| Get a specific user by ID |
File Management
Tool | Description |
| Get files with filtering and pagination |
Diagnostics
Tool | Description |
| Diagnose collection access issues |
| Refresh collection cache |
| Validate newly created collections |
Usage Examples
Once configured, you can interact with Directus through your AI assistant:
Troubleshooting
MCP Server Not Connecting
Verify Directus is running: Ensure your Directus instance is accessible at the configured URL
Check token permissions: The API token needs appropriate permissions for the operations you want to perform
Restart IDE: After changing MCP configuration, fully restart your IDE
Check logs: Look for MCP-related errors in your IDE's developer console
Permission Errors
Ensure your Directus token has the required permissions:
Admin token for full access
Or configure specific role permissions for collections you need to access
Connection Timeout
If using a remote Directus instance:
Verify the URL is correct and accessible
Check firewall/network settings
Ensure CORS is properly configured on Directus
Development
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add some amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
License
MIT © Jorge Domingues Nunes