home / mcp / directus mcp server
Provides an MCP endpoint to interact with Directus API for items, files, users, and system data.
Configuration
View docs{
"mcpServers": {
"pixelsock-directus-mcp": {
"command": "npx",
"args": [
"-y",
"@pixelsock/directus-mcp@latest"
],
"env": {
"DIRECTUS_URL": "https://your-directus-instance.com",
"DIRECTUS_EMAIL": "[email protected]",
"DIRECTUS_PASSWORD": "your-password",
"DIRECTUS_ACCESS_TOKEN": "YOUR_ACCESS_TOKEN"
}
}
}
}You can connect your AI editor to Directus through an MCP server that exposes Directus actions as MCP endpoints. This bridge lets you read and manipulate Directus collections, files, users, and system information from your AI workflows with standardized MCP requests.
Use the MCP server to interact with your Directus instance from your AI editor or assistant. You will configure a local or remote MCP client to run the Directus MCP server, passing either an access token or email/password for authentication. Once configured, you can perform typical Directus operations such as fetching collections and items, uploading files, managing users and roles, and querying system information, all through your MCP-enabled editor.
Prerequisites you need before installation are Node.js, NPM, and a Directus instance.
Step-by-step commands to prepare and run the Directus MCP server in an MCP client configuration are shown below. Use the inline commands exactly as written.
Install or run the MCP server from your editor configuration by using a standard npx-based flow. The following example configures the MCP server with Directus credentials and points to your Directus instance:
{
"mcpServers": {
"directus": {
"command": "npx",
"args": ["-y", "@pixelsock/directus-mcp@latest"],
"env": {
"DIRECTUS_URL": "https://your-directus-instance.com",
"DIRECTUS_ACCESS_TOKEN": "YOUR_ACCESS_TOKEN"
}
}
}
}Alternative credentials using email and password can also be used. Configure your MCP client with the email and password credentials instead of the access token.
{
"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"
}
}
}
}If you are using Cursor or Claude Desktop as your editor, follow these steps to add and reuse the configuration.
For Cursor, go to Settings → Cursor Settings → MCP, add a new global MCP server, paste the configuration, replace placeholders with your Directus credentials, then save and restart Cursor.
For Claude Desktop, open Settings → Developer, click Edit Config, edit claude_desktop_config.json with your credentials, then save and restart Claude.
If you encounter issues starting the MCP server in your editor, verify that your Directus URL is reachable and that your credentials are valid. Then re-save the configuration and restart the MCP client.
Ensure Node.js and NPM are installed on your system. Verify the versions with these commands:
node -v
npm -vIf you run into caching or dependency problems, try clearing the NPM cache and retrying the MCP server start.
Keep your Directus credentials secure. Do not commit tokens or passwords in configuration files that are publicly accessible. Prefer using environment variables or secret management where possible.
This MCP server exposes a range of Directus operations such as getting collections and items, creating and updating items, uploading files, managing users and roles, and fetching system information. Use these capabilities through your MCP client to build AI-assisted workflows with Directus data.
Fetch items from a Directus collection using MCP actions.
Fetch a single item by ID from a Directus collection.
Create a new item in a Directus collection.
Update an existing item in a Directus collection.
Delete an item from a Directus collection.
Retrieve all collection schemas from Directus.
Fetch field definitions for a Directus collection.
Retrieve relationship mappings for a Directus collection.
List files stored in Directus.
Upload a new file to Directus.
Obtain an access token by logging in to Directus.
Retrieve user accounts from Directus.
Fetch information about the currently authenticated user.
List roles defined in Directus for access control.
Fetch permissions configured in Directus.
Get system information from the Directus instance.
Retrieve activity logs from Directus.
Obtain current Directus configuration information.