Directus Content MCP

MCPAI代理

提供方 directus · 包名 directus-template-cli

AI代理 stdio · 本地进程 Token 社区 / 第三方 Claude DesktopClaudeCursorCodex
查看接入方式

The Directus Content MCP Server is an interface for Directus users to interact with their data in LLMs.

一句话选型结论

按资料字段整理

Directus Content MCP 属于AI代理类 MCP 服务器,stdio · 本地进程,Token,可直接接入 Claude Desktop、Claude、Cursor 等,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类AI代理 传输方式stdio · 本地进程 鉴权Token 部署方式本地部署
GitHub 星标 未标注 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

AI代理
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

cms backend headless cms

支持客户端

适用场景

cmsbackendheadless cms

安装与配置

stdio · 本地进程 Token
客户端在本机拉起子进程,数据不出本机
npx directus-template-cli@latest init

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 node,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
给代理接外部能力

让代理在任务中途调用搜索、数据库等真实工具。

多步任务编排

把一串操作拆成步骤,由代理按顺序执行。

自动化重复流程

把固定流程交给代理跑,减少手工操作。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Claude、Cursor,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好Token对应的凭据,并按最小权限配置。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在AI代理场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Directus Content MCP当前 未标注 stdio · 本地进程 本地部署 有 未标注
Filesystem 560c4363 13 未标注 本地部署 无 2026-05-17
Server Everything (everything) 11 stdio · 本地进程 本地部署 有 2026-05-17
Time 7365cb6d 2 SSE · 服务端推送 远程部署 有 2026-05-18
Everything Claude Code 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Openmemory 557e1585 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

AI代理
字段来自项目仓库与公开索引,中文说明由本站标注
提供方directus上游标注的维护方 directus
分类AI代理本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式Token远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时directus-template-cli · node本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验未标注上游最后核验时间

详细介绍

11.8 KB
来自项目仓库与上游目录的原文,未做删改

Directus Content MCP Server

The Model Context Protocol (MCP) is a standard for helping AI tools and
LLMs talk to applications and services like Directus.

The Directus Content MCP Server is an interface for Directus users to interact with their data in LLMs. Some good use
cases are:

  • Content Editors: build custom pages, write blog posts, update content, organize assets and more inside your
    Directus project.
  • Data Analysts: query collections, generate reports, analyze trends, and extract insights from your Directus data
    using natural language.

It intentionally limits destructive actions that would result in really bad outcomes like data loss from deleting fields
or deleting collections.

We plan to provide more tools for developers who are working with local / development Directus projects in future
releases and potentially as a separate package to help further prevent data loss.

Installation

Prerequisites

  • An existing Directus project

If you don't have an existing Directus project, you can get started with a free trial on
Directus Cloud at https://directus.cloud/register

OR

You can spin up a sample Directus instance locally with the following terminal command.```
npx directus-template-cli@latest init


### Step 1. Get Directus Credentials

You can use email and password or generate a static token to connect the MCP to your Directus instance.

To get a static access token:

1. Login to your Directus instnace
2. Go to the User Directory and choose your own user profile
3. Scroll down to the Token field
4. Generate token and copy it
5. Save the user (do NOT forget to save because you’ll get an error that shows Invalid token!)

### Step 2. Configure the MCP in your AI Tool

#### Claude Desktop

1. Open Claude Desktop and navigate to Settings.

2. Under the Developer tab, click Edit Config to open the configuration file.

3. Add the following configuration:```json
   {
    "mcpServers": {
        "directus": {
            "command": "npx",
            "args": ["@directus/content-mcp@latest"],
            "env": {
                "DIRECTUS_URL": "https://your-directus-url.com",
                "DIRECTUS_TOKEN": "your-directus-token>"
            }
        }
    }
   }
   ```

   or if you're using email and password```json
   {
    "mcpServers": {
        "directus": {
            "command": "npx",
            "args": ["@directus/content-mcp@latest"],
            "env": {
                "DIRECTUS_URL": "https://your-directus-url.com",
                "DIRECTUS_USER_EMAIL": "john@example.com",
                "DIRECTUS_USER_PASSWORD": "your-password"
            }
        }
    }
   }
   ```
   Make sure you replace the placeholder values with your URL and credentials.

4. Save the configuration file and restart Claude desktop.

5. From the new chat screen, you should see an icon appear with the Directus MCP server.

#### Cursor

1. Open Cursor and create a .cursor directory in your project
   root if it doesn't exist.

2. Create a `.cursor/mcp.json` file if it doesn't exist and open it.

3. Add the following configuration:```json
   {
    "mcpServers": {
        "directus": {
            "command": "npx",
            "args": ["@directus/content-mcp@latest"],
            "env": {
                "DIRECTUS_URL": "https://your-directus-url.com",
                "DIRECTUS_TOKEN": "your-directus-token>"
            }
        }
    }
   }
   ```

   or if you're using email and password```json
   {
    "mcpServers": {
        "directus": {
            "command": "npx",
            "args": ["@directus/content-mcp@latest"],
            "env": {
                "DIRECTUS_URL": "https://your-directus-url.com",
                "DIRECTUS_USER_EMAIL": "john@example.com",
                "DIRECTUS_USER_PASSWORD": "your-password"
            }
        }
    }
   }
   ```

   Make sure you replace the placeholder values with your URL and credentials.

4. Save the configuration file.

5. Open Cursor and navigate to Settings/MCP. You should see a green active status after the server is successfully
   connected.

## Tools

The MCP Server provides the following tools to interact with your Directus instance:

| Tool                 | Description                                          | Use Cases                                                      |
| -------------------- | ---------------------------------------------------- | -------------------------------------------------------------- |
| **system-prompt**    | Provides context to the LLM assistant about its role | Start of a session to understand the system context            |
| **users-me**         | Get current user information                         | Understanding permissions, personalizing responses             |
| **read-collections** | Retrieve the schema of all collections               | Exploring database structure, understanding relationships      |
| **read-items**       | Fetch items from any collection                      | Retrieving content, searching for data, displaying information |
| **create-item**      | Create new items in collections                      | Adding new content, records, or entries                        |
| **update-item**      | Modify existing items                                | Editing content, updating statuses, correcting information     |
| **delete-item**      | Remove items from collections                        | Cleaning up outdated content                                   |
| **read-files**       | Access file metadata or raw content                  | Finding images, documents, or media assets                     |
| **import-file**      | Import files from URLs                               | Adding external media to your Directus instance                |
| **update-files**     | Update file metadata                                 | Organizing media, adding descriptions, tagging                 |
| **read-fields**      | Get field definitions for collections                | Understanding data structure, field types and validation       |
| **read-field**       | Get specific field information                       | Detailed field configuration                                   |
| **create-field**     | Add new fields to collections                        | Extending data models                                          |
| **update-field**     | Modify existing fields                               | Changing field configuration, interface options                |
| **read-flows**       | List available automation flows                      | Finding automation opportunities                               |
| **trigger-flow**     | Execute automation flows                             | Bulk operations, publishing, status changes                    |
| **read-comments**    | View comments on items                               | Retrieving feedback, viewing discussion threads                |
| **upsert-comment**   | Add or update comments                               | Providing feedback, documenting decisions                      |
| **markdown-tool**    | Convert between markdown and HTML                    | Content formatting for WYSIWYG fields                          |
| **get-prompts**      | List available prompts                               | Discovering pre-configured prompt templates                    |
| **get-prompt**       | Execute a stored prompt                              | Using prompt templates for consistent AI interactions          |

### System Prompt

The MCP server comes with a system prompt that helps encourage the right tool use and provides guiderails for the LLM.
You can overwrite the default system prompt in your env configuration by setting the `MCP_SYSTEM_PROMPT` variable.

You can also disable the system prompt entirely if desired.

Just set `MCP_SYSTEM_PROMPT_ENABLED` to `false`

### Prompt Configuration

The MCP server supports dynamic prompts stored in a Directus collection. Prompts are not widely supported across MCP
Clients, but Claude Desktop does have support for them.

You can configure the following:

- `DIRECTUS_PROMPTS_COLLECTION_ENABLED`: Set to "true" to enable prompt functionality
- `DIRECTUS_PROMPTS_COLLECTION`: The name of the collection containing prompts
- `DIRECTUS_PROMPTS_NAME_FIELD`: Field name for the prompt name (default: "name")
- `DIRECTUS_PROMPTS_DESCRIPTION_FIELD`: Field name for the prompt description (default: "description")
- `DIRECTUS_PROMPTS_SYSTEM_PROMPT_FIELD`: Field name for the system prompt text (default: "system_prompt")
- `DIRECTUS_PROMPTS_MESSAGES_FIELD`: Field name for the messages array (default: "messages")

### Mustache Templating

Both system prompts and message content support mustache templating using the `{{ variable_name }}` syntax:

1. Define variables in your prompts using double curly braces: `Hello, {{ name }}!`
2. When calling a prompt, provide values for the variables in the `arguments` parameter
3. The MCP server will automatically replace all variables with their provided values

## Local / Dev Installation

1. Clone the repo
2. `pnpm install && pnpm build` to build the server
3. Configure Claude Desktop or Cursor like above, but pointing it to the `dist` file instead:
4. Use `pnpm dev` to watch for changes and rebuild the server```json
{
    "mcpServers": {
        "directus": {
            "command": "node",
            "args": ["/path/to/directus-mcp-server/dist/index.js"]
        }
    }
}

Sample Claude Desktop Config for local dev with full settings```json
{
"mcpServers": {
"directus": {
"command": "node",
"args": [
"/path/to/directus-mcp-server/dist/index.js"
],
"env": {
"DIRECTUS_URL": "DIRECTUS_URL",
"DIRECTUS_TOKEN": "DIRECTUS_TOKEN",
"MCP_SYSTEM_PROMPT_ENABLED": "true",
"MCP_SYSTEM_PROMPT": "You're a content editor working at Directus.\nYou're a master at copywriting and creating messaging that resonates with technical audiences.\nYou'll be given details about a Directus instance and the schema within it. You'll be asked to update content and other helpful tasks. Rules \n - If you're updating HTML / WYSWIG fields inside the CMS - DO NOT ADD extra styling, classes, or markup outside the standard HTML elements. If you're not 95% sure what values should go into a certain field, stop and ask the user. Before deleting anything, confirm with the user and prompt them for an explicit DELETE confirmation via text.",
"DIRECTUS_PROMPTS_COLLECTION_ENABLED": "true",
"DIRECTUS_PROMPTS_COLLECTION": "ai_prompts"
}
}
}
}


### Example Configurations

#### Basic Configuration with Token```json
{
    "mcpServers": {
        "directus": {
            "command": "npx",
            "args": ["@directus/content-mcp@latest"],
            "env": {
                "DIRECTUS_URL": "https://your-directus-instance.com",
                "DIRECTUS_TOKEN": "your_directus_token"
            }
        }
    }
}

Configuration with Email/Password Authentication```json

{
"mcpServers": {
"directus": {
"command": "npx",
"args": ["@directus/content-mcp@latest"],
"env": {
"DIRECTUS_URL": "https://your-directus-instance.com",
"DIRECTUS_USER_EMAIL": "user@example.com",
"DIRECTUS_USER_PASSWORD": "your_password"
}
}
}
}


#### Advanced Configuration with Custom System Prompt and Tool Restrictions```json
{
    "mcpServers": {
        "directus": {
            "command": "npx",
            "args": ["@directus/content-mcp@latest"],
            "env": {
                "DIRECTUS_URL": "https://your-directus-instance.com",
                "DIRECTUS_TOKEN": "your_directus_token",
                "DISABLE_TOOLS": ["delete-item", "update-field"],
                "MCP_SYSTEM_PROMPT_ENABLED": "true",
                "MCP_SYSTEM_PROMPT": "You are an assistant specialized in managing content for our marketing website.",
                "DIRECTUS_PROMPTS_COLLECTION_ENABLED": "true",
                "DIRECTUS_PROMPTS_COLLECTION": "ai_prompts",
                "DIRECTUS_PROMPTS_NAME_FIELD": "name",
                "DIRECTUS_PROMPTS_DESCRIPTION_FIELD": "description",
                "DIRECTUS_PROMPTS_SYSTEM_PROMPT_FIELD": "system_prompt",
                "DIRECTUS_PROMPTS_MESSAGES_FIELD": "messages"
            }
        }
    }
}

❤️ Contributing

We love to see community contributions, but please open an issue first to discuss proposed changes before submitting any

🙏 Thanks To

This started as an experiment by the dude, the legend, the @rijkvanzanten 🙌

License

MIT

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
Directus Content MCP 怎么安装?

在客户端按下面的安装命令接入:npx directus-template-cli@latest init。对应的包名是 directus-template-cli。装完在客户端配置里引用同一个包或端点。

Directus Content MCP 怎么在 Claude Desktop、Claude、Cursor 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Directus Content MCP 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Directus Content MCP 需要 API Key 吗?

资料标注需要Token认证,使用前准备好对应凭据,并按最小权限配置。

Directus Content MCP 支持哪些客户端?

资料标注支持 Claude Desktop、Claude、Cursor、Codex、Zed;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Directus Content MCP 能提供哪些能力?

资料显示能力标签包括 cms、backend、headless cms。具体工具清单以官方文档为准。

Directus Content MCP 需要什么运行环境?

运行时为 node;属于本地进程,需要在本机装好运行环境。

Directus Content MCP 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 未标注。