Yuque MCP Plus MCP Server

Enhanced MCP server for Yuque knowledge base management and automation.

README.md

yuque-mcp-plus

语雀 MCP 服务。

它在现有 yuque-mcp-server 的基础上补了几类关键能力:

  • 默认知识库解析
  • 知识库 TOC/目录树查询
  • 支持 parentUuid 的文档创建
  • 文档与目录节点移动
  • 目录节点创建与删除
  • 官方命名兼容别名
  • 通用 OpenAPI 透传 yuque_request
  • 通用 multipart 上传透传 yuque_multipart_request

英文文档见 README.en.md

适用场景

适合这些语雀自动化需求:

  • 按目录结构维护知识库
  • 在指定目录下创建文档
  • 批量重组目录或文档位置
  • 通过 MCP 给 AI 助手提供稳定的语雀管理能力
  • 在官方工具未覆盖的接口上,通过通用请求继续扩展

当前状态

已经完成并验证:

  • yuque_get_default_repository
  • yuque_get_repository_toc_tree
  • yuque_create_doc + parentUuid
  • yuque_move_document
  • yuque_create_toc_node
  • yuque_delete_toc_node
  • 根节点自动删除
  • 官方兼容别名工具

真实联调已通过的能力:

  • 创建根目录节点
  • 在目录节点下创建文档
  • 移动目录节点
  • 删除目录节点
  • 删除测试文档

环境变量

必填:

  • YUQUE_TOKEN

可选:

  • YUQUE_API_BASE_URL
  • YUQUE_TIMEOUT_MS
  • YUQUE_RETRIES
  • YUQUE_DEFAULT_REPO_ID
  • YUQUE_DEFAULT_REPO_NAMESPACE

说明:

  • YUQUE_DEFAULT_REPO_ID 优先级高于 YUQUE_DEFAULT_REPO_NAMESPACE
  • 两者都不填时,会回退到当前账号可访问的第一个知识库

运行方式

通过 npm 直接运行:

npx yuque-mcp-plus

如果要带环境变量:

YUQUE_TOKEN="your-token" npx yuque-mcp-plus

直接启动:

node ./src/index.js

本地检查:

npm run check

本地测试:

npm test

版本变更记录:

发布步骤:

Codex MCP 配置示例

如果你想在本地源码和 npm 已发布包之间切换,可以直接替换 command + args

源码模式:

[mcp_servers.yuque]
command = "node"
args = [ "/Users/program/code/code_mcp/yuque-mcp-plus/src/index.js" ]

[mcp_servers.yuque.env]
YUQUE_TOKEN = "your-token"

npm 模式:

[mcp_servers.yuque]
command = "npx"
args = [ "-y", "yuque-mcp-plus" ]

[mcp_servers.yuque.env]
YUQUE_TOKEN = "your-token"

其他客户端接入

下面这些示例基于 2026-03-04 当天可查到的客户端文档整理。不同版本的 UI 或配置文件位置可能会变,但本地 stdio 启动方式基本一致。

Claude Code

官方文档当前推荐直接用命令注册本地 stdio MCP:

源码模式:

claude mcp add --transport stdio yuque -- node /Users/program/code/code_mcp/yuque-mcp-plus/src/index.js

npm 模式:

claude mcp add --transport stdio yuque -- npx -y yuque-mcp-plus

如果要带环境变量:

claude mcp add --transport stdio --env YUQUE_TOKEN=your-token yuque -- node /Users/program/code/code_mcp/yuque-mcp-plus/src/index.js
claude mcp add --transport stdio --env YUQUE_TOKEN=your-token yuque -- npx -y yuque-mcp-plus

常用管理命令:

claude mcp list
claude mcp get yuque

如果你使用项目共享配置,也可以把它写进项目根目录的 .mcp.json

源码模式:

{
  "mcpServers": {
    "yuque": {
      "command": "node",
      "args": [
        "/Users/program/code/code_mcp/yuque-mcp-plus/src/index.js"
      ],
      "env": {
        "YUQUE_TOKEN": "${YUQUE_TOKEN}"
      }
    }
  }
}

npm 模式:

{
  "mcpServers": {
    "yuque": {
      "command": "npx",
      "args": [
        "-y",
        "yuque-mcp-plus"
      ],
      "env": {
        "YUQUE_TOKEN": "${YUQUE_TOKEN}"
      }
    }
  }
}

Qoder

Qoder 当前支持在设置页里直接添加 MCP。

操作路径:

  • 打开 Qoder Settings
  • 进入 MCP
  • My Servers 里点击 + Add
  • 粘贴 JSON 配置并保存

本项目可直接使用:

源码模式:

{
  "mcpServers": {
    "yuque": {
      "command": "node",
      "args": [
        "/Users/program/code/code_mcp/yuque-mcp-plus/src/index.js"
      ],
      "env": {
        "YUQUE_TOKEN": "your-token"
      }
    }
  }
}

npm 模式:

{
  "mcpServers": {
    "yuque": {
      "command": "npx",
      "args": [
        "-y",
        "yuque-mcp-plus"
      ],
      "env": {
        "YUQUE_TOKEN": "your-token"
      }
    }
  }
}

保存后如果能看到连接图标,说明服务已成功连上。使用时要切到 Agent mode,这样 Qoder 才会调用 MCP 工具。

OpenCode

OpenCode 当前在 opencode.jsonc 里配置 MCP。本地 MCP 要放在 mcp 字段下,并声明为 type: "local"

示例:

源码模式:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "yuque": {
      "type": "local",
      "command": [
        "node",
        "/Users/program/code/code_mcp/yuque-mcp-plus/src/index.js"
      ],
      "enabled": true,
      "environment": {
        "YUQUE_TOKEN": "your-token"
      }
    }
  }
}

npm 模式:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "yuque": {
      "type": "local",
      "command": [
        "npx",
        "-y",
        "yuque-mcp-plus"
      ],
      "enabled": true,
      "environment": {
        "YUQUE_TOKEN": "your-token"
      }
    }
  }
}

使用时可以在提示词里直接点名,例如:

use the yuque tool to list my repositories

Trae

Trae 已经支持 MCP,但我当前没查到和 Qoder/OpenCode 一样完整公开的本地配置文件格式文档。所以这里按目前公开的接入方式写最稳的 UI 配置步骤。

常见操作路径:

  • 打开聊天框
  • 点击右上角齿轮
  • 进入 MCP
  • 添加一个本地 STDIO 服务

建议填写:

源码模式:

  • Name: yuque
  • Command: node
  • Args: /Users/program/code/code_mcp/yuque-mcp-plus/src/index.js
  • Env: YUQUE_TOKEN=your-token

npm 模式:

  • Name: yuque
  • Command: npx
  • Args: -y yuque-mcp-plus
  • Env: YUQUE_TOKEN=your-token

说明:

  • Trae 的具体入口位置和字段名可能会随版本变化
  • 如果你的版本支持 JSON 配置导入,可以直接复用 Qoder 的那份 mcpServers 配置
  • 如果是通过界面逐项填写,本项目本质上只需要 command + args + env

工具清单

核心工具

工具 用途 常用关键参数
yuque_hello 检查服务和 token 是否可用
`yuque_requ

Tools 7

yuque_get_default_repositoryRetrieves the default knowledge base information.
yuque_get_repository_toc_treeFetches the table of contents or directory tree of a repository.
yuque_create_docCreates a new document in the knowledge base, supporting parent directory assignment.
yuque_move_documentMoves a document or directory node to a new location.
yuque_create_toc_nodeCreates a new directory node in the table of contents.
yuque_delete_toc_nodeDeletes a directory node from the table of contents.
yuque_requestExecutes a general OpenAPI request to the Yuque platform.

Environment Variables

YUQUE_TOKENrequiredAuthentication token for Yuque API
YUQUE_API_BASE_URLCustom base URL for Yuque API
YUQUE_TIMEOUT_MSRequest timeout in milliseconds
YUQUE_RETRIESNumber of retry attempts for requests
YUQUE_DEFAULT_REPO_IDDefault repository ID to target
YUQUE_DEFAULT_REPO_NAMESPACEDefault repository namespace to target

Try it

List the directory structure of my default Yuque knowledge base.
Create a new document titled 'Project Roadmap' inside the 'Planning' folder.
Move the document with UUID '12345' into the 'Archive' directory.
Create a new directory node named 'Q3 Reports' in my repository.
Use the general request tool to fetch my user profile information from Yuque.

Frequently Asked Questions

What are the key features of Yuque MCP Plus?

Full directory tree navigation and TOC management. Support for creating documents with specific parent directory UUIDs. Capability to move documents and directory nodes within the hierarchy. General OpenAPI pass-through for extended platform functionality. Automatic fallback to the first accessible repository if no default is set.

What can I use Yuque MCP Plus for?

Maintaining knowledge base content structure via AI-driven automation. Batch reorganizing documents and folders within a repository. Programmatically creating documentation in specific project folders. Extending Yuque functionality beyond official tool limitations using custom API requests.

How do I install Yuque MCP Plus?

Install Yuque MCP Plus by running: npx yuque-mcp-plus

What MCP clients work with Yuque MCP Plus?

Yuque MCP Plus works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Yuque MCP Plus docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Open Conare