Calibre MCP Server

Calibre MCP Server

Connects 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.

Category
访问服务器

README

Calibre MCP Server

This MCP server bridges the gap between AI agents and your Calibre ebook libraries. It enables agents to interact with your collection as a dynamic knowledge base, allowing them to search, manage, and read your digital libraries. Unlike other MCP servers it can also allow an AI agent to update library metadata and contents if a library's permissions are set to allow it.

Key Features

  • Advanced Search: Query libraries using book metadata or perform full-text content searches.

  • Metadata Management: View and update metadata (titles, authors, tags, ratings, etc.) for any book.

  • Library Maintenance: Add new titles to your collection or remove existing ones.

  • Format Conversion: Leverage Calibre’s powerful conversion engine to switch between ebook formats (e.g., PDF to EPUB) on the fly.

  • Direct Reading: Search and read the text content of a book directly into the agent's context window for analysis, summarization, or Q&A.

  • Granular Permissions: Define strict access controls per library, including read-only modes and field-level write restrictions.


Prerequisites

  • Calibre: Must be installed on the host system. This server utilizes calibre-debug to execute worker processes.

  • Concurrency Note: Calibre does not support concurrent access to a single library. Do not point an agent to a library currently being used by the Calibre desktop application or other processes to avoid database corruption.


Configuration

The server is configured via a JSON file. Since JSON does not support comments, use the structure below as a template.

Example Configuration (config.json)

JSON

{
    "libraries": {
        "default": {
            "path": "d:/ebooks/main_library",
            "description": "The primary research library containing technical manuals.",
            "default": true,
            "permissions": {
                "read": ["title", "authors", "tags", "rating", "comments"],
                "write": ["tags", "rating", "comments"],
                "delete": false,
                "convert": true
            },
            "import": {
                "allowed_paths": ["d:/downloads/ebook_imports"],
                "allow_delete_source": false
            },
            "export": {
                "allowed_paths": ["d:/ebook_exports"s],
                "allow_overwrite_destination": false
            }
        }
    },
    "port": 8000,
    "enable_worker_logging": false,
    "expose_resources_via_tools": true,
    "log_level": "warning"
}

Configuration Schema Reference

Each library is identified by a unique text key and can have its own separate configuration values:

Key Description
path Absolute path to the Calibre library (where metadata.db resides).
description Free-form context provided to the agent explaining what this library contains or what its purpose is.
default If true, the agent uses this library if no specific library is targeted. If you only configure one library then this is unnecessary.
permissions.read Set to true (all fields exposed), false (for a write-only library, if you need one), or a list of specific fields (e.g., ["title", "authors"]).
permissions.write List of metadata fields the agent is allowed to modify, true for all fields and false for a read-only library.
permissions.delete Boolean. If false, the agent cannot delete books from the library.
permissions.convert Boolean. Allows the agent to add new formats to a book record by converting existing ones. If false the server can still convert books for internal use or export, but it won't add the converted files to library book records.
import.allowed_paths A whitelist of directories from which the agent can import new files.
import.allow_delete_source If true, the server can delete the original file after a successful import.
export.allowed_paths A whitelist of directories the agent can export book files to.
export.allow_overwrite_destination If true, the server can overwrite files in the allowed export paths when it exports files there.

There are also several top-level configuration settings that apply to the MCP server as a whole:

Key Description
port The port the server is exposed on.
enable_worker_logging Each Calibre library has its own calibre-debug process that  runs code to intereact with the internal Calibre API. When true these processes will write logs to the logs folder for debugging purposes.
log_level Sets what minimum level of logging message will be recorded in logs/app.log. Set to "error", "warning", "info", "debug" or "none".
expose_resources_via_tools Some older MCP clients don't understand the "resources" type that this server exposes, for example to allow the agent to read the contents of the /skills folder. When this setting is true those resources will be exposed via list_help_topics and get_help_topic instead. The libraries resource listing the available libraries and their permissions will also be converted into a list_libraries tool.

Example MCP Configuration

Point to the above configuration file with the CALIBREMCP_CONFIGPATH environment variable in your MCP configuration. For example:

JSON

{
    "mcpServers": {
        "calibre": {
            "command": "python",
            "args": [
                "<full path>/calibre_full_mcp/src/server.py"
            ],
        "env": {
            "PYTHONPATH": "<full path>/calibre_full_mcp/src",
            "CALIBREMCP_CONFIGPATH": "<full path>/calibre_full_mcp/config.json"
            }
        }
    }
}

This should allow you to easily switch library configurations as needed for different agents by selecting which configuration to point CALIBREMCP_CONFIGPATH at.


Pro-Tips for Better Performance

1. Optimize Field Access

Calibre libraries often contain internal metadata that can clutter an agent's context window. It is highly recommended to use a specific list for read permissions. Only expose fields the agent actually needs (e.g., title, author, tags, comments).

2. Custom Fields & Series

  • Custom Fields: If you use custom columns in Calibre, you must include the # prefix (e.g., #my_custom_field).

  • Series: Every series field has a corresponding series_index. Ensure both are included in your permissions list if you want the agent to see or manage book order within a series.

  • Descriptions: The server passes custom field "descriptions" to the agent. Use these in Calibre to give the agent hints on how to use specific custom columns. For example if you create a custom field for a book's "age rating"" you could use the description to explain what the values of that field represent.

3. Resource Exposure

If your agent does not yet support the @mcp.resources standard, set expose_resources_via_tools to true. This will expose dedicated tools that allow the agent to fetch files via standard tool calls.


Architecture

For a deep dive into how this server manages worker processes and interacts with the Calibre database, please refer to the Architecture Documentation.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选