directus
Model Context Protocol server for Directus
claude mcp add --transport stdio rijkvanzanten-directus-mcp-server directus-mcp-server \ --env DIRECTUS_URL="<your Directus instance URL>" \ --env DIRECTUS_TOKEN="<your Directus user token>"
How to use
This Directus MCP server lets your AI tools connect to a Directus API and perform read operations against Directus collections. Once configured, you can use the available tools to read items from collections, inspect the current user, and discover which collections and fields exist in your Directus instance. The server exposes a simple tool interface that Claude AI (or other MCP clients) can call by providing structured JSON payloads that specify the operation and its parameters. Use the provided environment variables to point the server at your Directus instance and authenticate requests with a token.
Two of the primary tools are: read-items and read-collections. read-items lets you fetch items from a specified Directus collection and supports optional fields filtering, sorting, and limiting. read-collections returns the list of available collections and their fields, which is helpful for discovering what data you can query before using read-items. There is also a convenience tool to read the current user, mirroring the /users/me Directus endpoint, which can be useful for context-aware AI actions. Configure Claude AI to target the deployed MCP server, then issue JSON payloads through the tools to perform read operations against your Directus data.
How to install
Prerequisites:
- Node.js v22.12 or newer (for directus-mcp-server if using the Node-based setup)
- npm (or pnpm) for installation
Global installation (recommended):
- Install the MCP server globally npm install -g @rijk/directus-mcp-server
- Configure Claude AI (or your MCP client) to point to the server using the example config: { "mcpServers": { "directus": { "command": "directus-mcp-server", "env": { "DIRECTUS_URL": "<your Directus instance URL>", "DIRECTUS_TOKEN": "<your Directus user token>" } } } }
- Run the MCP client configuration and start sending tool requests to the server.
Local / Development installation:
- Clone the repository
- Install dependencies and build (as applicable): pnpm install && pnpm build
- Run the server in Node (pointing to the built dist/index.js): { "mcpServers": { "directus": { "command": "node", "args": ["/path/to/directus-mcp-server/dist/index.js"] } } }
- Ensure the same environment variables are set for DIRECTUS_URL and DIRECTUS_TOKEN when running locally.
Additional notes
Tips and considerations:
- Ensure your Directus API token has permissions to read the collections you intend to query.
- The Read Items tool supports optional fields, sort, and limit to tailor responses to your needs. Use the fields array to fetch only required fields to optimize payload size.
- The Read Collections tool is useful upfront to map available collections and fields before performing read-items calls.
- If you encounter connection issues, verify the DIRECTUS_URL is reachable from the environment running the MCP server and that the token is valid.
- For production deployments, consider restricting token scopes and rotating credentials regularly.
Related MCP Servers
iterm
A Model Context Protocol server that executes commands in the current iTerm session - useful for REPL and CLI assistance
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
editor
MCP Server for Phaser Editor
DoorDash
MCP server from JordanDalton/DoorDash-MCP-Server
mcp
MCP сервер для автоматического создания и развертывания приложений в Timeweb Cloud