Yuque MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Yuque MCP Server
English | 简体中文
为 语雀(Yuque) 提供的模型上下文协议(MCP)服务器 - 让 Claude 等 AI 助手能够通过标准化工具管理你的语雀知识库。
功能特性
文档管理
✅ 创建、读取、更新和删除文档
✅ 支持多种格式(Markdown、HTML、Lake)
✅ 分页列出文档
✅ 一步创建文档并添加到目录 (
create_document_with_toc)
知识库管理
✅ 一次调用获取所有知识库 (
get_my_repositories)✅ 查看知识库及完整目录结构 (
get_repository_overview)✅ 创建新知识库
目录管理
✅ 知识库概览中包含层级目录视图
✅ 在目录中添加/移动/删除文档
✅ 使用文件夹组织内容
搜索与发现
✅ 一次调用搜索并读取文档 (
search_and_read)✅ 获取当前用户信息
Related MCP server: Engineering Standards MCP Server
安装
前置要求
Python 3.10 或更高版本
语雀账号及 API Token
快速开始
克隆仓库
git clone https://github.com/EnglandLobster/yuque-mcp.git cd yuque-mcp安装依赖
pip install -e .或使用 uv:
uv venv uv pip install -e .配置 API Token
cp .env.example .env从这里获取你的 API Token:https://www.yuque.com/settings/tokens
编辑
.env文件:YUQUE_API_TOKEN=你的token YUQUE_BASE_URL=https://www.yuque.com
使用方法
与 Claude Code CLI 集成
添加到 ~/.claude.json 或项目级别的 .mcp.json:
{
"mcpServers": {
"yuque": {
"type": "stdio",
"command": "/path/to/yuque-mcp/.venv/bin/python",
"args": ["-m", "yuque_mcp.server"],
"env": {
"YUQUE_API_TOKEN": "你的token"
}
}
}
}或通过 CLI 添加:
claude mcp add --scope user --transport stdio \
--env YUQUE_API_TOKEN=你的token \
yuque -- python -m yuque_mcp.server与 Claude Desktop 集成
添加到 Claude Desktop 配置文件:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"yuque": {
"command": "python",
"args": ["-m", "yuque_mcp.server"],
"env": {
"YUQUE_API_TOKEN": "你的token"
}
}
}
}独立运行
# 使用安装的脚本
yuque-mcp
# 或直接运行
python -m yuque_mcp.server可用工具(11 个工具)
文档操作(5 个工具)
工具 | 描述 |
| 一步创建文档并添加到目录(推荐) |
| 获取文档内容和元数据 |
| 更新文档标题、内容或设置 |
| 删除文档 |
| 分页列出所有文档 |
知识库操作(3 个工具)
工具 | 描述 |
| 一次获取当前用户信息和所有知识库 |
| 一次获取知识库详情和目录结构 |
| 创建新知识库 |
目录管理(1 个工具)
工具 | 描述 |
| 添加、移动或删除目录项 |
搜索与用户(2 个工具)
工具 | 描述 |
| 一次搜索并读取第一个结果 |
| 获取认证用户信息 |
常见工作流
创建文档(推荐方式)
使用 create_document_with_toc 一步完成创建:
create_document_with_toc(
repo_id="123",
title="快速开始",
body="# 欢迎\n\n你的内容...",
parent_uuid="folder-uuid" # 可选,省略则添加到根目录
)创建文档(两步方式)
如果需要更多控制:
创建文档:
create_document(repo_id="123", title="我的文档", body="# 内容")添加到目录:
update_toc(repo_id="123", action="appendNode", action_mode="child", doc_ids="456", node_type="DOC")
浏览知识库结构
get_toc(repo_id="123")返回带有文件夹(📁)和文档(📄)的层级结构。
配置
环境变量
变量 | 必需 | 默认值 | 描述 |
| 是 | - | 你的语雀 API Token |
| 否 |
| 语雀 API 基础 URL |
可见性级别
值 | 含义 |
| 私密(默认) |
| 公开 |
| 内部可见(仅组织成员) |
内容格式
格式 | 描述 |
| 标准 Markdown(默认) |
| HTML 格式 |
| 语雀原生富文本格式 |
错误处理
服务器提供双语错误消息(中文 + 英文):
状态码 | 消息 |
400 | 请求参数非法 (Invalid request parameters) |
401 | Token/Scope 未通过鉴权 (Authentication failed) |
403 | 无操作权限 (Permission denied) |
404 | 实体未找到 (Entity not found) |
422 | 请求参数校验失败 (Validation failed) |
429 | 访问频率超限 (Rate limit exceeded) |
500 | 内部错误 (Internal server error) |
开发
设置开发环境
# 克隆并安装开发依赖
git clone https://github.com/EnglandLobster/yuque-mcp.git
cd yuque-mcp
pip install -e ".[dev]"运行测试
pytest
pytest --cov=yuque_mcp # 带覆盖率报告代码质量检查
ruff check . # 代码检查
ruff format . # 代码格式化
mypy src/yuque_mcp # 类型检查项目结构
yuque-mcp/
├── src/yuque_mcp/
│ ├── __init__.py # 包导出
│ ├── server.py # FastMCP 服务器(11 个工具)
│ ├── client.py # 异步语雀 API 客户端
│ └── models.py # Pydantic 模型和枚举
├── tests/
│ ├── __init__.py
│ ├── conftest.py # Pytest 固件
│ └── test_client.py # 客户端测试
├── .env.example
├── .github/
│ └── workflows/
│ └── ci.yml # GitHub Actions CI
├── pyproject.toml
├── LICENSE
├── CLAUDE.md # AI 助手使用说明
└── README.md贡献
欢迎贡献!请遵循以下步骤:
Fork 本仓库
创建特性分支 (
git checkout -b feature/amazing-feature)进行修改
运行测试 (
pytest)运行代码检查 (
ruff check . && ruff format .)提交更改 (
git commit -m 'Add amazing feature')推送到分支 (
git push origin feature/amazing-feature)开启 Pull Request
API 参考
FastMCP 文档:https://gofastmcp.com
许可证
本项目采用 MIT 许可证 - 详见 LICENSE 文件。
致谢
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Shared business knowledge, tools and skills for AI agents, with citations and approval controls.
Governed, auditable knowledge your team curates for its AI assistants, self-hostable
Read, edit and improve shared documents and knowledge with people and agents.
Versioned documentation registry and semantic search for AI tools and coding assistants.
Related MCP Servers
- AlicenseBqualityDmaintenanceAllows AI models to interact with SourceSync.ai's knowledge management platform to organize, ingest, retrieve, and search content in knowledge bases.253MIT
- AlicenseNot gradedqualityDmaintenanceProvides AI assistants with structured access to an organization's engineering standards, practices, and processes through searchable knowledge base with CRUD operations and multi-dimensional organization.1MIT
- AlicenseNot gradedqualityDmaintenanceProvides AI assistants with unified access to organizational knowledge across Guru, Notion, and local docs, enabling intelligent document creation, retrieval, and management.23 npmMIT
- FlicenseNot gradedqualityAmaintenanceEnables AI assistants to discover and invoke tools for saving and retrieving code snippets, generating style guides and wiki documentation, and orchestrating multi-agent documentation workflows with semantic search.-