The Directus MCP Server enables AI clients to interact with a Directus CMS through the Model Context Protocol (MCP), allowing for content management and administrative tasks.
Collections and Items: Retrieve, create, update, or delete items and collections; get schemas, fields, and relations
Files: Upload and retrieve files from Directus
Users and Permissions: Manage users, roles, and permissions; login to obtain access tokens; get current user information
System: Access health information, activity logs, and configuration details
Enables interaction with Directus CMS API, providing tools for managing collections and items, handling files, user authentication, permissions management, and accessing system information through the Directus platform.
Directus MCP Server
A Node.js server implementing Model Context Protocol (MCP) for Directus CMS. Enable AI Clients to interact with the Directus API through the Model Context Protocol (MCP).
ℹ Prerequisites
Related MCP server: MCP-MongoDB-MySQL-Server
▶️ Quick start
Get your Directus API credentials
Go to your Directus instance
Create a static access token or get your email and password
Keep these credentials secure
Add to your AI editor
{ "mcpServers": { "directus": { "command": "npx", "args": ["-y", "@pixelsock/directus-mcp@latest"], "env": { "DIRECTUS_URL": "https://your-directus-instance.com", "DIRECTUS_ACCESS_TOKEN": "YOUR_ACCESS_TOKEN" } } } }Alternatively, you can use email/password authentication:
{ "mcpServers": { "directus": { "command": "npx", "args": ["-y", "@pixelsock/directus-mcp@latest"], "env": { "DIRECTUS_URL": "https://your-directus-instance.com", "DIRECTUS_EMAIL": "your-email@example.com", "DIRECTUS_PASSWORD": "your-password" } } } }For Cursor:
Go to Settings → Cursor Settings → MCP
Click
+ Add New Global MCP ServerPaste configuration
Replace placeholder values with your Directus credentials
Save and restart Cursor
For Claude Desktop:
Open Settings → Developer
Click
Edit ConfigOpen
claude_desktop_config.jsonin a code editor and paste configurationReplace placeholder values with your Directus credentials
Save and restart Claude
❓ Troubleshooting
If you are having issues starting the server in your MCP client e.g. Cursor or Claude Desktop, please try the following.
Ensure you have valid Directus credentials
Verify that your Directus URL is correct and accessible
Check that your access token or email/password credentials are valid
Replace the credentials in your MCP client configuration
Save and restart your MCP client
Ensure you have Node and NPM installed
Run the following commands to confirm you have Node and NPM installed:
Clear your NPM cache
Sometimes clearing your NPM cache can resolve issues with npx.
🛠️ Available tools
Collections and Items
Files
Users and Permissions
System
🚧 Development mode
If you want to run the server in development mode:
Clone and install:
git clone https://github.com/pixelsock/directus-mcp.git cd directus-mcp npm installAdd your credentials to
.env:# .env DIRECTUS_URL=https://your-directus-instance.com DIRECTUS_ACCESS_TOKEN=your_token_here # Or use email/password DIRECTUS_EMAIL=your-email@example.com DIRECTUS_PASSWORD=your-passwordStart development server:
npm run dev