Skip to main content
Glama

bookd

A local-first AI companion reader: humans read EPUB, MOBI, AZW3, and Markdown in the browser, while AI precisely retrieves the current book, chapter, CFI, visible text, and selection via MCP, and can also jump back and highlight.

bookd reader live view

Core boundaries

  • Content rendering and format processing never call the model; AI tokens are used only for discussion.

  • bookd is a resident HTTP + WebSocket service; MCP is a stateless stdio thin client. Closing Claude Code does not close the reader.

  • Files are written only to ~/Books/bookd by default; the reading-state bridge writes to the current project's .reading/state.json.

  • No DRM handling. PDF only accepts an explicitly configured local converter; the current build will not upload files to the MinerU GUI or reinstall MinerU.

Related MCP server: EPUB Reader MCP Server

Starting from this repository

Requires Node.js 20 or higher.

npm install
npm run build
node dist/cli.js start

Open http://127.0.0.1:4123. start launches the service in the background; if the service is already running it is reused directly. For debugging use npm run dev; to run the production build in the foreground use npm start.

Import a file or a Markdown directory:

node dist/cli.js import /path/to/book.epub
node dist/cli.js import /path/to/markdown-directory

The one-line startup form after publishing to npm is:

npx -y bookd start

Claude Code integration

The repository already provides:

When using a project-level .mcp.json for the first time, Claude Code will ask you to confirm trust. After building and starting bookd, you can say "open 《book title》" in Claude Code or call /bookd directly.

You can first check the configuration with claude mcp list; seeing Pending approval the first time is expected, and you need to approve it once in the Claude Code project session.

To reuse in another project: put integrations/claude-code/SKILL.md into the target project's .claude/skills/bookd/SKILL.md, and use integrations/claude-code/mcp.example.json as the target project's .mcp.json.

MCP tools

Tool

Purpose

get_reading_state

Current book, chapter, progress, CFI, visible text, and selection

list_books

List the local library

open_book

Switch books in an already-open reader

get_chapter

Read the cleaned chapter Markdown and plain text

search_book

Full-book search, returning chapters, excerpts, and jumpable CFIs (filled in after opening)

goto

Jump by CFI, chapter, or 0–1 progress

highlight

Highlight with optional notes, dual-write JSON / Markdown

clear_highlights

Delete a single highlight or all highlights in a book

The MCP entry point can also be run standalone:

BOOKD_URL=http://127.0.0.1:4123 node dist/mcp.js

Data layout

~/Books/bookd/<书名>/
├── source.epub              # 或 source.mobi / source.azw3 / source.md
├── extracted/               # 按逻辑章节缓存的 Markdown
├── chapters.json            # 搜索与 MCP 的结构化章节缓存
├── annotations.json         # 结构化批注
├── notes.md                 # 人可读、Git 友好的批注
└── meta.json

<当前项目>/.reading/state.json

state.json uses stable file-bridge fields:

{
  "book": "随椋鸟飞行",
  "chapter": "与椋鸟齐飞",
  "chapter_index": 1,
  "cfi": "epubcfi(/6/12!/4/2)",
  "progress": 0.09,
  "visible_text_head": "当前屏幕内的文字…",
  "selection": null,
  "updated_at": "2026-08-06T00:00:00.000Z"
}

Configuration

Environment variable

Default value

Meaning

BOOKD_HOST

127.0.0.1

HTTP listen address

BOOKD_PORT

4123

HTTP / WebSocket port

BOOKD_LIBRARY_DIR

~/Books/bookd

Library directory

BOOKD_STATE_DIR

.reading

File-bridge directory

BOOKD_URL

http://127.0.0.1:4123

MCP forwarding target

Verification

npm run check
npm audit --omit=dev
npm pack --dry-run

Tests cover EPUB/Markdown import, logical chapter extraction, full-text search, annotation dual-write, atomic state writes, HTTP, WebSocket, the 8 MCP tools, and real stdio child processes.

Real Chromium regression also covers the same Chinese book in EPUB, MOBI6, and AZW3/KF8: the raw spine/sections are merged into logical chapters according to the in-book TOC, preserving the chapter-start CFI. Markdown folders are imported as "one file, one logical chapter"; second-level headings inside a file do not fragment the TOC.

Ebook content is rendered by foliate-js in an iframe. bookd removes inline scripts and event handlers and injects a strict CSP; Chromium will still emit a sandbox warning for the allow-scripts + allow-same-origin that foliate-js requires for WebKit event compatibility. This is a known upstream implementation notice and does not mean in-book scripts are allowed to execute.

PDF / MinerU status

The local /Applications/MinerU.app is a networked Electron GUI and does not provide a mineru CLI, so the current build explicitly reports PDF as disabled in /api/health. PDF adaptation stays outside the core dependencies; it should only be enabled after detecting a user-configured local CLI, to avoid reinstalling Python/MinerU or accidentally uploading documents.

Phase records and technical validation are in PROGRESS.md.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to help users manage their reading experience by searching books, tracking reading progress, managing bookmarks, and generating personalized recommendations and summaries.
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables 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
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI clients to read and write local Apple Books library, collections, and annotations. Supports searching, exporting, and modifying books and highlights via MCP tools.
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides AI assistants with direct access to your ebook library, enabling listing books, reading chapters, and searching across books via the Model Context Protocol.
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AK-Monkey/bookd'

If you have feedback or need assistance with the MCP directory API, please join our Discord server