calibre-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@calibre-mcpsearch for books by Isaac Asimov"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
calibre-mcp
A local MCP server (stdio) that lets an LLM host — Claude Desktop, Claude Code, or any MCP-compatible client — manage a Calibre ebook library conversationally: search, edit metadata, add, convert, deduplicate, remove, and email books, all with human-in-the-loop safety.
I built this to stop clicking around the Calibre GUI and manage my library from a chat instead. It's a personal project, and also a deliberate showcase of how I build backend/tooling systems: hybrid I/O design, an explicit failure taxonomy, human-approval gates on every destructive action, and a test suite that never touches real user data. See ARCHITECTURE.md for the full design writeup.
Why the hybrid design
Reads (
search,list,view, duplicate-finding) querymetadata.dbdirectly, read-only — fast, and structurally incapable of corrupting the library (the SQLite connection is openedmode=ro).Writes (
edit,add,remove,convert,email) go through Calibre's own CLI tools (calibredb,ebook-convert,calibre-smtp) — never raw SQL — so Calibre stays authoritative over its own database.Every write is preceded by an automatic
metadata.dbbackup (rolling, keeps the last 20).Removal is recoverable: files are copied to a managed trash folder and the book is sent to Calibre's recycle bin — never a permanent delete.
Every mutating or outward-facing tool is two-step (plan → confirm): the first call returns a human-readable review plus a
confirmation_token; nothing changes — and nothing is sent — until you re-call with that exact token.
Full rationale, module boundaries, and the decision log behind these choices live in ARCHITECTURE.md.
Related MCP server: calibre-mcp
Requirements
Calibre installed, with
calibredbandebook-converton yourPATH(calibredb --version).calibre-smtpis also required if you wantemail_book.Python ≥ 3.12 and
uv.
Install
git clone <this-repo> calibre-mcp
cd calibre-mcp
uv syncConfigure
The server manages one library, set via environment variable:
Variable | Required | Default | Purpose |
| yes | — | Path to your Calibre library directory (the folder containing |
| no |
| Where pre-write backups and trashed files are stored. |
The server fails fast at startup with a clear error if CALIBRE_LIBRARY_PATH is unset or the
directory has no metadata.db.
email_book additionally needs SMTP relay credentials (loaded lazily — the server boots fine
without them, and only email_book fails if they're missing):
Variable | Required | Default | Purpose |
| for email | — | SMTP relay host. |
| for email | — | SMTP username. |
| for email | — | SMTP password. Never logged, never returned in any tool output. |
| for email | — | Sender address. |
| no |
| SMTP port. |
| no |
| One of |
Claude Desktop / Claude Code
Add to your MCP config (e.g. claude_desktop_config.json):
{
"mcpServers": {
"calibre": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/calibre-mcp", "run", "calibre-mcp"],
"env": {
"CALIBRE_LIBRARY_PATH": "/absolute/path/to/your/Calibre Library"
}
}
}
}Run manually
CALIBRE_LIBRARY_PATH="/path/to/Calibre Library" uv run calibre-mcp
# or equivalently:
CALIBRE_LIBRARY_PATH="/path/to/Calibre Library" uv run python -m calibre_mcpThe server communicates over stdio (JSON-RPC); it prints nothing to stdout except MCP framing — all logs go to stderr, on purpose (see ARCHITECTURE.md).
Tools
Tool | What it does | Gate |
| Resolve a Calibre search query ( | read-only |
| Paginated, sortable listing — works even when the Calibre GUI holds a write lock. | read-only |
| Full metadata for one book id. | read-only |
| Advisory report of likely-duplicate books by normalized (title, author). Never merges. | read-only |
| Edit a whitelisted field set (title, authors, tags, series, rating, comments, …). | plan → confirm |
| Add a book from a local file path; surfaces duplicates honestly. | single-step (backed up) |
| Convert to a new format ( | single-step (backed up) |
| Recoverable removal: trash copy + Calibre recycle bin, never a hard delete. | plan → confirm |
| Email a book's file via | plan → confirm |
Every tool's full contract (edge cases, error conditions, exact field whitelist) is documented in
its docstring in server.py — those docstrings are what the LLM host
sees, so they double as the API reference.
Development
uv run ruff check src tests # lint
uv run pytest # full suite (unit + integration + e2e)
uv run pytest -m unit # fast unit tests only137 tests across three tiers (unit, integration, e2e); write tests never touch a real
library — see ARCHITECTURE.md.
Project layout
src/calibre_mcp/
├── server.py # FastMCP tool surface — the only stdio/MCP-aware module
├── library.py # CalibreLibrary facade — orchestrates every tool's business logic
├── sqlite_reader.py # Read-only metadata.db access (the only sqlite3 call site)
├── calibredb_runner.py # calibredb subprocess wrapper (search/edit/add/remove/add_format)
├── ebook_convert_runner.py # ebook-convert subprocess wrapper
├── calibre_smtp_runner.py # calibre-smtp subprocess wrapper
├── backup.py # metadata.db snapshots + recoverable trash
├── confirmation.py # plan→confirm token derivation/verification
├── config.py # env-driven startup config, fail-fast validation
└── errors.py # the failure taxonomy every layer maps toRoadmap
Shipped: full read/curate/distribute loop (search, list, view, edit, add, remove, convert,
dedupe, email). What's next — library self-knowledge, bulk operations, cover/metadata enrichment,
device sync — is tracked in .specs/ROADMAP.md, including the reasoning for
sequencing and what's explicitly out of scope.
Contributing
See CONTRIBUTING.md for the dev workflow, the invariants a PR must preserve, and how the spec-driven process behind this repo works.
License
MIT © Gustavo F Sousa.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityCmaintenanceConnects AI agents to Calibre ebook libraries for searching, reading, and managing digital collections. It supports metadata updates, format conversion, and full-text content searches while providing granular permission controls for library access.721MIT
- Alicense-qualityDmaintenanceEnables searching, reading, and managing a Calibre ebook library through natural language, with features like metadata search, full-text search, content extraction, and library management.159Apache 2.0
- AlicenseAqualityCmaintenanceAn MCP server to manage and organize a Calibre ebook library, enabling metadata editing, search, conversion, and more through AI assistants.174MIT
- Alicense-qualityAmaintenanceEnables semantic search over local Calibre libraries via MCP, allowing AI assistants to query books, annotations, and export bibliographies while keeping data private.5MIT
Related MCP Connectors
Agentic search over your Dewey document collections from any MCP-compatible client.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/gustavofsousa/calibre-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server