bookorbit-mcp
An 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.
README
bookorbit-mcp
An MCP server that exposes the text of your ebooks — managed by BookOrbit — to LLMs, so an assistant can answer questions about what happens inside a book without you copy-pasting chapters.
It is deliberately navigation-first: instead of dumping a whole 100k-word book into the model's context (which would overwhelm it), the server lets the model find a book, look at its chapter list, and pull only the pieces it needs.
How it works
BookOrbit stores raw EPUB files and exposes a reader backend
(/epub/{bookId}/info + /epub/{bookId}/file/{path}). This server uses that
backend to read a book's structure, fetch only the needed chapters, strip the
XHTML to plain text, and cache the result on disk. Nothing is re-downloaded
after the first read.
Three guardrails keep the model from drowning:
- Structure before text —
list_chaptersreturns chapter labels and sizes, never the body. - Bounded, paginated text —
get_chaptercaps output (~24k chars) and pages through long chapters withoffset/nextOffset. - Snippet-only search —
search_in_bookreturns short snippets plus a chapter index + offset the model can re-fetch precisely.
Tools
All tools are read-only.
Find & read book text
| Tool | What it does |
|---|---|
search_books(query, limit?) |
Find books by title/author/series; returns bookId + formats + hasEpub. |
get_book(bookId) |
Full metadata (description, series, genres, files). |
list_chapters(bookId) |
Chapter list with per-chapter char/word counts (no text). Parses + caches on first call. |
get_chapter(bookId, chapter, offset?, maxChars?) |
Plain text of one chapter, paginated. |
search_in_book(bookId, query, maxResults?, caseSensitive?) |
Keyword search within a book → snippets + locations. |
Discovery & browse
| Tool | What it does |
|---|---|
get_related_books(bookId, kind) |
similar / same_series / same_author books for a book. |
list_series(page?, size?) |
Library's series with book/read counts. |
get_series_books(seriesId, page?, size?) |
Books in a series, in order. |
list_authors(page?, size?) |
Library's authors with book counts. |
get_author(authorId) |
One author, including their bio. |
get_author_books(authorId, page?, size?) |
Books by an author. |
list_collections() / get_collection(id) / get_collection_books(…) |
User collections, one collection's detail, and its books. |
list_smart_scopes() / get_smart_scope_books(…) |
Saved dynamic filters and the books they match. |
list_libraries() |
Libraries with per-library book/size/format stats. |
suggest_metadata(kind, q) |
Typeahead over authors/series/genres/tags/publishers/languages/narrators/collections — resolve an exact name. |
get_book_shelf(type, limit?) |
A curated shelf: recently-added, want-to-read, up-next-in-series, continue-reading/listening, random, smart-scope. |
search_author_metadata(q, …) |
External provider author-bio candidates (enrichment, not your library). |
Reading state & stats
| Tool | What it does |
|---|---|
get_reading_progress(bookId) |
Per-file progress (+ audiobook progress) for a book. |
list_currently_reading() |
Books you're reading now, with progress. |
get_reading_sessions(bookId, page?, …) |
Reading-session history + aggregate stats for a book. |
get_library_stats() |
Library-wide totals (books/authors/series/storage/…). |
get_reading_stats() |
Your personal reading totals (started/completed/…). |
get_library_statistic(kind, libraryIds?) |
One library-wide chart: distributions, top-authors/series, timelines, metadata-health gauges. |
get_reading_statistic(kind, days?, …) |
One personal reading chart: peak-hours, favorite-days, heatmap, completion-latency, goal-trajectory, … |
get_dashboard_widget(kind) |
One "headline card": reading-streak, reading-goal, year-projection, neglected-gems, library-overview, … |
Annotations (your own highlights & notes)
| Tool | What it does |
|---|---|
list_annotations(page?, pageSize?, bookId?) |
All highlights/notes across the library, paginated. |
list_annotated_books() |
Which books have annotations, with counts. |
get_annotations(bookId) |
One book's highlights/notes, in chapter order. |
Images (returned as image content, not text)
| Tool | What it does |
|---|---|
get_book_cover(bookId, size?) |
A book's cover image (full or thumbnail). |
get_author_image(authorId, size?) |
An author's photo (full or thumbnail). |
Typical flow: search_books → list_chapters → get_chapter /
search_in_book.
Requirements & scope
- EPUB only (v1). Books without an EPUB file return a clear error from the text tools.
- Auth: BookOrbit access tokens expire after ~15 minutes and there is no
long-lived API key, so the server logs in with your username + password and
refreshes / re-logs in automatically. A static
BOOKORBIT_TOKENis supported for quick tests but will not auto-refresh. - Single-user / local: it acts as the account you configure.
Configuration
Set these as environment variables (or in a local .env — see .env.example):
| Variable | Required | Notes |
|---|---|---|
BOOKORBIT_URL |
yes | Base URL, e.g. https://bookorbit.example.com (trailing slash ok). |
BOOKORBIT_USERNAME |
recommended | Enables automatic token refresh. |
BOOKORBIT_PASSWORD |
recommended | |
BOOKORBIT_TOKEN |
alternative | Static Bearer token; dev/testing only (expires ~15 min). |
CACHE_DIR |
optional | Where extracted text is cached (default ~/.cache/bookorbit-mcp). |
Install & build
npm install
npm run build
Use with a Claude client
Add to your MCP client config (e.g. Claude Desktop's claude_desktop_config.json,
or claude mcp add). Point at the built entry and pass your credentials:
{
"mcpServers": {
"bookorbit": {
"command": "node",
"args": ["/absolute/path/to/bookorbit-mcp/dist/server.js"],
"env": {
"BOOKORBIT_URL": "https://bookorbit.example.com",
"BOOKORBIT_USERNAME": "your-username",
"BOOKORBIT_PASSWORD": "your-password"
}
}
}
}
Development
npm test # unit tests (offline; run against captured fixtures)
npm run typecheck # type-check only
npm run dev # run the server from source over stdio
# Live checks against a real server (need .env with credentials):
node --import tsx scripts/smoke.mts # exercises search → parse → chapter → search
node --import tsx scripts/mcp-check.mts # drives the built server over the MCP stdio protocol
Design notes
- Chapters follow the TOC, not raw files. A single EPUB spine file can bundle
many chapters separated by
#fragmentanchors; the server resolves the table of contents into meaningful sections and slices each one by its anchor range. - Cache layout:
~/.cache/bookorbit-mcp/<bookId>/book.json(chapter list + sizes) andtext/section-NNN.txt(extracted text per chapter). - Discovery, reading-state, stats, and annotation tools are live passthroughs to BookOrbit and are not cached (that data is mutable); only extracted EPUB text is cached.
- Not included (v1): semantic/RAG search, cross-library content search, PDF/MOBI, and any write operations. The cache layout leaves room to add a cross-book index later.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。