Skip to main content
Glama
calibre-mcp

calibre-mcp

by ZehuiTIAN

calibre-mcp

로컬 Calibre 전자책 라이브러리에 대한 읽기/쓰기 액세스를 AI 어시스턴트(Claude Code, Claude Desktop, Cursor 등)에 제공하는 MCP 서버입니다.

라이브러리 검색, 최근 추가 항목 찾아보기, 자동 중복 감지와 함께 새 전자책 가져오기, "드롭 폴더" 받은 편지함 관리까지 — 모두 채팅으로 처리하세요.

  • 일반적인 설정에서 구성 불필요: calibredb 실행 파일과 Calibre GUI가 사용하는 라이브러리는 macOS, Windows, Linux에서 자동으로 감지됩니다.

  • 로케일 독립적: 모든 읽기는 calibredb --for-machine(JSON)을 거치므로 결과가 Calibre 인터페이스 언어에 의존하지 않습니다.

  • 기본적으로 안전: 중복 감지는 Calibre 자체에 의존합니다. 제목+저자가 이미 라이브러리에 있는 책은 건너뛰고 두 번 가져오지 않습니다.

도구

도구

설명

library_info

라이브러리 경로, 책 수, calibre 버전

search_books

전체 calibre 쿼리 언어 검색(author:asimov, title:"i robot", tags:python, ...)

list_books

라이브러리 찾아보기, 기본값은 최근 추가된 순

add_books

중복 감지와 함께 전자책 파일 또는 전체 디렉터리 가져오기

import_inbox

받은 편지함 폴더의 모든 항목을 가져와 정리

Related MCP server: Calibre MCP Server

요구 사항

  • Calibre(calibredb를 제공하는 모든 버전, 9.x로 테스트됨)

  • Python ≥ 3.10

설치

pipx(권장)

pipx install calibre-mcp

uv

uv tool install calibre-mcp

pip

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

구성

일반적인 설정에서는 모든 것이 선택 사항입니다. 각 값은 환경 변수로 고정할 수 있습니다.

변수

의미

기본값

CALIBRE_LIBRARY_PATH

사용할 라이브러리 디렉터리

Calibre GUI가 사용하는 라이브러리(gui.json에서 가장 많이 사용된 라이브러리, 그 외에는 기본 라이브러리)

CALIBREDB_PATH

calibredb 실행 파일 경로

PATH의 calibredb, 그다음 플랫폼 설치 위치(macOS 앱 번들, C:\Program Files\Calibre2\)

CALIBRE_INBOX_DIR

import_inbox용 드롭 폴더

비활성화(사용 시 도구 오류 발생)

CALIBREDB_TIMEOUT

calibredb 호출이 중단되기까지의 시간(초)

300

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에 등록

claude_desktop_config.json(Claude Desktop) 또는 Cursor의 MCP 설정에 있는 MCP 서버 섹션에 동일한 JSON 블록을 추가하세요.

받은 편지함 워크플로

드롭 폴더는 손으로 다운로드한 책에 대해 "찾기 → 놓기 → 보관" 루프를 만들어 줍니다.

  1. CALIBRE_INBOX_DIR을 폴더(예: ~/Downloads/Calibre-Inbox)로 지정합니다.

  2. 해당 폴더에 전자책을 다운로드합니다.

  3. 어시스턴트에게 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.

주의 사항

  • 데이터베이스 잠금: Calibre GUI가 라이브러리를 열어 둔 동안에는 쓰기 작업(add_books, import_inbox)이 데이터베이스 잠금 오류로 실패할 수 있습니다. 읽기 전용 도구는 계속 작동합니다. 가져오기 전에 Calibre를 닫거나(또는 다른 라이브러리로 전환) 하세요.

  • 대용량 라이브러리: add_books/import_inbox는 각 추가 전에 전체 책 ID 집합의 스냅샷을 만듭니다. 실제로는 빠르지만 가져오기당 책 수에 비례하는 O(책 수)입니다.

  • 이 도구는 여러분의 라이브러리만 정리합니다. 검색이나 다운로드 기능은 포함되어 있지 않습니다. 보유할 권리가 있는 콘텐츠에 사용하세요.

개발

pip install -e ".[dev]"
ruff check .
pytest -m "not integration"      # unit tests, run anywhere
pytest                           # + integration tests (need local calibre)

통합 테스트는 /tmp 아래에 임시 라이브러리를 만들고 실제 라이브러리는 건드리지 않습니다.

라이선스

MIT — LICENSE를 참조하세요.


중국어 요약

로컬 Calibre 라이브러리를 Claude/Cursor 등의 AI 어시스턴트에 연결하는 MCP 서버: 다 가지 도구(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 tools
add_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

    A4.2/5.0

    Scored across 11 tools

    Disambiguation4/5

    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.

    Naming Consistency4/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides 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.
      2
      GPL 3.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables 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
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables read-only search, browsing, and metadata retrieval from a local Calibre e-book library using natural language queries.
      MIT