yuque-ai-mcp 2.9.0 → 2.10.0

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 CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  <h1 align="center">yuque-ai-mcp</h1>
6
6
  <p align="center">
7
- <b>67 fine-grained MCP tools for the full Yuque OpenAPI</b>
7
+ <b>68 fine-grained MCP tools for the full Yuque OpenAPI</b>
8
8
  </p>
9
9
 
10
10
  <p align="center">
@@ -19,11 +19,11 @@
19
19
 
20
20
  ---
21
21
 
22
- A full-featured Yuque (语雀) MCP Server built on the [Model Context Protocol](https://modelcontextprotocol.io/). Provides 67 fine-grained tools across 16 domains — every Yuque OpenAPI endpoint as a dedicated tool.
22
+ A full-featured Yuque (语雀) MCP Server built on the [Model Context Protocol](https://modelcontextprotocol.io/). Provides 68 fine-grained tools across 16 domains — every Yuque OpenAPI endpoint as a dedicated tool.
23
23
 
24
24
  ## Why
25
25
 
26
- - **19 → 67 tools** — 3x more coverage than the official [yuque-mcp-server](https://github.com/yuque/yuque-mcp-server)
26
+ - **19 → 68 tools** — 3x more coverage than the official [yuque-mcp-server](https://github.com/yuque/yuque-mcp-server)
27
27
  - **Dual transport** — stdio + HTTP SSE, shared registry, zero downtime on reload
28
28
  - **Modular architecture** — 15 domains, barrel exports, single source of truth registry
29
29
  - **Full API coverage** — group, recycle, upload, statistics, versions, boards — all the missing pieces
@@ -76,9 +76,9 @@ npm run dev:http # HTTP SSE mode (http://localhost:3099)
76
76
  | **rss** | 3 | Source list, fetch + dedup + save, schedule analysis |
77
77
  | **crawler** | 4 | Fetch, CSS extract, dedup save, schedule analysis |
78
78
  | **kv** | 4 | Get, set, delete, list — incremental sharding, 250KB/doc limit |
79
- | **Total** | **67** | |
79
+ | **Total** | **68** | |
80
80
 
81
- ### All 67 Tools
81
+ ### All 68 Tools
82
82
 
83
83
  | Tool | Domain | Description |
84
84
  |------|--------|-------------|
@@ -88,6 +88,7 @@ npm run dev:http # HTTP SSE mode (http://localhost:3099)
88
88
  | `yuque_search` | search | 通用搜索文档/知识库 |
89
89
  | `yuque_rag_search` | search | RAG 检索增强搜索 + 自动获取文档内容 |
90
90
  | `yuque_web_search` | search | Cookie 态 Web 搜索,返回完整文档对象 + 精确总数 + 高亮摘要 |
91
+ | `yuque_web_delete_doc` | doc | Cookie 态删除文档(v2 被限流时的备用通道,移入回收站) |
91
92
  | `yuque_get_group_users` | group | 获取团队成员列表 |
92
93
  | `yuque_update_group_user` | group | 变更团队成员角色 |
93
94
  | `yuque_delete_group_user` | group | 删除团队成员 |
@@ -152,7 +153,7 @@ See [SKILL.md](SKILL.md) or [yuque-ai-skills](https://github.com/yehuoshun/yuque
152
153
 
153
154
  | Feature | Official yuque-mcp-server | yuque-ai-mcp |
154
155
  |---------|--------------------------|--------------|
155
- | Tools | 19 | **67** |
156
+ | Tools | 19 | **68** |
156
157
  | Granularity | Coarse | **Fine-grained** (1 tool / endpoint) |
157
158
  | Group, Recycle, Upload, Statistics | ❌ | ✅ |
158
159
  | Versions, Diff, Cross-book Copy | ❌ | ✅ |
package/SKILL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # yuque-ai-mcp
2
2
 
3
- 语雀全功能 MCP Server,67 个工具 / 16 个域。当用户提到「语雀」「yuque」「知识库」「文档」「团队」等关键词时触发。
3
+ 语雀全功能 MCP Server,68 个工具 / 16 个域。当用户提到「语雀」「yuque」「知识库」「文档」「团队」等关键词时触发。
4
4
 
5
5
  ## 触发场景
6
6
 
@@ -135,13 +135,14 @@
135
135
  | `yuque_get_book_stacks` | 获取知识库分组(书架)列表 |
136
136
  | `yuque_get_editor_center` | 获取个人编辑中心全景数据 |
137
137
 
138
- ### web_doc(4 工具,Cookie 态)
138
+ ### web_doc(5 工具,Cookie 态)
139
139
  | 工具 | 说明 |
140
140
  |------|------|
141
141
  | `yuque_web_get_doc` | Cookie 态读文档正文(含 body/content),不受会员过期限流 |
142
142
  | `yuque_web_list_docs` | Cookie 态列文档列表,更丰富的字段 |
143
143
  | `yuque_web_list_repos` | Cookie 态列知识库列表,含权限信息 |
144
144
  | `yuque_web_get_toc` | Cookie 态获取知识库目录 TOC |
145
+ | `yuque_web_delete_doc` | Cookie 态删除文档(移入回收站,v2 被限流时的备用通道) |
145
146
 
146
147
  ### kv(4 工具)
147
148
  | 工具 | 说明 |
@@ -0,0 +1,14 @@
1
+ /**
2
+ * web-doc/delete-doc — Cookie 态删除文档
3
+ *
4
+ * 端点:DELETE /api/docs/{id}?book_id={book_id}(Web API,Cookie 认证)
5
+ * 职责:删除指定文档(移入回收站),v2 删除被限流时作为替代通道
6
+ *
7
+ * 相比 v2 delete_doc 的优势:
8
+ * - 不走 Token,不受会员过期限流(429)
9
+ * - 与 web get/list 同一认证体系,v2 挂掉时仍可删
10
+ *
11
+ * ⚠️ 删除不可逆(移入回收站,可恢复)。
12
+ */
13
+ import type { McpTool } from "../common/types.js";
14
+ export declare const webDocDelete: McpTool;
@@ -0,0 +1,79 @@
1
+ /**
2
+ * web-doc/delete-doc — Cookie 态删除文档
3
+ *
4
+ * 端点:DELETE /api/docs/{id}?book_id={book_id}(Web API,Cookie 认证)
5
+ * 职责:删除指定文档(移入回收站),v2 删除被限流时作为替代通道
6
+ *
7
+ * 相比 v2 delete_doc 的优势:
8
+ * - 不走 Token,不受会员过期限流(429)
9
+ * - 与 web get/list 同一认证体系,v2 挂掉时仍可删
10
+ *
11
+ * ⚠️ 删除不可逆(移入回收站,可恢复)。
12
+ */
13
+ import { isErrorResult } from "../common/api-client.js";
14
+ import { webRequest } from "../common/web-request.js";
15
+ import { check, requiredString, optionalBoolean } from "../common/validate.js";
16
+ import { confirmationParam, checkConfirmation } from "../common/errors.js";
17
+ const DOC_REFERER = "https://www.yuque.com/";
18
+ export const webDocDelete = {
19
+ name: "yuque_web_delete_doc",
20
+ description: "Cookie-based: Delete a document (moves to recycle bin). " +
21
+ "DELETE /api/docs/{id}?book_id={book_id}. " +
22
+ "No membership required, alternative to v2 delete_doc when Token is rate-limited/expired. " +
23
+ "⚠️ Requires confirm='DELETE'. " +
24
+ "详见 references/api/doc_api.md",
25
+ inputSchema: {
26
+ type: "object",
27
+ properties: {
28
+ id: { type: "string", description: "Document ID (numeric, required)" },
29
+ book_id: { type: "string", description: "Repository ID (numeric, required)" },
30
+ confirm: confirmationParam.confirm,
31
+ raw: { type: "boolean", description: "Return raw full JSON (default false, returns trimmed fields)" },
32
+ },
33
+ required: ["id", "book_id", "confirm"],
34
+ },
35
+ async handler(args) {
36
+ // @validate
37
+ const __v = check(requiredString(args?.id, "id"), requiredString(args?.book_id, "book_id"), optionalBoolean(args?.raw, "raw"));
38
+ if (__v)
39
+ return __v;
40
+ const confirmed = checkConfirmation(args);
41
+ if (confirmed)
42
+ return confirmed;
43
+ const id = Number(args?.id);
44
+ const bookId = Number(args?.book_id);
45
+ if (!id || !bookId) {
46
+ return {
47
+ content: [{ type: "text", text: JSON.stringify({ error: "id 和 book_id 必须为有效数字 / id and book_id must be valid numbers" }, null, 2) }],
48
+ isError: true,
49
+ };
50
+ }
51
+ const raw = args?.raw;
52
+ const url = `https://www.yuque.com/api/docs/${id}?book_id=${bookId}`;
53
+ const result = await webRequest(url, { method: "DELETE", referer: DOC_REFERER });
54
+ if (isErrorResult(result))
55
+ return result;
56
+ const data = result?.data;
57
+ if (!data) {
58
+ return {
59
+ content: [{ type: "text", text: JSON.stringify({ error: "NO_DATA" }, null, 2) }],
60
+ isError: true,
61
+ };
62
+ }
63
+ if (raw) {
64
+ return {
65
+ content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
66
+ };
67
+ }
68
+ return {
69
+ content: [{ type: "text", text: JSON.stringify({
70
+ id: data.id,
71
+ title: data.title,
72
+ slug: data.slug,
73
+ deleted: true,
74
+ note: "移入回收站,可通过 yuque_list_recycles 查看 / yuque_restore_recycle 恢复",
75
+ }, null, 2) }],
76
+ };
77
+ },
78
+ };
79
+ //# sourceMappingURL=delete-doc.js.map
@@ -0,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I,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aAC1E,CAAC;QACJ,CAAC;QAED,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACtD,EAAE,EAAE,IAAI,CAAC,EAAE;wBACX,KAAK,EAAE,IAAI,CAAC,KAAK;wBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;wBACf,OAAO,EAAE,IAAI;wBACb,IAAI,EAAE,6DAA6D;qBACpE,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SACf,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -2,5 +2,6 @@ export { webDocGet } from "./get-doc.js";
2
2
  export { webDocList } from "./list-docs.js";
3
3
  export { webRepoList } from "./list-repos.js";
4
4
  export { webTocGet } from "./get-toc.js";
5
+ export { webDocDelete } from "./delete-doc.js";
5
6
  import type { McpTool } from "../common/types.js";
6
7
  export declare const webDocTools: McpTool[];
@@ -2,9 +2,11 @@ export { webDocGet } from "./get-doc.js";
2
2
  export { webDocList } from "./list-docs.js";
3
3
  export { webRepoList } from "./list-repos.js";
4
4
  export { webTocGet } from "./get-toc.js";
5
+ export { webDocDelete } from "./delete-doc.js";
5
6
  import { webDocGet } from "./get-doc.js";
6
7
  import { webDocList } from "./list-docs.js";
7
8
  import { webRepoList } from "./list-repos.js";
8
9
  import { webTocGet } from "./get-toc.js";
9
- export const webDocTools = [webDocGet, webDocList, webRepoList, webTocGet];
10
+ import { webDocDelete } from "./delete-doc.js";
11
+ export const webDocTools = [webDocGet, webDocList, webRepoList, webTocGet, webDocDelete];
10
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/web-doc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,CAAC,MAAM,WAAW,GAAc,CAAC,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/web-doc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,CAAC,MAAM,WAAW,GAAc,CAAC,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yuque-ai-mcp",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "description": "Full-featured Yuque MCP Server — 62 fine-grained tools covering the entire Yuque OpenAPI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",