Directus MCP Server

by pixelsock

Not rated
GitHub

About

An MCP server for Directus CMS, enabling AI clients to interact with the Directus API.

Details

Author
pixelsock
Categories
Database, Other, API

Setup

Install Directus MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/pixelsock/directus-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

A Node.js server implementing Model Context Protocol (MCP) for Directus CMS. Enable AI Clients to interact with theDirectus APIthrough the Model Context Protocol (MCP).

- Go to your Directus instance
- Create a static access token or get your email and password
- Keep these credentials secure

{ "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" } } } }

- Go to Settings → Cursor Settings → MCP
- Click+ Add New Global MCP Server
- Paste configuration
- Replace placeholder values with your Directus credentials
- Save andrestartCursor
- Open Settings → Developer
- ClickEdit Config
- Openclaude_desktop_config.jsonin a code editor and paste configuration
- Replace placeholder values with your Directus credentials
- Save andrestartClaude

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 andrestartyour MCP client

Run the following commands to confirm you have Node and NPM installed:

Sometimes clearing yourNPM cachecan resolve issues withnpx.

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
getFiles // Get files from Directus uploadFile // Upload a file to Directus
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
getSystemInfo // Get system information from Directus getActivity // Get activity logs from Directus getConfig // Get current configuration information

If you want to run the server in development mode:

git clone https://github.com/pixelsock/directus-mcp.git cd directus-mcp npm install
# .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-password

🌐 HTTP transport (multi-user / remote deployments)

By default the server uses thestdiotransport, which is ideal for single-user local AI editors (Cursor, Claude Desktop, etc.).

Formulti-userorremoteenvironments you can switch to theStreamable HTTP transportby setting theMCP_TRANSPORTenvironment variable.

You can also pass--transport=httpas a CLI argument instead of setting the environment variable.

# 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 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:

For example with a client that supports the Streamable HTTP transport:

{ "mcpServers": { "directus": { "url": "http://localhost:3000/mcp" } } }

- Directus API Documentation
-
Directus API Endpoints
-
Directus JavaScript SDK

This server enables AI assistants and other MCP clients to interact with Directus instances programmatically.

An MCP server for the Frappe Framework, enabling AI assistants to interact with Frappe's REST API for document management and schema operations.

Read and write access to your Baserow tables.

Interact with AWS Amplify Gen2 data models using natural language and Cognito authentication.

Access live U.S. congressional data from the Congress.gov API.

A read-only MCP server for querying live data from various APIs using the CData JDBC Driver for API Driver.

Query and manage data through CData Connect Cloud, providing a unified interface to various data sources.

A read-only MCP server for querying live eBay data. Requires a separately licensed CData JDBC Driver for eBay.

Connect to SAP Netweaver Gateway data using CData's MCP Server. Requires a separately licensed CData JDBC Driver.

A read-only MCP server for querying live data from Square using the CData JDBC Driver.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.