calibre-mcp
calibre-mcp
MCP-сервер, который даёт ИИ-ассистентам (Claude Code, Claude Desktop, Cursor, ...) доступ на чтение и запись к вашей локальной библиотеке электронных книг Calibre.
Ищите по библиотеке, просматривайте недавние добавления, импортируйте новые электронные книги с автоматическим обнаружением дубликатов и управляйте входящей папкой («drop folder») — всё прямо из чата.
Нулевая настройка в типичной конфигурации: исполняемый файл calibredb и библиотека, которую использует ваш GUI Calibre, обнаруживаются автоматически на macOS, Windows и Linux.
Не зависит от локали: все операции чтения выполняются через
calibredb --for-machine(JSON), поэтому результаты никогда не зависят от языка интерфейса Calibre.Безопасно по умолчанию: обнаружение дубликатов опирается на сам Calibre — книга, чьи название + автор уже есть в библиотеке, пропускается и никогда не импортируется дважды.
Инструменты
Tool | Описание |
| Путь к библиотеке, количество книг, версия calibre |
| Полноценный поиск по языку запросов Calibre ( |
| Просмотр библиотеки; по умолчанию сначала самые недавно добавленные |
| Импорт файлов электронных книг или целых каталогов с обнаружением дубликатов |
| Импортирует всё из входящей папки и раскладывает по местам |
Related MCP server: Calibre MCP Server
Требования
Calibre (любая версия, в состав которой входит
calibredb; протестировано с 9.x)Python ≥ 3.10
Установка
pipx (рекомендуется)
pipx install calibre-mcpuv
uv tool install calibre-mcppip
pip install calibre-mcpИз исходников
git clone https://github.com/ZehuiTIAN/calibre-mcp.git
cd calibre-mcp
pip install -e ".[dev]" # dev extras add pytest + ruffКонфигурация
Всё опционально в типичной конфигурации; каждое значение можно зафиксировать с помощью переменной окружения.
Variable | Meaning | Default |
| Используемый каталог библиотеки | Библиотека, которую использует ваш GUI Calibre (самая используемая библиотека из |
| Путь к исполняемому файлу |
|
| Входящая папка для | Отключено (при использовании инструмент выдаёт ошибку) |
| Секунды до прерывания вызова calibredb |
|
Регистрация в Claude Code
claude mcp add calibre-mcp -- calibre-mcpили добавьте в ~/.claude.json → mcpServers (на уровне пользователя):
"calibre_mcp": {
"type": "stdio",
"command": "calibre-mcp",
"args": [],
"env": {
"CALIBRE_LIBRARY_PATH": "/path/to/your/library",
"CALIBRE_INBOX_DIR": "/path/to/your/inbox"
}
}Регистрация в Claude Desktop / Cursor
Добавьте тот же JSON-блок в секцию MCP-серверов файла claude_desktop_config.json
(Claude Desktop) или в настройки MCP в Cursor.
Работа с входящей папкой
Входящая папка создаёт удобный цикл «найти → положить → архивировать» для книг, которые вы скачиваете вручную:
Укажите
CALIBRE_INBOX_DIRна папку, например~/Downloads/Calibre-Inbox.Скачивайте электронные книги в эту папку.
Попросите ассистента выполнить
import_inbox.
Каждый файл добавляется в библиотеку; успешно добавленные файлы и дубликаты
раскладываются в imported/YYYY-MM/, неудачные — в failed/. Сама входящая
папка остаётся чистой, и ничто никогда не перезаписывается (при совпадении имён
добавляется суффикс -1, -2, ...).
Поддерживаемые расширения: .epub .pdf .mobi .azw .azw3 .djvu .cbz .cbr .fb2 .txt .md .docx .rtf .lit .prc .pdb .chm .htmlz.
Предостережения
Блокировка базы данных: пока GUI Calibre держит библиотеку открытой, операции записи (
add_books,import_inbox) могут завершиться ошибкой блокировки базы данных. Инструменты только для чтения продолжают работать. Закройте Calibre (или переключите его на другую библиотеку) перед импортом.Большие библиотеки:
add_books/import_inboxпри каждом добавлении создают снимок полного набора идентификаторов книг — на практике это быстро, но составляет O(количество книг) на один импорт.Этот инструмент лишь организует вашу библиотеку. В нём нет функций поиска или скачивания; используйте его с контентом, право на хранение которого у вас есть.
Разработка
pip install -e ".[dev]"
ruff check .
pytest -m "not integration" # unit tests, run anywhere
pytest # + integration tests (need local calibre)Интеграционные тесты создают временные библиотеки в /tmp и никогда
не касаются вашей настоящей библиотеки.
Лицензия
MIT — см. LICENSE.
Краткий обзор на китайском
MCP-сервер, подключающий локальную библиотеку Calibre к ИИ-ассистентам
(Claude/Cursor и др.): пять инструментов
(library_info / search_books / list_books / add_books / import_inbox),
автоматическое обнаружение calibredb и расположения библиотеки, готов
к работе из коробки на всех платформах (Windows/macOS/Linux).
pipx install calibre-mcp
claude mcp add calibre-mcp -- calibre-mcpПри импорте автоматически выполняется проверка дубликатов (книга с тем же
названием и автором не будет импортирована повторно); в сочетании
с каталогом входящих CALIBRE_INBOX_DIR достаточно положить скачанные книги
в папку и сказать «импортировать входящие», и они будут архивированы.
Обработанные файлы автоматически раскладываются в imported/ или failed/.
Примечание: когда настольная программа Calibre держит ту же библиотеку открытой, операции записи могут завершиться ошибкой из-за блокировки базы данных; перед импортом закройте Calibre.
Available Tools
11 toolsadd_booksA
Import ebook files (or directories of ebooks) into the library.
Books whose title + author are already in the library are skipped by calibre and reported as "duplicate". The Calibre GUI must not hold the library open while adding.
Args: paths: Absolute paths to ebook files or folders containing ebooks.
Inputs: paths (required). Returns: object
build_indexA
Index book contents for full-text search (one-time, cached).
Converts each book's text with calibre's converter and stores it in a local SQLite FTS5 index kept outside the library. Only books that are not indexed yet are processed; an initial run over a whole library can take several minutes.
Args: book_ids: Optional list of book ids to index; default: all books that are not indexed yet. limit: Optional cap on how many books to index in this call.
Inputs: limit, book_ids. Returns: object
detect_scanned_booksA
Find library books whose PDF has no usable text layer (scanned pages).
Such books stay unsearchable until OCR'd with ocr_book. Requires the
ocr extra (pip install 'calibre-mcp[ocr]'); no API key needed.
Args: limit: Maximum number of scanned books to report (1-200).
Inputs: limit. Returns: object
import_inboxA
Import every ebook file in the configured inbox folder into the library.
Requires the CALIBRE_INBOX_DIR environment variable. Successfully added
files and duplicates are moved to <inbox>/imported/YYYY-MM/; files that
fail to import are moved to <inbox>/failed/ for inspection.
Inputs: no named parameters. Returns: object
library_infoA
Show the active library: its path on disk, number of books, calibre version.
Inputs: no named parameters. Returns: object
list_booksA
Browse books in the library; defaults to most recently added first.
Args: limit: Maximum number of results (1-200, default 20). sort_by: calibre field to sort by, e.g. id, title, authors, timestamp. order: "desc" (default) or "asc". search: Optional calibre search expression to filter the listing.
Inputs: limit, order, search, sort_by. Returns: object
ocr_bookA
OCR a scanned PDF via the configured cloud provider and index the text.
Detection → page rendering → provider transcription → cache → full-text index → (by default) pandoc re-typeset EPUB attached to the book's existing record. Books with a usable text layer are left untouched.
Configuration: CALIBRE_OCR_PROVIDER (default "anthropic"), CALIBRE_OCR_API_KEY, CALIBRE_OCR_MODEL, CALIBRE_OCR_BASE_URL, CALIBRE_OCR_MAX_PAGES.
Args: book_id: Book whose PDF format should be OCR'd. typeset: Also build a re-typeset EPUB with pandoc (default True). import_format: Attach the EPUB to the book record (default True).
Inputs: book_id (required), typeset, import_format. Returns: object
ocr_scanned_booksA
OCR all scanned-PDF books in the library, in resumable batches.
Detects scanned books, skips any that already have OCR output cached,
and runs the full ocr_book pipeline (OCR → index → optional re-typeset
EPUB) on up to limit remaining books. Repeat the call to work through
the whole library; per-batch caching makes interruptions safe.
Args: limit: Maximum books to OCR in this call (1-100, default 10). typeset: Also build re-typeset EPUBs with pandoc (default True). import_format: Attach the EPUBs to book records (default True).
Inputs: limit, typeset, import_format. Returns: object
read_bookA
Read a page of a book's plain text, converted on demand by calibre.
The first call converts the book (a copy in a cache directory — the
library is never modified); later calls reuse the cache. Returns the
chunk plus next_offset for paging and total_chars for context.
Args: book_id: The book's id (find it with search_books). offset: Character offset to start reading from (0 = beginning). limit: Maximum characters to return (1-40000, default 12000).
Inputs: book_id (required), limit, offset. Returns: object
search_booksA
Search the library with calibre's query language.
Args:
query: A calibre search expression, e.g. author:asimov,
title:"i robot", tags:python. An empty string matches everything.
limit: Maximum number of results (1-200, default 20).
Inputs: query (required), limit. Returns: object
search_in_bookA
Full-text search inside book contents, with match snippets for quoting.
Searches the local text index; books must be indexed first with build_index (a one-time, cached step). Matching is substring-based, so Chinese and English queries both work without word segmentation.
Args: query: Text to find inside book contents. book_id: Optional book id to restrict the search to a single book. limit: Maximum number of matches to return (1-100, default 20).
Inputs: query (required), limit, book_id. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Most tools target distinct actions: metadata search, browsing, full-text search, reading, and OCR are clearly separated. Minor overlap exists between list_books (which accepts a search filter) and search_books, and between ocr_scanned_books and ocr_book, but descriptions clarify the batch-vs-single distinction.
The majority of tools follow a clear verb_noun pattern like search_books, add_books, build_index, and read_book. A few deviations stand out: library_info uses noun_info, search_in_book uses a preposition, and ocr_book/ocr_scanned_books use an acronym as the verb, but the overall style remains predictable.
Eleven tools is a well-scoped size for a Calibre-focused server covering library browsing, metadata search, book import, reading, full-text search, and OCR. Each tool addresses a distinct workflow without feeling bloated or redundant.
The toolset covers the core workflows thoroughly: discovering, searching, adding, reading, indexing, and OCR-ing books. Obvious gaps like metadata editing, book deletion, or retrieving original format files are absent, but they appear to be outside the server's intended reading/OCR-oriented scope.
Maintenance
Related MCP Connectors
AI assistant integration for Leaf — track books, log reading sessions, and manage your library.
Academic literature search, retrieval, and private library management on top of OpenAlex.
The media memory layer for AI agents and their humans. Your AI client can search your collection, add and log what you've finished, update ratings and lists, and find patterns across everything you've read, watched, played, and listened to.
Search photos and video moments by visual meaning, people, dates, and folders across local libraries, Apple Photos, and OneDrive. Manage collections, groups, favorites, people, and duplicate review. Synced metadata remains searchable while the desktop is offline; local and Apple Photos media access needs the owning device online with remote access enabled. OneDrive media can be accessed directly from the cloud. OAuth or Bearer API keys. Paid Cloud Access required; hosted visual search uses prepaid credits. Text-in-image search is semantic matching, not guaranteed exact OCR. Setup: https://organizewith.ai/en/guides/connect-ai-assistants
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI agents with research capabilities for local Calibre e-book libraries, including fulltext search across titles, ISBNs, and comments, plus structured excerpt retrieval from books.2GPL 3.0
- 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.725MIT
- 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.Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables read-only search, browsing, and metadata retrieval from a local Calibre e-book library using natural language queries.MIT