# yehuoshun/yuque-ai-mcp [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/yehuoshun/yuque-ai-mcp  
**GitHub Stars:** 10  
**Views:** 6  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/yehuoshun-yuque-ai-mcp

## Description
Full-featured Yuque (语雀) MCP server with 62 fine-grained tools across 13 domains — documents, knowledge bases, TOC, search, statistics, notes, recycle bin, upload, boards, book stacks, web API, user and group management. Dual stdio + HTTP transport.

## Tools
Capabilities this server exposes over MCP:

- **yuque_get_user** — Get current user profile (id,login,name,avatar_url,books_count,description,created_at). GET /user. 详见 references/api/user_api.md
- **yuque_hello** — Health check — verify Yuque API token validity. GET /hello. 详见 references/api/user_api.md
- **yuque_get_user_groups** — List groups the user belongs to. GET /users/:id/groups. 详见 references/api/user_api.md
- **yuque_search** — General search across Yuque docs and repos. GET /search?q=:q&type=:type. 详见 references/api/search_api.md
- **yuque_rag_search** — RAG-enhanced search: accepts LLM-generated keywords, runs concurrent multi-path searches, deduplicates by doc_id, fetches top-N full doc content. 详见 references/api/search_api.md
- **yuque_web_search** — Cookie-based web search across Yuque docs/books/users. Returns full document objects (_record) without needing a second get_doc call. Supports scope filtering (repo/group), type filtering (content/book/user), pagination, AND advanced search syntax: "phrase", in:title, NOT/AND/OR, updated:>YYYY-MM-DD, url:scope, is:related/public. Requires cookie+ctoken in config. GET /api/zsearch?q=:q&type=:type&scope=:scope&p=:p. ⚠️ Cookie-based API — QPS unknown, avoid concurrent calls. 详见 references/api/search_api.md
- **yuque_get_group_users** — List group members (page size 100). Supports role filter (0=admin,1=member,2=readonly). GET /groups/:login/users. 详见 references/api/group_api.md
- **yuque_update_group_user** — Change a group member role (0=admin,1=member,2=readonly). PUT /groups/:login/users/:id. 详见 references/api/group_api.md
- **yuque_delete_group_user** — Remove a member from a group. ⚠️ Requires confirm='DELETE'. DELETE /groups/:login/users/:id. 详见 references/api/group_api.md
- **yuque_list_docs** — List documents in a repo, sorted by updated_at desc. limit ≤ 100. Supports deleted (recycle view) and changed_at_gte (incremental sync). GET /repos/:id/docs. 详见 references/api/doc_api.md
- **yuque_create_doc** — Create a document in a repo. 传 parent_uuid 则挂到指定节点下，不传默认挂根目录。POST /repos/:id/docs. 详见 references/api/doc_api.md
- **yuque_get_doc** — Get document detail (body/body_html). Sheet/Table docs and body_lake/body_draft need raw=true. Supports id or slug. GET /repos/docs/:id. 详见 references/api/doc_api.md
- **yuque_update_doc** — Update a document title/body/slug/format/public. PUT /repos/:id/docs/:id. 详见 references/api/doc_api.md
- **yuque_delete_doc** — Delete a document (moves to recycle bin). ⚠️ Requires confirm='DELETE'. DELETE /repos/:id/docs/:id. 详见 references/api/doc_api.md
- **yuque_get_doc_versions** — List document version history (last 100 published versions). GET /doc_versions?doc_id=:id. 详见 references/api/doc_api.md
- **yuque_get_doc_version_detail** — Get version detail (format/body/body_md/body_html/body_asl/diff + meta). Fields over 20000 chars are truncated — pass raw=true for the full payload. GET /doc_versions/:id. 详见 references/api/doc_api.md
- **yuque_embed_url** — Generate a Yuque embed reader URL from a document link or doc_id+book_id. 详见 references/api/extended_api.md
- **yuque_batch_get_docs** — Batch get document details (concurrent GET, read-only, max 20). 详见 references/api/doc_api.md
- **yuque_export_doc** — Export a single document as Markdown file. Fetches doc → converts body_html to Markdown → adds frontmatter → writes to disk. Resource download is separate (yuque_export_resources). 详见 references/api/extended_api.md
- **yuque_export_resources** — Download images/attachments from a document to local directory. Extracts resource URLs from body_html, downloads to <output_dir>/images/ and <output_dir>/attachments/, returns URL→local_path mapping. 详见 references/api/extended_api.md
- **yuque_copy_doc** — Copy a single document to another repo. Agent fetches source via yuque_get_doc, cleans content, then calls this tool with title/body/format/paths. 详见 references/api/extended_api.md
- **yuque_import_url** — Import content from a web URL into Yuque. Fetches page, extracts readable content, creates doc. 详见 references/api/extended_api.md
- **yuque_import_file** — Import a local Markdown/HTML file into Yuque. 3 modes: direct / upload_assets / embed_assets. 详见 references/api/extended_api.md
- **yuque_diff_doc_versions** — Compare two document versions and show line-level diff (added/removed/unchanged). Computes diff locally. 详见 references/api/doc_api.md
- **yuque_get_toc** — Get repo TOC tree (flat array, navigable via uuid/parent_uuid/child_uuid). GET /repos/:id/toc. 详见 references/api/toc_api.md
- **yuque_update_toc** — Update repo TOC (create/move/edit/delete nodes). ⚠️ Deleting requires confirm='DELETE'. For removeNode: action_mode=sibling deletes only the node, child deletes the node and all its children. PUT /repos/:id/toc. 详见 references/api/toc_api.md
- **yuque_batch_update_toc** — Batch update repo TOC. Agent provides ops plan, tool executes only. Supported actions: createTitle, appendNode, removeNode, moveNode, prependDoc. createTitle auto-reuses existing dirs. appendNode/moveNode support target_title. ⚠️ Remove/move ops require confirm='RESTRUCTURE'. For cross-book copy, use yuque_copy_doc instead.
- **yuque_list_repos** — List repos for a user or group. GET /users|groups/:login/repos. 详见 references/api/repo_api.md
- **yuque_create_repo** — Create a repo, auto-detects user vs group endpoint. POST /users|groups/:login/repos. 详见 references/api/repo_api.md
- **yuque_get_repo** — Get repo detail including toc_yml (TOC tree in YAML), namespace, items_count, full metadata. GET /repos/:id. 详见 references/api/repo_api.md
- **yuque_update_repo** — Update repo name/description/slug/public. PUT /repos/:id. 详见 references/api/repo_api.md
- **yuque_delete_repo** — Delete a repo (⚠️ irreversible). Requires confirm='DELETE'. DELETE /repos/:id. 详见 references/api/repo_api.md
- **yuque_batch_get_repos** — Batch get repo details (concurrent GET, read-only, max 20). 详见 references/api/repo_api.md
- **yuque_export_repo** — Export all docs in a repo as Markdown files organized by TOC dir structure, with images downloaded and INDEX.md+GRAPH.md generated. 详见 references/api/extended_api.md
- **yuque_copy_repo** — Batch copy documents to another repo. Agent provides cleaned documents array (title/body/format/paths). Tool creates TOC dirs and copies. 详见 references/api/extended_api.md
- **yuque_get_group_statistics** — Get group summary statistics. GET /groups/:login/statistics. 详见 references/api/statistic_api.md
- **yuque_get_member_statistics** — Get group member statistics. GET /groups/:login/statistics/members. 详见 references/api/statistic_api.md
- **yuque_get_book_statistics** — Get group repo statistics. GET /groups/:login/statistics/books. 详见 references/api/statistic_api.md
- **yuque_get_doc_statistics** — Get group document statistics. GET /groups/:login/statistics/docs. 详见 references/api/statistic_api.md
- **yuque_list_notes** — List current user's notes. GET /notes. 详见 references/api/note_api.md
- **yuque_get_note** — Get note detail. GET /notes/:id. 详见 references/api/note_api.md
- **yuque_create_note** — Create a note (short memo). Returns note_url, plus id/slug when resolvable (upstream POST /notes only returns note_url, so id is looked up in the note list right after create). POST /notes. 详见 references/api/note_api.md
- **yuque_update_note** — Update or delete a note. ⚠️ Deleting (status=9) requires confirm='DELETE'. PUT /notes/:id. 详见 references/api/note_api.md
- **yuque_list_recycles** — List recycle bin items (requires cookie+ctoken). GET /mine/recycles. 详见 references/api/recycle_api.md
- **yuque_restore_recycle** — Restore an item from recycle bin (requires cookie+ctoken). PUT /mine/recycles/:id/restore. 详见 references/api/recycle_api.md
- **yuque_destroy_recycle** — Permanently delete a recycle bin item (⚠️ irreversible, requires cookie+ctoken). Requires confirm='DELETE'. DELETE /mine/recycles/:id. 详见 references/api/recycle_api.md
- **yuque_upload_attachment** — Upload a file to Yuque CDN (image≤50MB, attachment/video≤2GB, requires cookie+ctoken). Extension pre-check: only Yuque-supported formats allowed (official list: https://www.yuque.com/yuque/gpvawt/ca13hg), unsupported extensions rejected with a friendly error (pack into zip first). POST /upload/attach. 详见 references/api/upload_api.md
- **yuque_get_board** — Get board resource JSON DSL and summary stats from a document. GET /yfm/boards. 详见 references/api/board_api.md
- **yuque_create_board** — Create a board resource (mindmap/flowchart/architecture diagram) in a document. POST /yfm/boards. 详见 references/api/board_api.md
- **yuque_update_board** — Update a board resource (text or dsl, choose one). PUT /yfm/boards. 详见 references/api/board_api.md
- **yuque_get_book_stacks** — 获取当前用户的知识库分组（书架）列表，含每个分组下的知识库。需要 cookie+ctoken 认证。GET /api/mine/book_stacks
- **yuque_get_editor_center** — 获取个人编辑中心全景数据：知识库数、文档数、总字数、编辑次数、活跃天数、互动用户排行、最多字的知识库等。需要 cookie+ctoken 认证。GET /api/mine/editor_center
- **yuque_create_book_stack** — 创建知识库分组（书架）并设定名称。需要 cookie+ctoken 认证。语雀 create 不能直接指定名字，本工具内部 create 后自动 edit 改名。body {name, target_rank}。
- **yuque_rename_book_stack** — 重命名知识库分组（书架）。需要 cookie+ctoken 认证。PUT /api/book_stacks/{stack_id}，body {name, type:'user_books'}。
- **yuque_update_book_stack** — 移动知识库到指定分组（书架）。需要 cookie+ctoken 认证。PUT /api/mine/book_stack/move。常用于将知识库从一个分组（如预废弃）移到另一个分组（如废弃）。
- **yuque_sort_book_stack** — 排序分组（书架）内知识库顺序。需要 cookie+ctoken 认证。PUT /api/mine/book_stack/move，传有序 targetBookIds（数组顺序即最终排序）。常用于把分组内知识库按期望顺序重排。
- **yuque_delete_book_stack** — 删除知识库分组（书架）。⚠️ 不可恢复！需传 confirm='DELETE' 二次确认。DELETE /api/book_stacks/{stack_id}。分组内须先清空知识库。
- **yuque_web_get_doc** — Cookie-based: Get full document detail with body/content. Supports markdown/lake/lakesheet formats. Returns richer fields than v2 get_doc (54 fields including abilities, joinToken, etc.). No membership required, no Token rate limiting. GET /api/docs/{id}?book_id={book_id}. id supports doc slug; book_id supports namespace/slug (e.g. group/book_slug) or numeric. 详见 references/api/web_doc_api.md
- **yuque_web_list_docs** — Cookie-based: List documents in a repo. Returns richer fields than v2 list_docs (draft_version, editor_meta, read_status, etc.). No membership required. GET /api/docs?book_id={book_id}. 详见 references/api/web_doc_api.md
- **yuque_web_list_repos** — Cookie-based: List repos for current user. Returns richer fields than v2 list_repos (abilities, cover_color, scene, etc.). Includes permission info (abilities.create_doc, modify_setting, destroy). No membership required. GET /api/books. 详见 references/api/web_doc_api.md
- **yuque_web_get_toc** — Cookie-based: Get repo TOC tree (flat array, navigable via uuid/parent_uuid/child_uuid). Same structure as v2 get_toc, but no membership required. GET /api/catalog_nodes?book_id={book_id}. 详见 references/api/web_doc_api.md
- **yuque_web_delete_doc** — Cookie-based: Delete a document (moves to recycle bin). DELETE /api/docs/{id}?book_id={book_id}. No membership required, alternative to v2 delete_doc when Token is rate-limited/expired. ⚠️ Requires confirm='DELETE'. 详见 references/api/web_doc_api.md
- **yuque_web_batch_move_catalog_nodes** — Cookie-based: Batch move document nodes to a target catalog node. PUT /api/catalog_nodes/batch. Supports cross-repo move (target_book_id may differ from book_id). No membership required. Moves the specified node_uuids under the target_uuid directory as children. 详见 references/api/web_doc_api.md
- **yuque_web_move_catalog_node** — Cookie-based: Move a single catalog node to a target catalog node / target repo. PUT /api/catalog_nodes/move. Supports cross-repo move (target_book_id may differ from book_id) and moving the whole subtree (with_children). No membership required. 详见 references/api/web_doc_api.md
- **yuque_web_copy_catalog_node** — Cookie-based: Copy a catalog node (doc or dir) to a target catalog node / target repo, server-side with attachment re-upload. PUT /api/catalog_nodes/copy. The source node is kept; a copy is created in the target repo and attachments re-uploaded there (preserves file cards). node_uuid must be from the web catalog (/api/catalog_nodes), not the v2 TOC. 详见 references/api/web_doc_api.md

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "yuque-ai-mcp": {
    "command": "npx",
    "args": ["-y","-p","yuque-ai-mcp","yuque-mcp"]
  }
}
```

## Documentation

## What yehuoshun/yuque-ai-mcp does

yеhuoshun/yuque-ai-mcp connects MCP-compatible AI clients to Yuque (语雀). Its tool groups cover document CRUD, knowledge-base management, table of contents, search, user and group administration, usage statistics, notes, recycle-bin operations, file uploads, boards, and book-stack organization.

Document workflows include fetching individual or batched documents, creating and editing content, reading version history, comparing versions, copying documents between knowledge bases, exporting Markdown, downloading embedded resources, and importing content from a URL or local file. Knowledge-base tools can list, create, update, delete, copy, and export repositories, while TOC tools support both individual and batch structural changes.

## How it works

The server offers two transports. The standard entry point runs over stdio, and the HTTP entry point exposes an HTTP SSE service on port 3099 by default in the documented development command. Both transports use the same registered tools.

Authentication is split by API surface. Forty-five tools use Yuque’s OpenAPI with an `X-Auth-Token`-style API token. Web API operations use a browser session cookie and `x-csrf-token`; these include web document access, web search, recycle-bin actions, uploads, and book-stack management. Search includes general search, RAG-oriented retrieval that also obtains document content, and a cookie-authenticated web search with document data, result counts, and highlighted snippets.

## Setup and configuration

From the repository’s `server` directory, install dependencies and build the project:

```bash
npm install
npm run build
```

Create the configuration file from the included template, then set the Yuque token. The configuration supports the API base URL, an optional browser cookie, an optional CSRF token value, and a configurable TOC cache lifetime. The default TOC cache duration is 60 minutes; changing it trades fewer API calls for fresher directory data.

Run `npm start` for stdio mode. Use `npm run dev:http` to start the HTTP SSE development service with `tsx` hot reload.

## Tools and capabilities

- Read, create, update, delete, copy, import, and export Yuque documents.
- Retrieve document versions, inspect version details, and calculate line-level differences.
- List and manage knowledge bases, including cross-book copying and Markdown export that follows TOC structure.
- Read and batch-update knowledge-base directories with operations such as node creation, movement, removal, and document insertion.
- Search Yuque through general, RAG-enhanced, and cookie-authenticated web methods.
- Manage team members and roles, retrieve user and group data, and query group, member, repository, and document statistics.
- Work with notes, recycle-bin items, attachments, diagram boards, book stacks, and editor-center data.

## Limitations and notes

Cookie-based capabilities require credentials beyond the API token and depend on Yuque web API access. Batch document and repository retrieval is limited to 20 items per request. Destructive book-stack deletion requires an explicit `confirm='DELETE'` value.

Errors use structured responses containing an HTTP status, message, and response summary. The server handles token or permission failures, rate limits with automatic retry, and the `book_full` condition by creating another repository and appending it to the relevant book list.

_Full upstream README: https://allmcps.com/mcp/yehuoshun-yuque-ai-mcp/readme_

