Directus MCP Server
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.
Click on "Deploy 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 Server show me the 5 most recent blog posts"
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.
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: Directus MCP 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:
node -v
npm -vClear your NPM cache
Sometimes clearing your NPM cache can resolve issues with npx.
npm cache clean --force🛠️ Available tools
Collections and Items
getItems // Get items from a collection
getItem // Get a single item from a collection by ID
createItem // Create a new item in a collection
updateItem // Update an existing item in a collection
deleteItem // Delete an item from a collection
getCollections // Get all collection schemas
getFields // Get fields for a collection
getRelations // Get relations for a collectionFiles
getFiles // Get files from Directus
uploadFile // Upload a file to DirectusUsers and Permissions
login // Login to Directus and get an access token
getUsers // Get users from Directus
getCurrentUser // Get the current user info
getRoles // Get roles from Directus
getPermissions // Get permissions from DirectusSystem
getSystemInfo // Get system information from Directus
getActivity // Get activity logs from Directus
getConfig // Get current configuration information🚧 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
🌐 HTTP transport (multi-user / remote deployments)
By default the server uses the stdio transport, which is ideal for single-user local AI editors (Cursor, Claude Desktop, etc.).
For multi-user or remote environments you can switch to the Streamable HTTP transport by setting the MCP_TRANSPORT environment variable.
Configuration
Environment variable | Default | Description |
|
| Transport mode: |
|
| TCP port the HTTP server listens on |
|
| Host/interface to bind. Use |
You can also pass --transport=http as a CLI argument instead of setting the environment variable.
Running the HTTP server
# Via environment variable
MCP_TRANSPORT=http MCP_PORT=3000 MCP_HOST=0.0.0.0 node dist/index.js
# Via CLI argument
node dist/index.js --transport=httpDocker example
docker run -p 3000:3000 \
-e DIRECTUS_URL=https://your-directus-instance.com \
-e DIRECTUS_ACCESS_TOKEN=your_token_here \
-e MCP_TRANSPORT=http \
-e MCP_HOST=0.0.0.0 \
ghcr.io/pixelsock/directus-mcpConnecting an MCP client to the HTTP server
Once the server is running, configure your MCP client to connect to:
http://<host>:<port>/mcpFor example with a client that supports the Streamable HTTP transport:
{
"mcpServers": {
"directus": {
"url": "http://localhost:3000/mcp"
}
}
}📄 Directus Developer resources
Available Tools
18 toolscreateItemC
Create a new item in a collection
Inputs: collection (required), data (required), token, url.
deleteItemC
Delete an item from a collection
Inputs: collection (required), id (required), token, url.
getActivityC
Get activity logs from Directus
Inputs: query, token, url.
getCollectionsC
Get all collection schemas from Directus
Inputs: token, url.
getConfigB
Get current configuration information (without secrets)
Inputs: no named parameters.
getCurrentUserC
Get the current user info
Inputs: token, url.
getFieldsC
Get fields for a collection
Inputs: collection (required), token, url.
getFilesC
Get files from Directus
Inputs: query, token, url.
getItemC
Get a single item from a collection by ID
Inputs: collection (required), id (required), query, token, +1 more.
getItemsC
Get items from a collection in Directus
Inputs: collection (required), query, token, url.
getPermissionsC
Get permissions from Directus
Inputs: query, token, url.
getRelationsC
Get relations for a collection
Inputs: collection, token, url.
getRolesC
Get roles from Directus
Inputs: query, token, url.
getSystemInfoC
Get system information from Directus
Inputs: endpoint (required), token, url.
getUsersC
Get users from Directus
Inputs: query, token, url.
loginC
Login to Directus and get an access token
Inputs: email, password, url.
updateItemC
Update an existing item in a collection
Inputs: collection (required), data (required), id (required), token, +1 more.
uploadFileC
Upload a file to Directus
Inputs: fileName (required), fileData, fileUrl, mimeType, +4 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Every tool has a clearly distinct purpose targeting specific resources and actions in the Directus ecosystem. There is no overlap between tools like getItem (single item retrieval), getItems (multiple items), and getCollections (schema information), making misselection unlikely.
All tools follow a consistent verb_noun naming pattern (e.g., createItem, getItem, updateItem, deleteItem). The pattern is maintained across all 18 tools with no deviations in style or convention.
With 18 tools, the count is slightly high but reasonable for a comprehensive CMS/backend server like Directus. It covers core operations without being overwhelming, though it borders on the upper limit of ideal scope.
The tool set provides complete CRUD coverage for items (create, get, update, delete), along with essential administrative functions (users, roles, permissions, files, activity, config). No obvious gaps exist for the Directus domain, enabling full agent workflows.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
A Model Context Protocol server for Wix AI tools
Related MCP Servers
- AlicenseAqualityBmaintenanceA Model Context Protocol server that enables AI assistants to interact with Strapi CMS instances through a standardized interface, supporting content types and REST API operations.575MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that allows AI tools to connect to and interact with your Directus API, enabling automated access to collections, items, and user data.27MIT
- AlicenseNot gradedqualityDmaintenanceAn extension that implements the Model Context Protocol for Directus, enabling AI tools and LLMs to interact with Directus content through natural language for content editing, data analysis, and asset management.8 npm8MIT
- AlicenseAqualityDmaintenanceThe official Model Context Protocol server for Skema CMS, enabling AI clients to interact with and manage CMS data. It provides tools for reading, creating, updating, and searching collections and items through natural language.1112 npmMIT