Directus MCP Server
An MCP server for Directus CMS, enabling AI clients to interact with the Directus API.
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
▶️ 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": "[email protected]", "DIRECTUS_PASSWORD": "your-password" } } } }For Cursor:
- Go to Settings → Cursor Settings → MCP
- Click
+ Add New Global MCP Server - Paste configuration
- Replace placeholder values with your Directus credentials
- Save and restart Cursor
For Claude Desktop:
- Open Settings → Developer
- Click
Edit Config - Open
claude_desktop_config.jsonin a code editor and paste configuration - Replace 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 -v
Clear 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 collection
Files
getFiles // Get files from Directus
uploadFile // Upload a file to Directus
Users 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 Directus
System
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 install -
Add your credentials to
.env:# .env DIRECTUS_URL=https://your-directus-instance.com DIRECTUS_ACCESS_TOKEN=your_token_here # Or use email/password [email protected] DIRECTUS_PASSWORD=your-password -
Start 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 |
|---|---|---|
MCP_TRANSPORT | stdio | Transport mode: stdio or http / streamable-http |
MCP_PORT | 3000 | TCP port the HTTP server listens on |
MCP_HOST | 127.0.0.1 | Host/interface to bind. Use 0.0.0.0 to bind all interfaces |
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=http
Docker 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-mcp
Connecting an MCP client to the HTTP server
Once the server is running, configure your MCP client to connect to:
http://<host>:<port>/mcp
For example with a client that supports the Streamable HTTP transport:
{
"mcpServers": {
"directus": {
"url": "http://localhost:3000/mcp"
}
}
}
📄 Directus Developer resources
İlgili Sunucular
FDA Data MCP
FDA-only compliance data MCP (recalls, warning letters, inspections, 483s, approvals, CFR parts).
MCP Database Server
Connects to and interacts with various database systems like SQLite, PostgreSQL, SQL Server, and MongoDB.
Seq MCP Server
Search and stream events from a Seq server.
Kintone Lite
A lightweight server to connect AI assistants with Kintone applications and data.
CockroachDB
A server for direct interaction with CockroachDB databases.
MCP for Neo4j
Connects to Neo4j graph databases with ability to use GDS functions ( when available), a read only mode , and set the sample size for schema detection
CData SAP Hybris C4C
A read-only MCP server for querying live SAP Hybris C4C data, powered by the CData JDBC Driver.
SQL Server
Enables AI assistants to access and query SQL Server databases.
MCP Data Pipeline Connector
Universal data connector for CSV, Postgres, and REST APIs via DuckDB
Qdrant
Implement semantic memory layer on top of the Qdrant vector search engine