Skip to main content
Glama
shuge-mcp-server

shuge-mcp-server

by Mocooa

shuge-mcp-server

书格(shuge.org)MCP Server —— 让 AI 助手直接检索和浏览中国古籍数字图书馆。

书格是一个自由开放的在线古籍图书馆,收录 700+ 部高清古籍资源(PDF),涵盖经、史、子、集四部分类。本项目通过 Model Context Protocol 将书格的公开 API 封装为结构化工具,供 Claude Code、Claude Desktop 等 MCP 客户端调用。

功能

提供 7 个工具:

工具

功能

shuge_search

按关键词搜索古籍

shuge_get_book

获取单本古籍详情(HTML 自动清洗为纯文本)

shuge_list_categories

列出所有分类(四部分类、朝代等)

shuge_browse_category

按分类浏览古籍列表

shuge_get_tags

获取标签列表

shuge_get_download_links

获取古籍 PDF 下载链接

shuge_latest

获取最新发布的古籍

特性

  • HTML → 纯文本:自动清洗 WordPress 富文本,节省 token

  • 分页支持:所有列表工具支持 page + per_page 参数

  • 分类缓存:分类数据内存缓存 30 分钟

  • 内容截断:超长内容优雅截断至 25000 字符

  • 无需认证:书格 API 完全公开

Related MCP server: conceptio-search

安装

git clone https://github.com/Mocooa/shuge-mcp-server.git
cd shuge-mcp-server
npm install
npm run build

注册到 Claude Code

claude mcp add shuge -- node /path/to/shuge-mcp-server/dist/index.js

注册到 Claude Desktop

编辑 ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "shuge": {
      "command": "node",
      "args": ["/path/to/shuge-mcp-server/dist/index.js"]
    }
  }
}

使用示例

注册后重启客户端,即可用自然语言调用:

  • "搜索书格上的山海经"

  • "看看书格最近更新了什么古籍"

  • "列出书格的所有分类"

  • "帮我找到《本草纲目》的下载链接"

技术栈

  • TypeScript + Node.js

  • @modelcontextprotocol/sdk — MCP 协议 SDK

  • stdio 传输(标准 MCP 接入方式)

  • 原生 fetch(Node.js 内置)

数据来源

所有数据来自 书格 的公开 WordPress REST API。本项目仅作为 API 的结构化封装,不存储任何古籍内容。

License

MIT

Available Tools

7 tools
shuge_browse_categoryA

按分类 ID 浏览该分类下的古籍列表。先用 shuge_list_categories 获取分类 ID。

Inputs: category_id (required), page, per_page.

shuge_get_bookB

获取单本古籍的详细信息,包括清洗后的纯文本内容。

Inputs: id (required).

shuge_get_tagsA

获取书格古籍标签列表,用于发现主题和关联浏览。

Inputs: page, per_page.

shuge_latestB

获取书格最新发布的古籍列表。

Inputs: page, per_page.

shuge_list_categoriesA

列出书格所有古籍分类(四部分类、朝代、现代分类等)。结果会缓存 30 分钟。

Inputs: force_refresh.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 7 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes: detail retrieval (get_book), discovery by keyword (search), by category (browse_category), by recency (latest), plus two taxonomy listings and a download-link fetcher. The only mild overlap is between list_categories and get_tags, since both surface taxonomy-like ID lists, but the descriptions (四部分类/朝代 vs. 主题标签) make the distinction workable.

    Naming Consistency4/5

    All names share the shuge_ namespace prefix and 5 of 7 follow a verb_noun pattern (get_book, list_categories, browse_category, get_tags, get_download_links). shuge_latest is a bare noun/adjective and shuge_search is a bare verb with no object, which are minor deviations from the otherwise predictable scheme.

    Tool Count5/5

    Seven tools is a well-scoped surface for a digital archive: one detail fetch, three list/browse entry points, two taxonomy helpers, and one asset-link tool. No tool looks redundant or filler, and nothing essential seems crammed in.

    Completeness3/5

    The lifecycle is mostly covered (discover via search/category/latest, inspect via get_book, download via get_download_links), but get_tags is a dead end: tags are listed for '关联浏览' yet there is no browse-by-tag tool analogous to browse_category. Search may partially compensate, but an agent following a tag cannot proceed.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Exposes 97 official Shanghai Library open data APIs and the Sou-Yun poetry database (1.99 million poems) as 12 MCP tools, covering genealogy, ancient books, calligraphy, historical buildings, and more. Enables MCP clients to query these datasets using natural language.
      12
      28 PyPI
      4
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to search 1m+ open-access papers, standards, textbooks, and legal documents, resolve identifiers such as RFCs, DOIs, and legal citations, download PDFs, and retrieve citations and metadata through MCP tools.
      9
      MIT
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to search a personal reference library, retrieve complete item metadata, and read the full text of attached PDFs through MCP tools.
      -