home / mcp / directus mcp server

Directus MCP Server

Model Context Protocol server for Directus

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "rijkvanzanten-directus-mcp-server": {
      "command": "directus-mcp-server",
      "args": [],
      "env": {
        "DIRECTUS_URL": "<your Directus instance URL>",
        "DIRECTUS_TOKEN": "<your Directus user token>"
      }
    }
  }
}

This MCP server lets you expose your Directus API to AI tools by providing a dedicated MCP endpoint you can connect to. It enables read operations and user/context awareness for AI-driven workflows while keeping direct API access under your control.

How to use

You connect an MCP client to the server to enable AI tools to query Directus data and perform read actions. The server runs locally or remotely and accepts commands via standard I/O. You can configure the client with the exact MCP endpoint you start, then issue tool calls like reading items, reading the current user, or exploring available collections.

How to install

Prerequisites: you need Node.js version 22.12 or newer installed on your system.

Global installation (recommended)

npm install -g @rijk/directus-mcp-server

Configure your MCP client to use the global package as a remote server by specifying the server command and required environment values.

{
  "mcpServers": {
    "directus": {
      "command": "directus-mcp-server",
      "env": {
        "DIRECTUS_URL": "<your Directus instance URL>",
        "DIRECTUS_TOKEN": "<your Directus user token>"
      }
    }
  }
}

Local / Dev installation

Clone the project, install dependencies, and build the server.

# clone the repo
# (use your preferred path)
git clone <repo-url>
cd <repo-directory>

# install and build
pnpm install
pnpm build

Configure your MCP client to point to the built distribution, using the node runtime and the path to the built index.

{
  "mcpServers": {
    "directus": {
      "command": "node",
      "args": ["/path/to/directus-mcp-server/dist/index.js"]
    }
  }
}

Additional notes

The server provides a set of tools to read Directus data. It is designed to be used in conjunction with an MCP client to enable AI-driven data access while maintaining your Directus security and permissions.

Security and troubleshooting

• Keep your Directus API token secure. Do not expose it in client configurations that are publicly accessible.

• If the server cannot start, verify your Node.js version, the presence of the built dist/index.js, and that the configured Directus URL and token are valid.

Tools

The MCP server exposes a set of data access tools that you can call from your MCP client.

Available tools

read-items

Reads items from a Directus collection by providing the collection name and optional fields, sort order, and limit.

read-current-user

Retrieves information about the currently authenticated user.

read-collections

Returns the available collections and their fields to help you discover what you can query.