
BookMCP
io.github.Prem5123由 GitHub 账号 Prem5123 发布v0.1.0更新于 Oct 24, 2026
Cited book knowledge for agents working on system design and implementation.
概览
BookMCP 把你自己的系统设计与工程类 PDF 书籍接入编码助手,让它检索书中的段落、引用页码,并保存带来源的设计笔记。
- 可以做什么
- 浏览本地书库索引,查看已导入书籍的 ID、标题与页/块数量,书多时分页显示。用关键词(BM25)检索书库,可限定在某一本书内。读取指定的块或页面,并获取有限的相邻上下文,以便引用前核对原文。读取已保存的设计经验,并检查其来源是否已过期。通过提示词起草与书籍和块绑定的经验,而保存和删除需通过命令行工具完成。
- 适用场景
- 适合在设计服务、评审架构,或决定重试、一致性、缓存与可靠性方案时使用,让助手的建议基于你拥有的书籍原文并可给出引用。也适合把已审阅的设计经验带入后续会话。
- 运行要求
- 在 macOS、Linux 或 Windows 上作为本地进程运行,以原生二进制安装(或用 Rust 1.96+ 与 C/C++ 工具链从源码构建)。需先用命令行工具导入带文本层的 PDF;不需要 API 密钥、嵌入服务、Python 运行时或外部数据库。SQLite 与搜索索引均在本地运行。桌面客户端可能需要配置助手输出的绝对路径。
安装
在 SourceWeft 中
- 打开 控制台中的 BookMCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
BookMCP
Give coding agents the book knowledge to design and build better systems.
[CI] [Release] [MCP Registry] [License: MIT OR Apache-2.0]
BookMCP connects your system design and engineering books to Codex, Claude Code, and other stdio MCP clients. Ingest text-based PDFs once. Your agent can retrieve relevant principles, compare architecture trade-offs, and turn a chosen design into implementation guidance grounded in passages it can cite. Save useful design lessons with their sources for future sessions.
Use it when designing a service, reviewing an architecture, or implementing decisions about retries, consistency, caching, and reliability. The books provide reference knowledge; the agent still needs to reason about your requirements and test its implementation.
No API keys, embedding service, Python runtime, or external database required. SQLite and Tantivy BM25 search run on your machine.
Watch the 45-second demo. Retrieve a principle about safe retries, save it as a design lesson, and read it in a new MCP session. Real CLI and MCP output, edited for readability, using an original guide; source, transcript, and reproduction are included. Lesson saves happen explicitly through the CLI.
Try the system-design example · Download BookMCP · Share setup feedback
If this is useful for your agent workflow, star the repository to save it and help other developers find it.
Quick start
Download a native binary. No Rust, Python, API key, or database setup required.
Extract the archive, put bookmcp (bookmcp.exe on Windows) on your PATH, then open a terminal in the extracted folder. Step-by-step installation and checksum verification · All release assets
Build from source instead
Requires Rust 1.96+ and a C/C++ build toolchain: Xcode Command Line Tools on macOS, build-essential on Debian/Ubuntu, or Visual Studio Build Tools with C++ on Windows. Install Rust using rustup.
Ensure Cargo's bin directory is on your PATH. SQLite is bundled; no PDF command-line utility is needed.
Try the included, original test PDF before adding your own books:
Then ingest a PDF you have the right to use:
Ingestion prints the book ID and page/chunk counts. Repeating an ID requires --force; replacing a book keeps other books searchable. No OCR or semantic search is implied.
From book knowledge to a system design
For example, you are designing a background job service and deciding how retries should work. Connect BookMCP to your agent, ingest the relevant books, and ask:
Help me design a background job service using the knowledge in my BookMCP library. Start with the library index. Find and read passages about retries, idempotency, and failure handling. Compare the design trade-offs using page citations, then propose an implementation plan and failure-case tests. Separate book-backed principles from your assumptions, and say where the available evidence is insufficient.
The workflow is requirements → relevant book passages → design decisions → implementation and tests. Ask your agent to explain why a principle applies to your workload, not just repeat it. BookMCP supplies searchable evidence; it does not train the model, choose an architecture automatically, or prove the resulting code correct.
Useful starting points include:
- Architecture reviews: check a proposed design against principles in your books, with cited trade-offs and open questions.
- Implementation planning: turn a supported design decision into interfaces, invariants, and tests before changing code.
- Design continuity: save a reviewed lesson with its source so a later agent session can revisit the decision.
Connect your agent
Register the installed binary once. The client starts BookMCP automatically when needed; you do not need to leave a terminal server running.
Codex
Start a new Codex session and ask:
Use BookMCP to show my library. Search tiny-test for citations, read the matching chunk, and explain its advice with a page citation.
For a desktop app whose PATH differs from your terminal, run bookmcp mcp-config codex and merge the printed stanza into your Codex config.toml. It uses absolute executable and data-directory paths. See the official Codex MCP setup.
Claude Code
Start a new Claude Code session, check /mcp, and use the same prompt above. See the official Claude Code MCP setup.
Claude Desktop and other clients
Run bookmcp mcp-config claude and merge its mcpServers.bookmcp entry into the client's MCP configuration. Do not overwrite your existing server entries. The output looks like this, with actual absolute paths filled in:
To share a particular library across clients, pass the same absolute --data-dir when ingesting and serving:
--data-dir takes precedence over BOOKMCP_HOME, then the platform app-data default. bookmcp doctor reports the paths in use and checks database integrity, indexed content, and managed PDF hashes.
Put the index in context, fetch the evidence on demand
BookMCP exposes a compact book_get_library_index tool and bookmcp://library resource: book IDs, titles, page/chunk counts, retrieval URIs, and saved-lesson counts. Full PDF text stays out of the initial index. Larger catalogs include a next_offset for pagination.
MCP clients decide whether to load resources or follow server instructions; registering a server does not automatically inject your books into every conversation. Add this short guidance to your project's AGENTS.md (Codex) or CLAUDE.md (Claude Code):
For a copyable snapshot, run bookmcp context (or --json). Refresh it after ingestion; --offset selects subsequent pages.
A typical evidence workflow is:
book_get_library_index— discover available books.book_search— search a focused term, optionally scoped to a book.book_get_chunk— read and verify the passage behind a result.book_get_context— fetch bounded neighboring chunks if needed.- Answer with citations; separate the author's claims from your interpretation.
Pages are 1-based physical PDF pages, which may differ from printed page labels. Search snippets are previews; fetch the source chunk before quoting. Definition/example tools use keyword heuristics, so inspect their evidence.
Keep lessons across sessions
Use the MCP capture_book_lesson prompt, or ask your agent:
Find a useful rule in this book and draft a lesson with a short title, an actionable explanation, and the supporting book and chunk IDs.
Review the draft, then save it locally:
Agents retrieve saved lessons through book_list_lessons or book://tiny-test/lessons. Saving validates the source chunk and records its citation and PDF hash. If the source changes, a lesson is marked stale so an agent can re-check it. Lessons are user-authored interpretations, not verified quotes or automatically learned model memory.
MCP stays read-only: it can help draft and retrieve lessons, while the CLI performs explicit saves and removals. A coding agent can run that CLI step when you authorize it through the agent's normal command permissions.
CLI reference
Run bookmcp <command> --help for options. Retrieval commands and lesson add/list support --json. See MCP tools, resource schemas, and prompts for the agent API.
What works, and current limits
- Text-based PDF extraction, title/author metadata, conservative chapter detection and top-level bookmarks.
- Deterministic chunks with page ranges and citations; a managed original PDF copy.
- Local multi-book BM25 search, capped retrieval, and live reads of newly ingested books and saved lessons.
- MCP tools, resources, argument-aware prompts, and stdio transport.
- Explicit errors for encryption, unreadable PDFs, and absent text layers.
OCR, layout reconstruction, table/figure extraction, local vectors, and HTTP transport are future work. Multi-column text and unusual font encodings may extract imperfectly; check the original PDF when exact layout matters. No DRM/password bypass is supported. See the roadmap.
BookMCP itself makes no hosted AI calls and has no telemetry. Retrieved passages enter the connected agent's context, so that agent's model provider and privacy settings still apply. Use a local model/client when you need an entirely offline assistant. Only ingest material you have the right to use. See security and data boundaries.
Troubleshooting
Development and contributing
Tests cover domain validation, ingestion/chunking, persistence, search, service behavior, and an actual MCP stdio subprocess that ingests, searches, reads citations, handles prompts, and retrieves lessons. CI runs the quality gates. Release automation builds archives and checksums when a version tag is pushed; publishing a release is a separate maintainer action.
Trying BookMCP for the first time? Share setup feedback, including what you tried and where you got stuck. Please leave private book text out of reports.
See architecture, contributing, and agent engineering rules. Useful contributions include legally shareable regression PDFs, clear reproduction steps, extraction fixes, and examples of how cited book knowledge improved a real task.
Built by Prem Bhatia with implementation assistance from OpenAI Codex.
Licensed under MIT or Apache-2.0, at your option.
来源:README.md,提交 1448126
工具
0版本历史
1- v0.1.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分