yuque-ai-mcp 2.7.4 → 2.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +183 -0
- package/README_CN.md +182 -0
- package/SKILL.md +180 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://cdn.nlark.com/yuque/0/2025/png/25689388/1749661212345-avatar/8a3b5c7d-1e2f-4a5b-9c7d-8e1f2a3b4c5d.png" width="120" alt="yuque-ai-mcp" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">yuque-ai-mcp</h1>
|
|
6
|
+
<p align="center">
|
|
7
|
+
<b>61 fine-grained MCP tools for the full Yuque OpenAPI</b>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<a href="https://github.com/yehuoshun/yuque-ai-mcp"><img src="https://img.shields.io/badge/version-2.7.4-blue" alt="version" /></a>
|
|
12
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="license" /></a>
|
|
13
|
+
<a href="https://github.com/yehuoshun/yuque-ai-skills"><img src="https://img.shields.io/badge/skills-61%20guides-orange" alt="skills" /></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="README_CN.md">中文文档</a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
A full-featured Yuque (语雀) MCP Server built on the [Model Context Protocol](https://modelcontextprotocol.io/). Provides 61 fine-grained tools across 15 domains — every Yuque OpenAPI endpoint as a dedicated tool.
|
|
23
|
+
|
|
24
|
+
## Why
|
|
25
|
+
|
|
26
|
+
- **19 → 61 tools** — 3x more coverage than the official [yuque-mcp-server](https://github.com/yuque/yuque-mcp-server)
|
|
27
|
+
- **Dual transport** — stdio + HTTP SSE, shared registry, zero downtime on reload
|
|
28
|
+
- **Modular architecture** — 15 domains, barrel exports, single source of truth registry
|
|
29
|
+
- **Full API coverage** — group, recycle, upload, statistics, versions, boards — all the missing pieces
|
|
30
|
+
- **[Skill layer](https://github.com/yehuoshun/yuque-ai-skills)** — 61 usage guides for AI agents
|
|
31
|
+
|
|
32
|
+
## Table of Contents
|
|
33
|
+
|
|
34
|
+
- [Quick Start](#quick-start)
|
|
35
|
+
- [Tool Overview](#tool-overview)
|
|
36
|
+
- [Architecture](#architecture)
|
|
37
|
+
- [Configuration](#configuration)
|
|
38
|
+
- [Error Handling](#error-handling)
|
|
39
|
+
- [Contributing](#contributing)
|
|
40
|
+
- [License](#license)
|
|
41
|
+
|
|
42
|
+
## Quick Start
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
cd server
|
|
46
|
+
npm install
|
|
47
|
+
npm run build
|
|
48
|
+
|
|
49
|
+
# Copy config template
|
|
50
|
+
cp config/config.example.json config/config.json
|
|
51
|
+
# Edit config.json with your Yuque API token
|
|
52
|
+
|
|
53
|
+
# Run
|
|
54
|
+
npm start # stdio mode
|
|
55
|
+
npm run dev:http # HTTP SSE mode (http://localhost:3099)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
> **Note**: `npm run dev:http` uses `tsx` for hot-reload during development.
|
|
59
|
+
|
|
60
|
+
## Tool Overview
|
|
61
|
+
|
|
62
|
+
| Domain | Tools | Highlights |
|
|
63
|
+
|--------|-------|------------|
|
|
64
|
+
| **doc** | 14 | CRUD, versions, diff, batch get, import URL/file, cross-book copy, export |
|
|
65
|
+
| **repo** | 8 | CRUD, batch get, cross-book copy, full export (TOC-structure + INDEX/GRAPH) |
|
|
66
|
+
| **toc** | 3 | Get, update, batch update (createTitle/appendNode/removeNode/moveNode) |
|
|
67
|
+
| **search** | 2 | General search + RAG-enhanced search |
|
|
68
|
+
| **user** | 3 | User info, heartbeat, group list |
|
|
69
|
+
| **group** | 3 | Member list, role change, delete member |
|
|
70
|
+
| **statistic** | 4 | Group/member/repo/doc statistics |
|
|
71
|
+
| **note** | 4 | CRUD + soft-delete/restore |
|
|
72
|
+
| **recycle** | 3 | List, restore, destroy (Cookie auth) |
|
|
73
|
+
| **upload** | 1 | File upload to Yuque CDN (Cookie auth) |
|
|
74
|
+
| **board** | 3 | Mindmap, flowchart, architecture diagram |
|
|
75
|
+
| **mine** | 2 | Book stacks, editor center (Cookie auth) |
|
|
76
|
+
| **rss** | 3 | Source list, fetch + dedup + save, schedule analysis |
|
|
77
|
+
| **crawler** | 4 | Fetch, CSS extract, dedup save, schedule analysis |
|
|
78
|
+
| **kv** | 4 | Get, set, delete, list — incremental sharding, 250KB/doc limit |
|
|
79
|
+
| **Total** | **61** | |
|
|
80
|
+
|
|
81
|
+
See [SKILL.md](SKILL.md) or [yuque-ai-skills](https://github.com/yehuoshun/yuque-ai-skills) for full tool documentation.
|
|
82
|
+
|
|
83
|
+
## vs Official
|
|
84
|
+
|
|
85
|
+
| Feature | Official yuque-mcp-server | yuque-ai-mcp |
|
|
86
|
+
|---------|--------------------------|--------------|
|
|
87
|
+
| Tools | 19 | **61** |
|
|
88
|
+
| Granularity | Coarse | **Fine-grained** (1 tool / endpoint) |
|
|
89
|
+
| Group, Recycle, Upload, Statistics | ❌ | ✅ |
|
|
90
|
+
| Versions, Diff, Cross-book Copy | ❌ | ✅ |
|
|
91
|
+
| Transport | stdio only | **stdio + HTTP SSE** |
|
|
92
|
+
| Config | Env var | **config.json** (token + cookie) |
|
|
93
|
+
| Skill Layer | ❌ | ✅ 61 guides |
|
|
94
|
+
|
|
95
|
+
## Architecture
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
server/src/
|
|
99
|
+
├── common/ # Shared: config, errors, types, format, validate,
|
|
100
|
+
│ # api-client, web-request, register-tools, copy/export/schedule common,
|
|
101
|
+
│ # repo-capacity (auto-expand), toc-cache (24h TTL), text-utils
|
|
102
|
+
├── user/ search/ group/ doc/ toc/ repo/ statistic/
|
|
103
|
+
├── note/ recycle/ upload/ board/ rss/ crawler/ mine/ kv/
|
|
104
|
+
├── index.ts # stdio entry
|
|
105
|
+
└── http.ts # HTTP SSE entry (port 3099)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Configuration
|
|
109
|
+
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"token": "Your Yuque API Token",
|
|
113
|
+
"api_base": "https://www.yuque.com/api/v2",
|
|
114
|
+
"cookie": "Optional, for recycle/upload features",
|
|
115
|
+
"ctoken": "Optional, extracted from Cookie",
|
|
116
|
+
"kv": { "enabled": true },
|
|
117
|
+
"rss": {
|
|
118
|
+
"enabled": true,
|
|
119
|
+
"namespaces": {
|
|
120
|
+
"cnblogs": {
|
|
121
|
+
"book_id": [80197497],
|
|
122
|
+
"kv_slugs": ["80197550/274164064"],
|
|
123
|
+
"schedule_slugs": []
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"crawler": {
|
|
128
|
+
"enabled": true,
|
|
129
|
+
"namespaces": {
|
|
130
|
+
"cnblogs": {
|
|
131
|
+
"book_id": [80197497],
|
|
132
|
+
"kv_slugs": ["80197550/274164064"],
|
|
133
|
+
"schedule_slugs": []
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
- `book_id`: Target repo ID array — last element is the active repo. Auto-expands when full (5000 docs).
|
|
141
|
+
- `kv_slugs`: KV dedup shard docs (`{book_id}/{doc_id}` format)
|
|
142
|
+
- `schedule_slugs`: Schedule config docs
|
|
143
|
+
|
|
144
|
+
## Error Handling
|
|
145
|
+
|
|
146
|
+
Unified error handling with structured responses (HTTP status + message + response summary). All tools share the same error pipeline.
|
|
147
|
+
|
|
148
|
+
Key errors:
|
|
149
|
+
- `book_full` — Auto-expands by creating a new repo and appending to the `book_id` array
|
|
150
|
+
- `401` / `403` — Token/permission issues
|
|
151
|
+
- `429` — Rate limit with automatic retry
|
|
152
|
+
|
|
153
|
+
See [references/api/errors.md](references/api/errors.md) for the full error code reference.
|
|
154
|
+
|
|
155
|
+
## Contributing
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
git clone https://github.com/yehuoshun/yuque-ai-mcp.git
|
|
159
|
+
cd yuque-ai-mcp/server
|
|
160
|
+
npm install
|
|
161
|
+
npm run build
|
|
162
|
+
|
|
163
|
+
# New tool checklist:
|
|
164
|
+
# 1. Create server/src/{domain}/{tool}.ts
|
|
165
|
+
# 2. Export in {domain}/index.ts + append to tools array
|
|
166
|
+
# 3. npx tsc
|
|
167
|
+
# 4. Restart HTTP server + curl health
|
|
168
|
+
# 5. Sync yuque-ai-skills
|
|
169
|
+
# 6. Update README
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Both [yuque-ai-mcp](https://github.com/yehuoshun/yuque-ai-mcp) and [yuque-ai-skills](https://github.com/yehuoshun/yuque-ai-skills) are kept in sync.
|
|
173
|
+
|
|
174
|
+
## Tech Stack
|
|
175
|
+
|
|
176
|
+
- TypeScript + Node.js
|
|
177
|
+
- @modelcontextprotocol/sdk v1.x
|
|
178
|
+
- Zod (validation)
|
|
179
|
+
- Yuque OpenAPI v2 / Web API
|
|
180
|
+
|
|
181
|
+
## License
|
|
182
|
+
|
|
183
|
+
MIT
|
package/README_CN.md
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<h1 align="center">yuque-ai-mcp</h1>
|
|
3
|
+
<p align="center">
|
|
4
|
+
<b>61 个细粒度 MCP 工具,覆盖语雀 OpenAPI 全部能力</b>
|
|
5
|
+
</p>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://github.com/yehuoshun/yuque-ai-mcp"><img src="https://img.shields.io/badge/版本-2.7.4-blue" alt="version" /></a>
|
|
10
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/许可-MIT-green" alt="license" /></a>
|
|
11
|
+
<a href="https://github.com/yehuoshun/yuque-ai-skills"><img src="https://img.shields.io/badge/skills-61%20指导-orange" alt="skills" /></a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
<a href="README.md">English</a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
基于 [Model Context Protocol](https://modelcontextprotocol.io/) 的语雀全功能 MCP Server。61 个工具,15 个域——每个语雀 OpenAPI 端点一个专用工具。
|
|
21
|
+
|
|
22
|
+
## 为什么选这个
|
|
23
|
+
|
|
24
|
+
- **19 → 61 工具** — 比官方 [yuque-mcp-server](https://github.com/yuque/yuque-mcp-server) 多 3 倍覆盖
|
|
25
|
+
- **双传输模式** — stdio + HTTP SSE,共享注册中心,修改无需重启
|
|
26
|
+
- **模块化架构** — 15 个域,barrel export,唯一注册中心
|
|
27
|
+
- **完整 API 覆盖** — 团队、回收站、上传、统计、版本、画板——补全官方缺失
|
|
28
|
+
- **[Skill 层](https://github.com/yehuoshun/yuque-ai-skills)** — 61 个 AI Agent 使用指导
|
|
29
|
+
|
|
30
|
+
## 目录
|
|
31
|
+
|
|
32
|
+
- [快速开始](#快速开始)
|
|
33
|
+
- [工具概览](#工具概览)
|
|
34
|
+
- [与官方对比](#与官方对比)
|
|
35
|
+
- [架构](#架构)
|
|
36
|
+
- [配置](#配置)
|
|
37
|
+
- [错误处理](#错误处理)
|
|
38
|
+
- [贡献](#贡献)
|
|
39
|
+
- [许可](#许可)
|
|
40
|
+
|
|
41
|
+
## 快速开始
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
cd server
|
|
45
|
+
npm install
|
|
46
|
+
npm run build
|
|
47
|
+
|
|
48
|
+
# 复制配置模板
|
|
49
|
+
cp config/config.example.json config/config.json
|
|
50
|
+
# 编辑 config.json 填入你的语雀 API Token
|
|
51
|
+
|
|
52
|
+
# 运行
|
|
53
|
+
npm start # stdio 模式
|
|
54
|
+
npm run dev:http # HTTP SSE 模式 (http://localhost:3099)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
> 开发时用 `npm run dev:http` 启动 `tsx` 热重载。
|
|
58
|
+
|
|
59
|
+
## 工具概览
|
|
60
|
+
|
|
61
|
+
| 域 | 工具数 | 亮点 |
|
|
62
|
+
|--------|-------|------------|
|
|
63
|
+
| **doc** | 14 | CRUD、版本管理、Diff、批量获取、URL/文件导入、跨库复制、导出 |
|
|
64
|
+
| **repo** | 8 | CRUD、批量获取、跨库复制、全量导出(TOC 结构 + INDEX/GRAPH) |
|
|
65
|
+
| **toc** | 3 | 获取、更新、批量更新(createTitle/appendNode/removeNode/moveNode) |
|
|
66
|
+
| **search** | 2 | 通用搜索 + RAG 增强搜索 |
|
|
67
|
+
| **user** | 3 | 用户信息、心跳、团队列表 |
|
|
68
|
+
| **group** | 3 | 成员列表、角色变更、删除成员 |
|
|
69
|
+
| **statistic** | 4 | 团队/成员/知识库/文档统计 |
|
|
70
|
+
| **note** | 4 | CRUD + 软删除/恢复 |
|
|
71
|
+
| **recycle** | 3 | 列表、恢复、彻底删除(Cookie 认证) |
|
|
72
|
+
| **upload** | 1 | 文件上传到语雀 CDN(Cookie 认证) |
|
|
73
|
+
| **board** | 3 | 思维导图、流程图、架构图 |
|
|
74
|
+
| **mine** | 2 | 书架列表、编辑中心(Cookie 认证) |
|
|
75
|
+
| **rss** | 3 | 数据源列表、抓取+去重+写入、定时策略分析 |
|
|
76
|
+
| **crawler** | 4 | 抓取、CSS 提取、去重写入、定时策略分析 |
|
|
77
|
+
| **kv** | 4 | 增删查列——增量分片,单文档 250KB 上限 |
|
|
78
|
+
| **合计** | **61** | |
|
|
79
|
+
|
|
80
|
+
完整工具文档见 [SKILL.md](SKILL.md) 或 [yuque-ai-skills](https://github.com/yehuoshun/yuque-ai-skills)。
|
|
81
|
+
|
|
82
|
+
## 与官方对比
|
|
83
|
+
|
|
84
|
+
| 功能 | 官方 yuque-mcp-server | yuque-ai-mcp |
|
|
85
|
+
|---------|--------------------------|--------------|
|
|
86
|
+
| 工具数 | 19 | **61** |
|
|
87
|
+
| 粒度 | 粗粒度 | **细粒度**(1 端点 = 1 工具) |
|
|
88
|
+
| 团队、回收站、上传、统计 | ❌ | ✅ |
|
|
89
|
+
| 版本、Diff、跨库复制 | ❌ | ✅ |
|
|
90
|
+
| 传输模式 | 仅 stdio | **stdio + HTTP SSE** |
|
|
91
|
+
| 配置 | 环境变量 | **config.json**(token + cookie) |
|
|
92
|
+
| Skill 层 | ❌ | ✅ 61 指导 |
|
|
93
|
+
|
|
94
|
+
## 架构
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
server/src/
|
|
98
|
+
├── common/ # 公共:config, errors, types, format, validate,
|
|
99
|
+
│ # api-client, web-request, register-tools, copy/export/schedule,
|
|
100
|
+
│ # repo-capacity(自动扩容), toc-cache(24h TTL), text-utils
|
|
101
|
+
├── user/ search/ group/ doc/ toc/ repo/ statistic/
|
|
102
|
+
├── note/ recycle/ upload/ board/ rss/ crawler/ mine/ kv/
|
|
103
|
+
├── index.ts # stdio 入口
|
|
104
|
+
└── http.ts # HTTP SSE 入口(端口 3099)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## 配置
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"token": "你的语雀 API Token",
|
|
112
|
+
"api_base": "https://www.yuque.com/api/v2",
|
|
113
|
+
"cookie": "可选,回收站/上传功能需要",
|
|
114
|
+
"ctoken": "可选,从 Cookie 中提取",
|
|
115
|
+
"kv": { "enabled": true },
|
|
116
|
+
"rss": {
|
|
117
|
+
"enabled": true,
|
|
118
|
+
"namespaces": {
|
|
119
|
+
"cnblogs": {
|
|
120
|
+
"book_id": [80197497],
|
|
121
|
+
"kv_slugs": ["80197550/274164064"],
|
|
122
|
+
"schedule_slugs": []
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"crawler": {
|
|
127
|
+
"enabled": true,
|
|
128
|
+
"namespaces": {
|
|
129
|
+
"cnblogs": {
|
|
130
|
+
"book_id": [80197497],
|
|
131
|
+
"kv_slugs": ["80197550/274164064"],
|
|
132
|
+
"schedule_slugs": []
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
- `book_id`:目标知识库 ID 数组,最后一个为当前活跃仓库。满 5000 篇自动扩容追加。
|
|
140
|
+
- `kv_slugs`:KV 去重分片文档(`{book_id}/{doc_id}` 格式)
|
|
141
|
+
- `schedule_slugs`:定时策略配置文档
|
|
142
|
+
|
|
143
|
+
## 错误处理
|
|
144
|
+
|
|
145
|
+
统一错误处理,返回结构化错误(HTTP 状态码 + 消息 + 响应摘要)。所有工具共用同一错误管道。
|
|
146
|
+
|
|
147
|
+
关键错误:
|
|
148
|
+
- `book_full` — 知识库超 5000 篇,自动创建新仓库并追加到 `book_id` 数组
|
|
149
|
+
- `401` / `403` — Token/权限问题
|
|
150
|
+
- `429` — 限流,自动重试
|
|
151
|
+
|
|
152
|
+
完整错误码见 [references/api/errors.md](references/api/errors.md)。
|
|
153
|
+
|
|
154
|
+
## 贡献
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
git clone https://github.com/yehuoshun/yuque-ai-mcp.git
|
|
158
|
+
cd yuque-ai-mcp/server
|
|
159
|
+
npm install
|
|
160
|
+
npm run build
|
|
161
|
+
|
|
162
|
+
# 新增工具清单:
|
|
163
|
+
# 1. 创建 server/src/{域}/{工具}.ts
|
|
164
|
+
# 2. 在 {域}/index.ts 中 export + 追加到工具数组
|
|
165
|
+
# 3. npx tsc
|
|
166
|
+
# 4. 重启 HTTP Server + curl health
|
|
167
|
+
# 5. 同步 yuque-ai-skills
|
|
168
|
+
# 6. 更新 README
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
[yuque-ai-mcp](https://github.com/yehuoshun/yuque-ai-mcp) 和 [yuque-ai-skills](https://github.com/yehuoshun/yuque-ai-skills) 保持同步更新。
|
|
172
|
+
|
|
173
|
+
## 技术栈
|
|
174
|
+
|
|
175
|
+
- TypeScript + Node.js
|
|
176
|
+
- @modelcontextprotocol/sdk v1.x
|
|
177
|
+
- Zod(参数校验)
|
|
178
|
+
- 语雀 OpenAPI v2 / Web API
|
|
179
|
+
|
|
180
|
+
## 许可
|
|
181
|
+
|
|
182
|
+
MIT
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# yuque-ai-mcp
|
|
2
|
+
|
|
3
|
+
语雀全功能 MCP Server,61 个工具 / 15 个域。当用户提到「语雀」「yuque」「知识库」「文档」「团队」等关键词时触发。
|
|
4
|
+
|
|
5
|
+
## 触发场景
|
|
6
|
+
|
|
7
|
+
- 语雀知识库管理(创建、删除、列表、复制、导出)
|
|
8
|
+
- 文档操作(读写、搜索、导入导出、版本对比)
|
|
9
|
+
- 用户/团队信息查询
|
|
10
|
+
- 回收站管理
|
|
11
|
+
- 目录 TOC 导航
|
|
12
|
+
- 画板(思维导图/流程图)
|
|
13
|
+
- 统计数据
|
|
14
|
+
- 小记
|
|
15
|
+
- RSS 抓取
|
|
16
|
+
- 网页爬虫
|
|
17
|
+
- KV 存储
|
|
18
|
+
|
|
19
|
+
## API 端点索引
|
|
20
|
+
|
|
21
|
+
### user(3 工具)
|
|
22
|
+
| 工具 | 说明 |
|
|
23
|
+
|------|------|
|
|
24
|
+
| `yuque_hello` | 心跳检测,验证 Token 有效性 |
|
|
25
|
+
| `yuque_get_user` | 获取当前 Token 的用户详情 |
|
|
26
|
+
| `yuque_get_user_groups` | 获取用户所属的团队列表 |
|
|
27
|
+
|
|
28
|
+
### search(2 工具)
|
|
29
|
+
| 工具 | 说明 |
|
|
30
|
+
|------|------|
|
|
31
|
+
| `yuque_search` | 通用搜索文档/知识库 |
|
|
32
|
+
| `yuque_rag_search` | RAG 检索增强搜索 + 自动获取文档内容 |
|
|
33
|
+
|
|
34
|
+
### group(3 工具)
|
|
35
|
+
| 工具 | 说明 |
|
|
36
|
+
|------|------|
|
|
37
|
+
| `yuque_get_group_users` | 获取团队成员列表 |
|
|
38
|
+
| `yuque_update_group_user` | 变更团队成员角色 |
|
|
39
|
+
| `yuque_delete_group_user` | 删除团队成员 |
|
|
40
|
+
|
|
41
|
+
### doc(14 工具)
|
|
42
|
+
| 工具 | 说明 |
|
|
43
|
+
|------|------|
|
|
44
|
+
| `yuque_list_docs` | 获取知识库文档列表 |
|
|
45
|
+
| `yuque_create_doc` | 创建文档 |
|
|
46
|
+
| `yuque_get_doc` | 获取文档详情(支持 ID 或 slug) |
|
|
47
|
+
| `yuque_update_doc` | 更新文档 |
|
|
48
|
+
| `yuque_delete_doc` | 删除文档 |
|
|
49
|
+
| `yuque_batch_get_docs` | 批量获取文档详情(max 20) |
|
|
50
|
+
| `yuque_get_doc_versions` | 获取文档历史版本列表 |
|
|
51
|
+
| `yuque_get_doc_version_detail` | 获取文档历史版本详情 |
|
|
52
|
+
| `yuque_diff_doc_versions` | 对比两个版本的行级差异 |
|
|
53
|
+
| `yuque_copy_doc` | 单文档跨库复制 |
|
|
54
|
+
| `yuque_export_doc` | 导出单篇文档为 Markdown(含图片下载) |
|
|
55
|
+
| `yuque_import_url` | 从网页 URL 导入文档 |
|
|
56
|
+
| `yuque_import_file` | 从本地文件导入文档(direct/upload_assets/embed_assets) |
|
|
57
|
+
| `yuque_embed_url` | 生成文档嵌入阅读器 URL |
|
|
58
|
+
|
|
59
|
+
### toc(3 工具)
|
|
60
|
+
| 工具 | 说明 |
|
|
61
|
+
|------|------|
|
|
62
|
+
| `yuque_get_toc` | 获取知识库目录 |
|
|
63
|
+
| `yuque_update_toc` | 更新知识库目录 |
|
|
64
|
+
| `yuque_batch_update_toc` | 批量更新目录(Agent 出计划,Tool 执行) |
|
|
65
|
+
|
|
66
|
+
### repo(8 工具)
|
|
67
|
+
| 工具 | 说明 |
|
|
68
|
+
|------|------|
|
|
69
|
+
| `yuque_list_repos` | 获取知识库列表(用户/团队) |
|
|
70
|
+
| `yuque_create_repo` | 创建知识库 |
|
|
71
|
+
| `yuque_get_repo` | 获取知识库详情 |
|
|
72
|
+
| `yuque_update_repo` | 更新知识库 |
|
|
73
|
+
| `yuque_delete_repo` | 删除知识库 |
|
|
74
|
+
| `yuque_batch_get_repos` | 批量获取知识库详情(max 20) |
|
|
75
|
+
| `yuque_copy_repo` | 批量跨库复制(LLM 分类 + 目录重建) |
|
|
76
|
+
| `yuque_export_repo` | 批量导出知识库为 Markdown(按 TOC 目录结构) |
|
|
77
|
+
|
|
78
|
+
### statistic(4 工具)
|
|
79
|
+
| 工具 | 说明 |
|
|
80
|
+
|------|------|
|
|
81
|
+
| `yuque_get_group_statistics` | 获取团队汇总统计数据 |
|
|
82
|
+
| `yuque_get_member_statistics` | 获取团队成员统计数据 |
|
|
83
|
+
| `yuque_get_book_statistics` | 获取团队知识库统计数据 |
|
|
84
|
+
| `yuque_get_doc_statistics` | 获取团队文档统计数据 |
|
|
85
|
+
|
|
86
|
+
### note(4 工具)
|
|
87
|
+
| 工具 | 说明 |
|
|
88
|
+
|------|------|
|
|
89
|
+
| `yuque_list_notes` | 获取小记列表 |
|
|
90
|
+
| `yuque_get_note` | 获取小记详情 |
|
|
91
|
+
| `yuque_create_note` | 创建小记 |
|
|
92
|
+
| `yuque_update_note` | 更新小记 |
|
|
93
|
+
|
|
94
|
+
### recycle(3 工具)
|
|
95
|
+
| 工具 | 说明 |
|
|
96
|
+
|------|------|
|
|
97
|
+
| `yuque_list_recycles` | 列出回收站项目 |
|
|
98
|
+
| `yuque_restore_recycle` | 恢复回收站项目 |
|
|
99
|
+
| `yuque_destroy_recycle` | 彻底删除回收站项目 |
|
|
100
|
+
|
|
101
|
+
### upload(1 工具)
|
|
102
|
+
| 工具 | 说明 |
|
|
103
|
+
|------|------|
|
|
104
|
+
| `yuque_upload_attachment` | 上传文件到语雀 CDN |
|
|
105
|
+
|
|
106
|
+
### board(3 工具)
|
|
107
|
+
| 工具 | 说明 |
|
|
108
|
+
|------|------|
|
|
109
|
+
| `yuque_get_board` | 获取文档中的画板资源 |
|
|
110
|
+
| `yuque_create_board` | 在文档中创建画板资源 |
|
|
111
|
+
| `yuque_update_board` | 更新文档中的画板资源 |
|
|
112
|
+
|
|
113
|
+
### rss(3 工具)
|
|
114
|
+
| 工具 | 说明 |
|
|
115
|
+
|------|------|
|
|
116
|
+
| `yuque_rss_list_sources` | 列出所有可用 RSS 数据源及 feed 类型 |
|
|
117
|
+
| `yuque_rss_fetch` | 抓取 RSS/Atom Feed,解析后去重写入语雀 |
|
|
118
|
+
| `yuque_rss_schedule` | 分析更新频率,生成推荐抓取时间并写入配置 |
|
|
119
|
+
|
|
120
|
+
### crawler(4 工具)
|
|
121
|
+
| 工具 | 说明 |
|
|
122
|
+
|------|------|
|
|
123
|
+
| `yuque_crawl_fetch` | 抓取网页原始 HTML |
|
|
124
|
+
| `yuque_crawl_extract` | CSS 选择器从 HTML 提取内容 |
|
|
125
|
+
| `yuque_crawl_save` | 去重 + 写入语雀(接收 Agent 清洗后的内容) |
|
|
126
|
+
| `yuque_crawl_schedule` | 分析爬虫抓取频率,生成推荐抓取时间 |
|
|
127
|
+
|
|
128
|
+
> **清洗规范**:Agent 负责 fetch → 提取正文 → HTML→Markdown → 传干净 body 给 `crawl_save`。详见 `references/api/crawler_api.md`。
|
|
129
|
+
|
|
130
|
+
### mine(2 工具)
|
|
131
|
+
| 工具 | 说明 |
|
|
132
|
+
|------|------|
|
|
133
|
+
| `yuque_get_book_stacks` | 获取知识库分组(书架)列表 |
|
|
134
|
+
| `yuque_get_editor_center` | 获取个人编辑中心全景数据 |
|
|
135
|
+
|
|
136
|
+
### kv(4 工具)
|
|
137
|
+
| 工具 | 说明 |
|
|
138
|
+
|------|------|
|
|
139
|
+
| `yuque_kv_get` | 读取 KV 命名空间的完整 JSON map(分片合并) |
|
|
140
|
+
| `yuque_kv_set` | 增量设置 key-value,超 250KB 自动分片 |
|
|
141
|
+
| `yuque_kv_delete` | 遍历分片查找并删除 key |
|
|
142
|
+
| `yuque_kv_list` | 列出已配置的 KV 命名空间 |
|
|
143
|
+
|
|
144
|
+
## 错误码
|
|
145
|
+
|
|
146
|
+
所有工具共用统一错误处理。API 失败时返回结构化错误信息(含状态码、中文描述、响应摘要)。
|
|
147
|
+
|
|
148
|
+
完整错误码及处理策略见 `references/api/errors.md`。
|
|
149
|
+
|
|
150
|
+
## 配置
|
|
151
|
+
|
|
152
|
+
```json
|
|
153
|
+
{
|
|
154
|
+
"token": "语雀 API Token",
|
|
155
|
+
"api_base": "https://www.yuque.com/api/v2",
|
|
156
|
+
"cookie": "可选,回收站/上传/mine 功能需要",
|
|
157
|
+
"ctoken": "可选,从 Cookie 中提取",
|
|
158
|
+
"kv": { "enabled": true },
|
|
159
|
+
"rss": {
|
|
160
|
+
"enabled": true,
|
|
161
|
+
"namespaces": {
|
|
162
|
+
"cnblogs": {
|
|
163
|
+
"book_id": 80197497,
|
|
164
|
+
"kv_slugs": ["80197550/274164064"],
|
|
165
|
+
"schedule_slugs": ["80278170/274357940"]
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"crawler": {
|
|
170
|
+
"enabled": true,
|
|
171
|
+
"namespaces": {
|
|
172
|
+
"cnblogs": {
|
|
173
|
+
"book_id": 80197497,
|
|
174
|
+
"kv_slugs": ["80197550/274164064"],
|
|
175
|
+
"schedule_slugs": ["80278170/274358465"]
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yuque-ai-mcp",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.5",
|
|
4
4
|
"description": "Full-featured Yuque MCP Server — 61 fine-grained tools covering the entire Yuque OpenAPI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dev:http": "tsx watch src/http.ts",
|
|
32
32
|
"start": "node dist/index.js",
|
|
33
33
|
"start:http": "node dist/http.js",
|
|
34
|
-
"prepublishOnly": "npm run build"
|
|
34
|
+
"prepublishOnly": "npm run build && cp ../README.md ../README_CN.md ../SKILL.md . 2>/dev/null; true"
|
|
35
35
|
},
|
|
36
36
|
"repository": {
|
|
37
37
|
"type": "git",
|