dsh-feiyu-books
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.
dsh-feiyu-books
给 DeepSeek Harness agent 的只读书架:把电子书拆成「一章一个 txt」,agent 就能按章阅读、按词检索,而不是把整本书塞进上下文。
A read-only bookshelf MCP server for DSH agents. Chapter-by-chapter reading with hard caps, full-text search, and a kill switch.
它能做什么
工具 | 作用 |
| 列出书架上的书(书名 slug、章数、字数) |
| 看某本书的目录(章节标题 + 每章字数) |
| 读某一章(可连续读 3 章;单次最多 12000 字,默认 6000) |
| 全书搜词,返回命中的章节与上下文片段 |
| 书架被关闭时唯一保留的工具,用来告诉 agent「别试了」 |
Related MCP server: mcp-ebook-read
安全边界(有意做窄)
只读:不写文件、不改书、不列书架目录之外的任何路径;
书名白名单:只接受
[a-z0-9_-],且最终路径必须落在书架目录内(防目录穿越);长度上限:单次返回默认 6000 字、硬顶 12000 字,防止一本书把上下文撑爆;
不需要任何网络:纯本地文件读取。
安装
git clone <repo> dsh-feiyu-books
cd dsh-feiyu-books
npm install --omit=dev # 只有两个依赖:MCP SDK 与 zod
node scripts/install.mjs # 写入本机绝对路径 + 注册到 profileinstall.mjs 做的事(幂等,可以重复跑):
把
cordis.patch.yml里的__NODE__/__SERVER__占位符换成本机绝对路径;在
~/.dsh/profiles/<profile>/package.json里加上dsh-feiyu-books依赖(link:)与 bundle;摘掉 profile patch 里旧的
mcp-books条目(避免同一个 server 注册两次)。
指定别的 profile:
node scripts/install.mjs --profile web
# 或先设环境变量
DSH_HOME=/path/to/.dsh DSH_PROFILE=web node scripts/install.mjs只看会改什么、不落盘:
node scripts/install.mjs --dry-run装完重启一次 DSH,工具会以 mcp__books__* 出现。
配置
配置文件(可选,缺省也能跑):
~/.dsh/books/config.json{
"enabled": true,
"booksDir": "F:\\books"
}字段 | 默认 | 说明 |
|
| 总开关。设成 |
|
| 书放在哪 |
也可以用环境变量覆盖:BOOKS_CONFIG(配置文件路径)、BOOKS_DIR(书架目录)。
开关在 MCP 服务启动时读一次,改完要重启 DSH。
导入一本书
文字版(txt / md / epub)
node scripts/import-book.mjs "D:\\书\\草房子.epub"
node scripts/import-book.mjs "D:\\书\\some.txt" my-slug产物:
<booksDir>/<slug>/
index.json # 标题、章数、每章字数
chapters/0001.txt # 一章一个文件
chapters/0002.txt扫描版(连环画 / 漫画 epub,只有图片没有文字层)
需要 Windows 自带的 OCR 语言包(Language.OCR~~~zh-CN,设置 → 语言里可装):
node scripts/import-comic.mjs "D:\\书\\平凡的世界(上).epub" pingfan-1 "平凡的世界·连环画(上)" 20
# ^slug ^标题 ^每段页数它会:解包 → 按页序重命名(index-10 不会排到 index-2 前面)→ OCR → 去掉汉字之间的多余空格 → 清洗画格编号碎片 → 按 20 页一段落盘。
自测
node scripts/selftest.mjs真起一个 stdio 客户端,把 4 个工具都调一遍,并验证 ../etc 这类越界书名会被拒绝。
卸载
从
~/.dsh/profiles/<profile>/package.json的dsh.profile.bundles里删掉dsh-feiyu-books;删掉
cordis.patch.yml里id: mcp-books的- insert:块;重启 DSH。
书架目录(booksDir)不会被删——那是你的书。
已知限制
不支持 PDF:PDF 抽文本要额外的解析器,扫描版 PDF 还得先 OCR 成图片。目前请先转成 txt/epub。
OCR 质量取决于原图:密排小字(版权页、内容提要)容易糊;正文旁白一般可读。
一本书不会一次读完:
books_read有字数上限,长书必须按章读——这是有意的设计。
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only MCP server over 50 book-based agent skills: routes a task to the right framework.
Read-only MCP server exposing a user ORANO library to their own AI agent.
Search a catalog of 1.7 million books and find books by mood, vibe, pace or genre. Read-only.
Read-only search and retrieval of published books, articles and authors, with public catalog links.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to read and navigate EPUB files through 13 specialized tools for pagination, full-text search, metadata access, and footnote resolution. Supports session-based reading with table of contents navigation and chapter summaries.MIT
- AlicenseBqualityDmaintenanceA local MCP server that lets LLM agents read EPUB books and PDF documents with outline-first navigation, precise node reads, and local SQLite persistence.292MIT
- AlicenseAqualityFmaintenanceAn MCP server that allows LLMs to read and search the text of ebooks from Book Orbit, using a navigation-first approach with chapter listing and paginated text retrieval.334MIT
- FlicenseNot gradedqualityDmaintenanceProvides a 'library keeper' sub-agent that ingests PDF/EPUB books and answers questions grounded in them via local embedding search, with deterministic classification and knowledge gap logging.-