Skip to main content
Glama

Directus MCP Server

by pixelsock

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

ℹ 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

Install Server
A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

A Node.js server that enables AI Clients to interact with the Directus CMS API through the Model Context Protocol, allowing for management of collections, items, files, users, and system information.

  1. ℹ Prerequisites
    1. ▶️ Quick start
      1. ❓ Troubleshooting
        1. Ensure you have valid Directus credentials
        2. Ensure you have Node and NPM installed
        3. Clear your NPM cache
      2. 🛠️ Available tools
        1. Collections and Items
        2. Files
        3. Users and Permissions
        4. System
      3. 🚧 Development mode
        1. 📄 Directus Developer resources

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            A comprehensive Model Context Protocol server that provides advanced Node.js development tooling for automating project creation, component generation, package management, and documentation with AI-powered assistance.
            Last updated -
            7
            4
            JavaScript
            MIT License
          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol server that enables AI models to interact with both MySQL and MongoDB databases through a standardized interface, supporting comprehensive database operations including queries, schema management, and CRUD operations.
            Last updated -
            14
            6
            JavaScript
            MIT License
          • -
            security
            F
            license
            -
            quality
            A comprehensive Model Context Protocol server implementation that enables AI assistants to interact with file systems, databases, GitHub repositories, web resources, and system tools while maintaining security and control.
            Last updated -
            3
            1
            TypeScript
          • -
            security
            F
            license
            -
            quality
            A Model Context Protocol server that extends AI capabilities by providing file system access and management functionalities to Claude or other AI assistants.
            Last updated -
            339
            6
            TypeScript
            • Apple

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/pixelsock/directus-mcp'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server