Calibre Librarian MCP Server
Click on "Deploy 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 Librarian MCP Server find books by Terry Pratchett"
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 Librarian MCP Server
Model Context Protocol (MCP) server that surfaces your Calibre catalog to Claude via xmcp.
Requirements
Node.js:
v24.13.0(auto-managed if you usenvm use).pnpm: version
10.28.0or newer.Calibre CLI tools:
calibredbandebook-convertmust be installable on your PATH.Environment variables:
CALIBRE_LIBRARY_PATH– absolute path to your Calibre library directory.CALIBRE_DB_COMMAND– location of thecalibredbexecutable (e.g.,/opt/homebrew/bin/calibredb).FAVORITE_SEARCH_ENGINE_URL– base URL used when the server offers external book lookups (defaults to DuckDuckGo:https://duckduckgo.com/?q=).
Related MCP server: obsidian-mcp-server
Setup
Clone and enter the repo:
git clone https://github.com/chepetime/calibre-librarian-mcp.git cd calibre-librarian-mcpInstall dependencies with pnpm:
pnpm installCopy the sample environment file and fill in your paths:
cp .env.example .env
Update the variables so the server can reach your Calibre library.
The env is just for local development. For Claude Desktop, you'll need to configure the server in the Claude Desktop settings.
Local development workflow
Use these scripts while iterating locally:
pnpm run dev– watches files and serves the MCP server over stdio.pnpm run lint– type-checks and lints the project.pnpm test– runs the full unit test suite once.pnpm test:watch– reruns tests whenever source files change.
Build for Claude Desktop (no Docker)
Follow this flow when you want Claude Desktop (or any MCP client) to run the compiled server directly:
Build the project so
dist/stdio.jsexists:pnpm run build(Optional) Run the built output locally for a quick smoke test:
pnpm start # equivalent to: node dist/stdio.jsConfigure Claude Desktop by editing
~/Library/Application Support/Claude/claude_desktop_config.json(or via the in-app UI). Setcommandtonode, include the absolute path todist/stdio.jsas the firstargsentry, and provide the required environment variables:
{
"globalShortcut": "",
"mcpServers": {
"calibre-librarian": {
"command": "node",
"args": ["/Users/you/path/to/calibre-librarian-mcp/dist/stdio.js"],
"env": {
"CALIBRE_LIBRARY_PATH": "<Absolute path to your>/Calibre",
"CALIBRE_DB_COMMAND": "/opt/homebrew/bin/calibredb",
"FAVORITE_SEARCH_ENGINE_URL": "https://duckduckgo.com/?q="
}
}
},
"preferences": {
"quickEntryShortcut": "off",
"menuBarEnabled": false
}
}After Claude Desktop reloads, it will list calibre-librarian as an available MCP server whenever MCP-enabled conversations start.
Docker deployment
Run the server in a container with Calibre pre-installed when you prefer an isolated environment.
Quick start
# Build the image
docker build -t calibre-librarian-mcp .
# Run with your Calibre library mounted
docker run -it \
-v /path/to/your/calibre/library:/library:ro \
-e CALIBRE_LIBRARY_PATH=/library \
calibre-librarian-mcpDocker Compose
Copy and customize
docker-compose.yml.Set your library path and launch the stack:
export CALIBRE_LIBRARY_PATH=/path/to/your/calibre/library docker compose up --build
Claude Desktop with Docker
To let Claude Desktop run the container directly, point it at docker run:
{
"mcpServers": {
"calibre-librarian": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"/path/to/your/calibre/library:/library:ro",
"-e",
"CALIBRE_LIBRARY_PATH=/library",
"calibre-librarian-mcp"
]
}
}
}Note: Remove :ro from the volume mount and add -e CALIBRE_ENABLE_WRITE_OPERATIONS=true to enable write operations.
Tool Catalog & Examples
Installing the MCP CLI
The examples below use the mcp CLI published by Anthropic. Install (or run) it with any of the following options:
Global install (recommended if you call MCP tools frequently):
npm install -g @anthropic-ai/mcp-cli # now `mcp --help` should workOne-off execution without a global install:
npx @anthropic-ai/mcp-cli --help # or pnpm dlx @anthropic-ai/mcp-cli --help
CLI usage
All tools can be invoked from MCP Inspector or the CLI:
mcp call calibre-librarian <toolName> '<json payload>'Prompts (e.g., merge_duplicates, library_cleanup, search_library) use the companion command:
mcp prompt calibre-librarian library_cleanup '{"focus":"missing covers"}'Swap library_cleanup for any prompt listed below, and replace calibre-librarian with the server name you configured in mcp.json.
Library Overview & Metadata
Tool | Example |
|
|
|
|
|
|
|
|
|
|
Search & Discovery
Tool | Example |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full-Text & Content Access
Tool | Example |
|
|
|
|
|
|
Cleanup & Duplicate Workbench
Tool | Example |
|
|
|
|
|
|
|
|
|
|
|
|
Smart Maintenance Recipes
Tool | Example |
|
|
|
|
|
|
|
|
Metadata Editing & Custom Columns
Requires
CALIBRE_ENABLE_WRITE_OPERATIONS=true
Tool | Example |
|
|
|
|
Setup & Configuration Tools
Tool | Example |
|
|
Environment Variables
Variable | Required | Default | Description |
| Yes | — | Absolute path to your Calibre library directory |
| No |
| Path to the |
| No |
| Timeout for calibredb commands in milliseconds |
| No |
| Enable metadata editing tools ( |
| No |
| Base URL for external book search links |
| No |
| Server name shown in MCP clients |
Resources
The server exposes these MCP resources:
URI | Description |
| Library configuration and statistics |
| Custom column definitions |
| MCP Inspector verification guide |
Troubleshooting
"calibredb: command not found"
The server can't find the Calibre CLI tools. Solutions:
macOS (Homebrew):
brew install calibreor setCALIBRE_DB_COMMAND=/Applications/calibre.app/Contents/MacOS/calibredbmacOS (App):
CALIBRE_DB_COMMAND=/Applications/calibre.app/Contents/MacOS/calibredbWindows:
CALIBRE_DB_COMMAND=C:\Program Files\Calibre2\calibredb.exeLinux: Install Calibre via package manager, usually adds
calibredbto PATH
"Library path does not exist"
Verify your CALIBRE_LIBRARY_PATH:
# Check the path contains metadata.db
ls "$CALIBRE_LIBRARY_PATH/metadata.db""Write operations are disabled"
Write tools (set_metadata, set_custom_column, bulk_retag with preview:false, etc.) require:
CALIBRE_ENABLE_WRITE_OPERATIONS=trueAdd this to your .env file or Claude Desktop config.
"Command timed out"
For large libraries, increase the timeout:
CALIBRE_COMMAND_TIMEOUT_MS=60000 # 60 seconds"Full-text search returns no results"
Calibre FTS must be enabled:
Open Calibre
Go to Preferences → Searching
Enable Full text searching
Click Re-index all books
Server not appearing in Claude Desktop
Verify the config file path:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Check JSON syntax is valid
Restart Claude Desktop completely
Check Claude Desktop logs for errors
Testing with MCP Inspector
Use the built-in verification guide:
# Start dev server
npm run dev
# In another terminal, run inspector
npx @anthropic/mcp-inspectorOr use the generate_claude_config tool to get your configuration.
License
MIT
Available Tools
26 toolsbulk_retagBulk retagADestructive
Add, remove, or replace tags for books matching a search query. Useful for bulk organization tasks like categorizing all books by an author or cleaning up tag names.
Inputs: tags (required), query (required), action (required), limit, +1 more.
compare_booksCompare booksARead-onlyIdempotent
Compare metadata between multiple books side-by-side. Useful for deciding which duplicate to keep, verifying metadata consistency, or identifying differences between editions. Highlights differences between books.
Inputs: bookIds (required), fields.
fetch_excerptFetch book excerptARead-onlyIdempotent
Fetch a short text excerpt from a book's content. Extracts the beginning of a book to preview its content. Useful for checking writing style, confirming the right book, or getting a taste of the content.
Inputs: bookId (required), format, maxChars.
find_duplicatesFind duplicatesARead-onlyIdempotent
Find potential duplicate books in the library. Helps identify books that may have been added multiple times with slight variations in metadata. Returns groups of potentially duplicate books for review.
Inputs: mode, limit, bookId, threshold.
full_text_searchFull-text searchARead-onlyIdempotent
Search inside book content using Calibre's full-text search. Finds quotes, passages, and references within books. Note: Requires FTS indexing to be enabled in Calibre library settings.
Inputs: query (required), limit, matchAll, includeSnippets.
generate_claude_configGenerate Claude configARead-onlyIdempotent
Generate Claude Desktop configuration for this MCP server. Outputs the JSON snippet to add to your Claude Desktop config file.
Inputs: serverPath, libraryPath, enableWrites.
get_all_tagsGet all tagsARead-onlyIdempotent
List all tags in the Calibre library with book counts. Useful for exploring available categories, finding popular tags, or planning tag-based organization.
Inputs: sortBy, minCount.
get_book_detailsGet book detailsARead-onlyIdempotent
Get detailed metadata for a specific book by its Calibre ID. Returns title, authors, tags, formats, identifiers, publication info, and more.
Inputs: bookId (required).
get_books_by_authorGet books by authorARead-onlyIdempotent
Get all books by a specific author. Returns book details including title, series, tags, and formats. Use search_authors_by_name first if you need to find the exact author name.
Inputs: author (required), exact, limit, sortBy, +1 more.
get_books_by_author_idGet books by author IDARead-onlyIdempotent
Get all books by a specific Calibre author ID. More precise than searching by name when dealing with authors who have similar names. Use search_authors_by_name to find author IDs first.
Inputs: authorId (required), limit, sortBy, ascending.
get_books_by_seriesGet books by seriesARead-onlyIdempotent
Get all books in a series with proper reading order. Books are sorted by series index to show the correct sequence. Useful for finding what books are in a series and planning reading order.
Inputs: series (required), exact, limit.
get_books_by_tagGet books by tagARead-onlyIdempotent
Get all books with a specific tag. Useful for browsing themed collections or finding books in a category. Use get_all_tags to discover available tags first.
Inputs: tag (required), exact, limit, sortBy, +1 more.
get_custom_columnsGet custom columnsARead-onlyIdempotent
List all custom columns defined in the Calibre library. Custom columns allow users to add their own metadata fields (e.g., 'Read Status', 'Owned Format', 'Priority'). Returns column names, labels, and data types.
Inputs: details.
get_library_statsGet library statisticsARead-onlyIdempotent
Get library statistics including total book count, format breakdown, tag counts, author counts, and series counts. Useful for understanding the composition of your Calibre library.
Inputs: no named parameters.
library_maintenanceLibrary maintenanceBDestructive
Run Calibre library maintenance operations: check integrity, backup metadata to OPF files, embed metadata into book files, or vacuum the database. Some operations modify files.
Inputs: operation (required), bookIds, onlyMissingCovers.
list_sample_booksList sample booksBRead-onlyIdempotent
List a few books from the configured Calibre library using calibredb list.
Inputs: limit.
missing_book_scoutMissing book scoutARead-onlyIdempotent
Check a reading list against your Calibre library. Reports which books you own and generates search links for missing titles. Great for processing 'to-read' lists or book recommendations.
Inputs: readingList (required), fuzzyMatch, searchEngine.
normalize_author_sortNormalize author_sortADestructive
Find and fix inconsistent author_sort values. Calibre uses author_sort for proper alphabetization (e.g., 'Tolkien, J.R.R.' for 'J.R.R. Tolkien'). Preview changes before applying.
Inputs: limit, preview, authorId.
quality_reportQuality reportARead-onlyIdempotent
Generate a quality report for the library, identifying books with missing metadata, covers, or other issues. Helps prioritize cleanup tasks.
Inputs: limit, checks.
search_authors_by_nameSearch authors by nameARead-onlyIdempotent
Search for authors by name pattern. Returns matching authors with their book counts. Useful for finding authors when you only remember part of their name.
Inputs: name (required), limit, sortBy.
search_book_contentSearch book contentARead-onlyIdempotent
Search for text within a specific book's content. Plain-text fallback when Calibre FTS is not available. Extracts the book to text and searches for matches with surrounding context.
Inputs: query (required), bookId (required), maxMatches, contextChars.
search_booksSearch booksARead-onlyIdempotent
Search books in the Calibre library using Calibre's query language. Supports field-specific searches (title:, author:, tag:, series:, publisher:, format:, rating:, etc.) and boolean operators (and, or, not).
Inputs: query (required), limit, sortBy, ascending.
search_books_by_tag_patternSearch books by tag patternARead-onlyIdempotent
Search for books by tag pattern. First finds all tags matching the pattern, then returns books with any of those tags. Useful for exploring related categories (e.g., 'fiction' finds books tagged 'Fiction', 'Science Fiction', 'Historical Fiction', etc.).
Inputs: pattern (required), limit, sortBy, ascending.
search_books_by_titleSearch books by titleARead-onlyIdempotent
Search books by title with wildcard support. Simpler interface than search_books for quick title lookups. By default performs partial/contains matching (e.g., 'ring' finds 'The Lord of the Rings').
Inputs: title (required), exact, limit, sortBy, +1 more.
set_custom_columnSet custom column valueADestructive
Update a custom column value for a book. WARNING: This modifies your Calibre library. Use get_custom_columns to see available columns and get_book_details to verify the book before updating.
Inputs: value (required), bookId (required), column (required), append.
set_metadataSet book metadataADestructive
Update metadata fields for a book. WARNING: This modifies your Calibre library. Only specified fields will be updated; others remain unchanged. Use get_book_details first to see current values.
Inputs: bookId (required), tags, title, rating, +6 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 26 tools
Most tools have distinct purposes, but there is some overlap between several search variants (search_books, search_books_by_title, search_books_by_tag_pattern) and between get_books_by_author and get_books_by_author_id. Descriptions help differentiate, but an agent might occasionally misselect when looking for a simple book lookup.
All tools use a consistent snake_case verb_noun pattern (e.g., bulk_retag, compare_books, fetch_excerpt). The naming is predictable and makes the action-object relationship clear across the entire set.
With 26 tools, the server is on the heavy side. While the scope of a Calibre library manager can justify many operations, some tools feel redundant (e.g., multiple search variants), and the count exceeds the typical well-scoped range of 3-15.
The tool surface covers most core library operations: search, retrieval, updates, duplicates, quality reports, and maintenance. Minor gaps include lack of direct CRUD for series or publishers, but these can be managed via metadata updates.
Maintenance
Related MCP Connectors
Persistent context for Claude. Your AI always knows your projects and next actions across sessions.
Your versioned prompt library: search, read, save and version prompts from Claude Code.
Personal CRM for Claude. Contacts live as plain-text files in your own Google Drive.
Zotero MCP server for Claude and ChatGPT: search, citations, safe writes, PDF passages and pages.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables searching, reading, and managing a Calibre ebook library through natural language, with features like metadata search, full-text search, content extraction, and library management.241 npmApache 2.0
- AlicenseNot gradedqualityDmaintenanceConnects Claude.ai to your local Obsidian vault for full CRUD access, search, and daily note creation via the Model Context Protocol.67 npm14MIT
- AlicenseNot gradedqualityBmaintenanceBridges your Calibre e-book library with AI assistants via the Model Context Protocol, enabling natural-language library management, semantic search, RAG, and agentic workflows.51MIT
- AlicenseNot gradedqualityCmaintenanceProvides AI assistants with direct access to your ebook library, enabling listing books, reading chapters, and searching across books via the Model Context Protocol.MIT