Cover image
Try Now
2025-04-14

用于Directus API集成的MCP服务器

3 years

Works with Finder

4

Github Watches

2

Github Forks

4

Github Stars

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

相关推荐

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • rulego
  • ⛓️Rulego是一种轻巧,高性能,嵌入式,下一代组件编排规则引擎框架。

  • Byaidu
  • PDF科学纸翻译带有保留格式的pdf -基于ai完整保留排版的pdf文档全文双语翻译

  • lasso-security
  • 基于插件的网关,可协调其他MCP,并允许开发人员在IT企业级代理上构建。

  • hkr04
  • 轻巧的C ++ MCP(模型上下文协议)SDK

  • RockChinQ
  • 😎简单易用、🧩丰富生态 -大模型原生即时通信机器人平台| 适配QQ / 微信(企业微信、个人微信) /飞书 /钉钉 / discord / telegram / slack等平台| 支持chatgpt,deepseek,dify,claude,基于LLM的即时消息机器人平台,支持Discord,Telegram,微信,Lark,Dingtalk,QQ,Slack

  • sigoden
  • 使用普通的bash/javascript/python函数轻松创建LLM工具和代理。

  • evilsocket
  • 简单的代理开发套件。

    Reviews

    2.8 (9)
    Avatar
    user_uiKRsCvJ
    2025-04-23

    As a dedicated user of directus-mcp by pixelsock, I am thoroughly impressed with its seamless functionality and user-friendly interface. This application has significantly streamlined my project management process. Highly recommend it for anyone looking to enhance their productivity!

    Avatar
    user_DujE58zf
    2025-04-23

    Directus-MCP by Pixelsock is an exceptional tool for managing content. It offers an intuitive interface and seamless integration, enhancing productivity significantly. The customizable features cater to various needs, making it suitable for different projects. Highly recommended for those seeking a reliable and efficient content management solution.

    Avatar
    user_7XpkkJ9e
    2025-04-23

    I've been using directus-mcp for a while now, and it is absolutely fantastic! Created by the talented pixelsock, this application offers seamless content management with a user-friendly interface. The robust features and reliable performance have significantly improved my workflow. If you're looking for an efficient solution to manage your projects, directus-mcp is definitely worth checking out.

    Avatar
    user_6lTPFpcN
    2025-04-23

    As a dedicated user of directus-mcp, I can confidently say that this product by pixelsock is exceptional. The interface is intuitive and user-friendly, making data management a breeze. It seamlessly integrates with various applications, enhancing productivity and efficiency. Whether you're a developer or a business professional, directus-mcp offers robust features and an excellent user experience. Highly recommended for anyone looking to streamline their project workflows.

    Avatar
    user_Olt877JB
    2025-04-23

    I have been using directus-mcp by pixelsock and it's been a game-changer for managing our projects. The intuitive design and user-friendly interface make it easy to navigate and track project progress. It's a solid tool for teams looking to streamline their operations and improve workflow efficiency. Highly recommend checking it out!

    Avatar
    user_VMK5ibqg
    2025-04-23

    As a dedicated user of directus-mcp, I can confidently say that this tool, developed by pixelsock, is a game-changer. It offers a seamless and user-friendly experience for managing content. The clean interface and powerful features make it an essential tool for any project. Highly recommended!

    Avatar
    user_3Ik7kpDF
    2025-04-23

    As a dedicated user of directus-mcp by pixelsock, I am thoroughly impressed with its capabilities. It's an exceptional tool for managing content, offering a seamless experience with a user-friendly interface. The integration and functionality provided are top-notch, making it a must-have for any content management system. Highly recommend!

    Avatar
    user_mYneqTWZ
    2025-04-23

    Directus-mcp by pixelsock is a fantastic tool for managing your content with ease. Its seamless integration and user-friendly interface make content management a breeze. Highly recommended for teams looking for an efficient and reliable solution!

    Avatar
    user_ZaXs3UOZ
    2025-04-23

    I have been using directus-mcp by pixelsock for some time now and it has significantly streamlined my workflow. The intuitive interface combined with its powerful features makes managing content a breeze. Highly recommended for anyone looking for a reliable content management solution!