Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

directus-mcp

MCP.Pizza Chef: pixelsock

Directus MCP is a Node.js server implementing the Model Context Protocol to integrate AI clients with the Directus CMS API. It allows real-time, structured access to Directus content and data management features, enabling AI models to query, update, and interact with Directus instances securely and efficiently. This server facilitates seamless AI-driven workflows within Directus environments, supporting token-based authentication and easy setup for developers.

Use This MCP server To

Query Directus CMS data via AI models Update Directus content through natural language commands Integrate AI workflows with Directus API Automate content management in Directus Enable AI-driven data retrieval from Directus Securely authenticate AI clients with Directus tokens Facilitate real-time AI interactions with Directus data Build AI copilots for Directus content editing

README

smithery badge

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).

Directus Server MCP server

ℹ Prerequisites

▶️ Quick start

  1. 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
  2. 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": "your-email@example.com",
            "DIRECTUS_PASSWORD": "your-password"
          }
        }
      }
    }

    For Cursor:

    1. Go to Settings → Cursor Settings → MCP
    2. Click + Add New Global MCP Server
    3. Paste configuration
    4. Replace placeholder values with your Directus credentials
    5. Save and restart Cursor

    For Claude Desktop:

    1. Open Settings → Developer
    2. Click Edit Config
    3. Open claude_desktop_config.json in a code editor and paste configuration
    4. Replace placeholder values with your Directus credentials
    5. 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

  1. Verify that your Directus URL is correct and accessible
  2. Check that your access token or email/password credentials are valid
  3. Replace the credentials in your MCP client configuration
  4. 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:

  1. Clone and install:

    git clone https://github.com/pixelsock/directus-mcp.git
    cd directus-mcp
    npm install
  2. Add your credentials to .env:

    # .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
  3. Start development server:

    npm run dev

📄 Directus Developer resources

directus-mcp FAQ

How do I authenticate the Directus MCP server with my Directus instance?
You can authenticate using a static access token or your Directus email and password credentials to enable secure API access.
What prerequisites are needed to run the Directus MCP server?
You need Node.js, NPM, and access to a Directus instance to set up and run the server.
Can the Directus MCP server handle real-time data updates?
Yes, it supports real-time interactions allowing AI clients to query and update Directus data dynamically.
Is the Directus MCP server compatible with multiple AI model providers?
Yes, it is provider-agnostic and works with models like OpenAI, Anthropic Claude, and Google Gemini.
How do I start using the Directus MCP server quickly?
Obtain your Directus API credentials, install dependencies with NPM, and configure the server to connect to your Directus instance.
Does the Directus MCP server support secure token-based authentication?
Yes, it supports static access tokens for secure and scoped API access.
Can I extend the Directus MCP server for custom Directus API endpoints?
Yes, since it is built on Node.js, you can customize and extend it to support additional Directus API features.