# calibremcp [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/sandraschi/calibremcp  
**GitHub Stars:** 52  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/calibremcp

## Description
Calibre library automation via FastMCP — metadata, shelves, RAG, ai workflows. Plus webapp and tauri rust winapp

## Tools
Capabilities this server exposes over MCP:

- **manage_libraries** — Unified interface for Calibre library management and discovery.

PORTMANTEAU PATTERN RATIONALE:
Consolidates library listing, switching, stats, search, and discovery into a single interface.
Prevents tool explosion while maintaining full library lifecycle control.

OPERATIONS:
- list: List all discovered libraries with metadata and active status.
- switch: Change the active library for the current session.
- stats: Detailed book/author/format metrics for a library.
- search: Search for books across multiple libraries simultaneously.
- test_connection: Diagnostic check for library accessibility.
- discover: Scan filesystem/CLI to find new Calibre libraries.

Returns:
FastMCP 3.1+ dialogic response: success, operation, result or error,
recommendations, next_steps, and execution_time_ms.
Enables conversational follow-ups for library navigation.
- **search_fulltext** — Search inside book content (full text) using Calibre's FTS database.

Requires Calibre to have built the full-text index (full-text-search.db).
Searches actual book text, not just metadata.

Examples:
- search_fulltext(query='"machine learning"', limit=10)
- search_fulltext(query="vacuum", resolve_locations=True)
- **manage_books** — Unified interface for book CRUD operations in Calibre.

PORTMANTEAU PATTERN RATIONALE:
Consolidates book addition, retrieval, metadata updates, and deletion into a single tool.
Simplifies book lifecycle management and reduces tool discovery overhead for agents.

OPERATIONS:
- add: Add a new book from file (requires file_path). Supports convert_to.
- get: Retrieve basic book info by book_id.
- details: Get full metadata and file information by book_id.
- update: Update book metadata; convert_to converts the book to that format
  (e.g. convert_to='EPUB') and registers the new file in the library.
- delete: Remove a book from the library.

Returns:
FastMCP 3.1+ dialogic response: success, operation, result or error,
recommendations, next_steps, and execution_time_ms.
Enables iterative refinement of book metadata and library content.
- **query_books** — Query and search books in the Calibre library with comprehensive filtering.

PORTMANTEAU PATTERN RATIONALE:
Consolidates full-text search, metadata filtering, and collection listing into a single entry point.
Optimizes for both precision (SQL) and discovery (recent/by_author) search patterns.

OPERATIONS:
- search: Find books with flexible filters (author, tag, text, title, rating, dates, formats).
         Pass has_no_tags=True to find books with no tags at all.
- list: List all books in library (pagination only). Pass has_no_tags=True to list only untagged books.
- recent: Get recently added books.
- by_author: Get books by specific author_id.
- by_series: Get books in a series by series_id.

SEARCH SCOPE:
By default operation='search' matches metadata only (title, author, series, tags).
To also match inside book text, either use the dedicated search_fulltext tool, or pass
use_content_fts=True here to opt this tool's `text`/`query` into the Calibre full-text
index (full-text-search.db) when one exists.

Returns:
FastMCP 3.1+ dialogic response: success, operation, result or error,
recommendations, next_steps, and execution_time_ms.
Enables deep discovery and iterative filtering of library content.
- **manage_authors** — Comprehensive author management for Calibre.

Operations:
- list: List authors with filtering (query) and pagination.
- get: Get detailed author information and book counts.
- get_books: Get all books by a specific author.
- stats: Library-wide author statistics (top authors, distributions).
- by_letter: Filter authors by their name's first letter.

Example:
- manage_authors(operation="list", query="martin")
- manage_authors(operation="get_books", author_id=42)
- **manage_series** — Comprehensive series management for Calibre.

Operations:
- list: List series with filtering and pagination.
- get: Get series details by ID.
- get_books: Get all books in a series.
- stats: Library-wide series statistics.
- by_letter: Filter series by first letter.

Example:
- manage_series(operation="list", query="foundation")
- manage_series(operation="get_books", series_id=12)
- **manage_tags** — Comprehensive tag management for Calibre.

Operations:
- list: List tags with filtering, sorting, and pagination.
- get: Get tag details by ID or name.
- create: Create a new tag.
- update: Rename an existing tag.
- delete: Delete a tag from the library.
- find_duplicates/merge: Tag weeding and consolidation.
- get_unused/delete_unused: Cleanup of orphaned tags.
- statistics: Tag usage metrics.

Examples:
- manage_tags(operation="list", search="mystery", sort_by="book_count")
- manage_tags(operation="find_duplicates", similarity_threshold=0.9)
- **manage_publishers** — Comprehensive publisher management for Calibre.

Operations:
- list: List publishers with filtering and pagination.
- get: Get detailed publisher information by ID or name.
- get_books: Get all books assigned to a specific publisher.
- stats: Library-wide publisher statistics (top publishers).
- by_letter: Filter publishers by first letter of their name.

Example:
- manage_publishers(operation="list", query="penguin")
- manage_publishers(operation="get_books", publisher_name="Tor Books")
- **manage_comments** — Comprehensive comment management for Calibre books.

Operations:
- create: Create a new comment (fails if exists).
- read: Retrieve existing comment text for a book.
- update / replace: Overwrite existing comment (upserts).
- delete: Remove the comment (sets to empty).
- append: Add text to the end of an existing comment with a newline.

Example:
- manage_comments(operation="create", book_id="123", text="Initial review.")
- manage_comments(operation="append", book_id="123", text="Update: still loving it.")
- **manage_metadata** — Comprehensive metadata management for Calibre.

Operations:
- update: Bulk update fields (title, tags, rating, etc.) for multiple books.
- organize_tags: AI-powered tag organization and cleanup suggestions.
- fix_issues: Automatically fix common metadata inconsistencies.
- show: Display deep metadata for a book in a formatted view/browser.
- rate_batch: Set ratings for multiple books at once.

Example:
- manage_metadata(operation="update", updates=[{"book_id": 12, "field": "rating", "value": 5}])
- manage_metadata(operation="show", query="Gormenghast")
- **manage_files** — Comprehensive book file management and format conversion.

Operations:
- convert: Transform books between formats (EPUB, PDF, AZW3, etc.).
- download: Retrieve the local filesystem path for a specific book format.
- bulk: Perform mass validation, cleanup, or conversion across multiple IDs.

Example:
- manage_files(operation="download", book_id=123, format_preference="PDF")
- manage_files(operation="convert", conversion_requests=[{"book_id": 45, "target_format": "EPUB"}])
- **manage_viewer** — Comprehensive book viewer and reading interaction interface.

Operations:
- open: Initialize a viewer session and retrieve initial book data.
- get_page: Fetch specific page content, dimensions, and text.
- get_metadata: Detailed book metrics required for rendering (page count, etc.).
- get_state / update_state: Sync reading progress, zoom, and orientation.
- close: Terminate a viewer session and release memory.
- open_file: Launch the book in the system's default external application.
- open_random: Search and automatically open a random book matching filters.

Example:
- manage_viewer(operation="open_file", book_id=123)
- manage_viewer(operation="get_page", book_id=123, page_number=5)
- **manage_times** — Query books by date: added (timestamp) or published (pubdate/edition).

- timestamp = when book was added to Calibre library
- pubdate = edition publication date

SUPPORTED OPERATIONS:
- added_in_range: Books added between added_after and added_before
- published_in_range: Books with pubdate in range
- recent_additions: Most recently added books
- stats_by_month_added: Count per month (added)
- stats_by_month_published: Count per month (pubdate)
- date_stats: Summary (earliest/latest dates)
- **manage_bulk_operations** — Comprehensive bulk operations tool for CalibreMCP.

PORTMANTEAU PATTERN RATIONALE:
Instead of creating multiple separate tools, this tool consolidates related
bulk operations into a single interface. This design:
- Prevents tool explosion while maintaining full functionality
- Improves discoverability by grouping related operations together
- Reduces cognitive load when working with bulk tasks
- Enables consistent bulk interface across all operations
- Follows FastMCP 2.13+ best practices for feature-rich MCP servers

SUPPORTED OPERATIONS:
- update_metadata: Update metadata for multiple books in bulk
- export: Export multiple books to a specified location
- delete: Delete multiple books from the library
- convert: Convert multiple books to a different format

OPERATIONS DETAIL:

update_metadata: Bulk update metadata
- Updates metadata fields for multiple books simultaneously
- Processes books in batches to prevent system overload
- Parameters: book_ids (required), updates (required), batch_size (default: 10)

export: Bulk export books
- Exports multiple books to a specified location
- Supports directory and zip formats
- Parameters: book_ids (required), export_path (required), format (default: "directory")

delete: Bulk delete books
- Deletes multiple books from the library
- Optionally deletes associated files
- SAFE BY DEFAULT: dry_run defaults to True (unlike single-book delete),
  because bulk delete's blast radius is much larger. Pass dry_run=False
  explicitly to actually delete.
- Parameters: book_ids (required), delete_files (default: True),
  dry_run (default: True; when True, reports what would be removed for
  every book_id without deleting anything)

convert: Bulk convert books
- Converts multiple books to a different format
- Parameters: book_ids (required), target_format (required), output_path (optional)
- **manage_analysis** — Advanced library analytics and metadata auditing interface.

Operations:
- tag_statistics: Usage frequency and consolidation suggestions.
- duplicate_books: Find potential content duplicates via fuzzy matching.
- series_analysis: Detect missing volumes and sequence gaps.
- library_health: Audit metadata integrity and file consistency.
- unread_priority: Quantitative prioritization of the reading queue.
- reading_stats: Temporal trends and genre distribution analytics.
- quick_rate: Return unrated books for batch rating workflows.
- format_inventory: Per-book format counts for cleanup planning.

Example:
- manage_analysis(operation="library_health")
- manage_analysis(operation="duplicate_books")
- **manage_library_operations** — Unified interface for bulk library-level book and series operations.

Operations:
- analyze_series: Identify missing volumes, duplicates, or gaps in series numbering.
- fix_series_metadata: Automatically repair series numbering and naming issues.
- merge_series: Consolidate one series into another (useful for duplicates).
- list_books: Advanced library-wide book listing with multi-field filtering.

Example:
- manage_library_operations(operation="analyze_series", update_metadata=False)
- manage_library_operations(operation="list_books", author="Tolkien", limit=10)
- **export_books** — Export book metadata and library statistics to various professional formats.

Operations:
- csv: Excel-compatible metadata export with custom fields.
- json: Complete metadata dump for data exchange or backup.
- html: Standalone styled catalog, gallery, or dashboard views.
- pandoc: Professional document conversion (DOCX, PDF, EPUB, RTF, etc.).
- stats: Library-wide analytics exported to CSV, JSON, or HTML.

Example:
- export_books(operation="csv", author="Agatha Christie")
- export_books(operation="pandoc", format_type="docx", tag="mystery")
- **manage_import** — Import books from various sources.

SUPPORTED OPERATIONS:
- duplicate_check: Check the local library for existing books matching a title/author.
- from_path: Add book from local file path
- from_url: Download book from URL and add
- annas_search: Search Anna's Archive
- annas_download: Download from Anna's by MD5
- gutenberg_search: Search Project Gutenberg
- gutenberg_import: Download and add from Gutenberg
- arxiv_search: Search arXiv research papers
- arxiv_import: Download and add from arXiv

ANTI-DUPLICATE:
- Use duplicate_check(title=..., author=...) before any import to review existing matches.
- Set check_duplicates=True on import operations to auto-skip when a high-confidence
  match already exists in the local library.
- **show_api_docs** — Return Swagger UI, ReDoc, and OpenAPI schema URLs for the calibre-mcp REST API.

Rationale: The calibre-mcp webapp backend exposes a full FastAPI surface with 20+
tagged endpoint groups. This tool surfaces the docs URLs so Claude can direct the
user to the right place without them needing to remember the port.

Returns: dict with swagger_ui, redoc, openapi_json URLs and a usage note.
- **manage_system** — Administrative and diagnostic interface for the Calibre MCP server.

Operations:
- help: Comprehensive documentation for the server and its capabilities.
- status: Real-time system health, database statistics, and connectivity diagnostics.
- tool_help: Targeted usage instructions and examples for a specific tool.
- list_tools: Catalog of all available operations organized by category.
- hello_world: Simple reachability test and server identity confirmation.
- health_check: Deep-dive diagnostic for database and service integrity.

Example:
- manage_system(operation="status", focus="library")
- manage_system(operation="tool_help", tool_name="manage_books")
- **help_tool** — Help and orientation for CalibreMCP tools.
- **manage_rag** — Unified RAG interface for semantic search over Calibre book content and metadata.

Two LanceDB indexes (both stored inside the active library directory):
- lancedb/books_rag       — FTS content chunks (fts_index_build / fts_retrieve)
- lancedb_metadata/       — book metadata     (metadata_index_build / metadata_search)

Operations:
- fts_index_build: Submit a background job to build the FTS content index. Returns job_id.
- fts_retrieve: Semantic 'trope/scene' search over book passages.
- metadata_index_build: Submit a background job to build the metadata index. Returns job_id.
- metadata_search: Semantic search over book metadata (e.g. 'Japanese mystery').
- status: Row counts for both real indexes (no embedding model loaded).
- job_status: Poll background job status (job_id required).
- list_jobs: List recent background jobs.

Parameters:
- query: Search query (fts_retrieve, metadata_search)
- top_k: Number of results to return (default 10)
- force_rebuild: Wipe and rebuild index (fts_index_build, metadata_index_build)
- use_ollama: Accepted for back-compat; embeddings always use fastembed (no-op)
- enrich: Add book title/authors to passage results (fts_retrieve)
- book_ids: Comma-separated Calibre IDs to filter (fts_retrieve)
- formats: Comma-separated format codes to filter, e.g. "EPUB,MOBI" (fts_retrieve)
- job_id: Background job ID to poll (job_status)

Examples:
- manage_rag(operation="fts_index_build")   → {"job_id": 1, "status": "pending"}
- manage_rag(operation="job_status", job_id=1)  → {"status": "done", ...}
- manage_rag(operation="fts_retrieve", query="murder with an icicle")
- manage_rag(operation="metadata_index_build")
- manage_rag(operation="metadata_search", query="Japanese mystery light novels")
- manage_rag(operation="status")
- **calibre_metadata_export_json** — Export all library metadata to JSON for external RAG or bulk processing.

Writes one JSON object per book (title, authors, tags, series, comments, identifiers)
to a file alongside the library's metadata.db (or output_path if specified).
Useful for ingestion into external vector DBs, full-text search engines, or analytics.

Parameters:
- output_path: Destination file (default: <library>/calibre_mcp_metadata_export.json)
- strip_html: Remove HTML tags from comments/descriptions (default: True)

Example:
- calibre_metadata_export_json()
- calibre_metadata_export_json(output_path="/tmp/my_library.json")
- **manage_recommendations** — Book recommendations from the manage_rag metadata index (no model load).

Operations:
- similar_books: "More like this" — nearest neighbours of one book (book_id required).
- for_you: Personal picks from your taste profile (books rated >= min_rating stars
  and/or marked read), excluding everything you already read or rated.
- discover: Hidden gems — unread, unrated books added at least min_age_days ago,
  ranked by similarity to your taste profile.

Parameters:
- book_id: Seed book for similar_books
- top_k: Number of recommendations (default 10, max 50)
- exclude_read: Skip books marked read (similar_books; default True)
- min_rating: Star threshold for taste seeds, 1-5 (for_you/discover; default 4)
- include_rated / include_read: Which taste signals to use (default both)
- min_age_days: Minimum age of a "hidden gem" in days (discover; default 180)

Requires the metadata index: manage_rag(operation='metadata_index_build').

Examples:
- manage_recommendations(operation="similar_books", book_id=42)
- manage_recommendations(operation="for_you", top_k=20)
- manage_recommendations(operation="discover", min_age_days=365)
- **show_book_prefab_card** — Show a rich book card (MCP App) with title, authors, series, tags, comment excerpt, and cover.

Works in clients that render MCP Apps / Prefab (e.g. Claude Desktop; Cursor when supported).
Disable with ``CALIBRE_PREFAB_APPS=0`` (skips registration).
- **show_libraries_prefab_card** — Show an "Our Calibre" card (MCP App): all discovered libraries with book counts, size, active flag, paths.

Uses the same discovery as ``manage_libraries(operation='list')``.
Disable with ``CALIBRE_PREFAB_APPS=0`` (skips registration).

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "calibremcp": {
    "command": "uvx",
    "args": ["--from","calibremcp","schip-mcp-calibre"],
    "env": {
      "CALIBRE_LIBRARY_PATH": ""
    }
  }
}
```

**Requires environment variables:** `CALIBRE_LIBRARY_PATH` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What calibremcp does

calibremcp gives MCP-compatible AI clients access to a Calibre library. It reads Calibre’s `metadata.db` directly and exposes operations for discovering, inspecting, and organizing books. The project is designed around natural-language library tasks such as finding unread science-fiction titles, opening a random book by an author, or checking overall library health.

Its capabilities extend beyond basic metadata lookup. The backend supports hybrid search, retrieval-augmented generation, library health scans, duplicate-book candidate clustering, and dynamic virtual shelves. It also includes workflows intended for agentic chaining, allowing an assistant to combine several library operations into a larger task.

## How it works

The MCP backend is built with FastMCP and includes a FastAPI layer for REST access and background work. MCP clients communicate with the server over standard input and output, while the web application communicates with the backend through REST and server-sent events.

Search combines Calibre’s FTS5-based lexical index with vector retrieval from LanceDB through reciprocal rank fusion. Metadata can be incrementally synchronized into the RAG index. Local embedding support uses fastembed with the BAAI/bge-small model, and AI workflows can use Ollama or OpenAI providers.

The repository also contains a Next.js web app backed by the same FastAPI service. It runs separately from Calibre’s own content server: Calibre continues to provide its native catalog, OPDS support, and browser reading features, while CalibreMCP focuses on AI-assisted discovery and maintenance.

## Setup and configuration

Windows users can install the packaged application by downloading the `Calibre MCP_*_x64-setup.exe` file from the project’s Releases page and launching it. Claude Desktop users can install the MCPB bundle through the client’s MCP server settings.

A source-based setup uses the repository’s `just sync` command followed by `just start-webapp`. For an MCP client configuration, run the server with `uv run calibre-mcp` and set `CALIBRE_LIBRARY_PATH` to the directory containing the Calibre library. The example configuration uses a Windows path, but the variable should point to the appropriate library location on the host system.

The web app uses port 10721 and the backend uses port 10720 in the documented architecture. It binds to loopback by default when started with `start.ps1`; the LAN startup script can expose it to a local network or Tailscale environment. Because the LAN mode has no authentication, use it only on a trusted network.

## Tools and capabilities

The MCP interface groups library operations into portmanteau tools covering:

- Calibre metadata access and library management
- Lexical, semantic, and hybrid book search
- LanceDB-backed RAG indexing and incremental synchronization
- Library health checks and maintenance workflows
- Duplicate candidate detection
- Dynamic virtual shelves
- Agentic workflows and chained operations

The web app adds a conversational AI librarian interface, book-cover browsing, faceted filtering, detail views, and embedded reading overlays. These web features complement rather than replace Calibre’s content server.

## Limitations and notes

Direct catalog access depends on a usable Calibre library and its SQLite metadata database. The project is primarily presented for Windows installation, with a Python source workflow for developers. LAN or Tailscale access to the web app does not include authentication, so it should not be exposed beyond a trusted network.

CalibreMCP and the Calibre content server serve different purposes. Calibre’s server remains the component for native distribution, OPDS access, and its built-in browser reader; CalibreMCP supplies the MCP tools, AI search, RAG, and maintenance features.

_Full upstream README: https://allmcps.com/mcp/calibremcp/readme_

