calibreweb-mcp

calibreweb-mcp

A read-only MCP server that connects to Calibre-Web ebook libraries via OPDS feeds, enabling AI assistants to search and browse books, shelves, covers, and library statistics.

Category
访问服务器

README

calibreweb-mcp

CI npm version node license container docs

A read-only Model Context Protocol server for Calibre-Web (and Calibre-Web Automated), the self-hosted ebook library web UI.

Calibre-Web has no REST API — its only stable machine-readable interface is the OPDS catalog feed it serves for e-reader apps. This server speaks that feed: Atom XML with HTTP Basic auth in, structured book data out. Search the library, browse the curated views and shelves, follow per-format download links, and pull cover images straight into the conversation. It never writes anything: every tool is a GET against the OPDS routes.

<!-- <picture> is resolved against the colour scheme of the page showing it, so GitHub picks the variant that matches its own theme toggle. npm strips <picture> and <source> when it sanitises the README and keeps the <img>, which is why that fallback brings its own dark card instead of relying on a media query. --> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://calibreweb-mcp.ni-c.de/architecture-dark.svg"> <source media="(prefers-color-scheme: light)" srcset="https://calibreweb-mcp.ni-c.de/architecture-light.svg"> <img src="https://calibreweb-mcp.ni-c.de/architecture.svg" alt="An MCP client speaks stdio to calibreweb-mcp, which reads the OPDS feed of Calibre-Web over HTTPS with Basic auth" width="800"> </picture>

<!-- Recorded with vhs from docs/demo.tape against the bundled fixture library (docs/demo-server.mjs) — no Calibre-Web instance needed to reproduce it. -->

Demo: listing the tools, searching the library and reading the stats through the MCP Inspector CLI

📖 Full documentation: calibreweb-mcp.ni-c.de

Requirements

  • Node.js 22 or newer
  • A Calibre-Web instance (developed against the current linuxserver/calibre-web image; Calibre-Web Automated works the same way)
  • A Calibre-Web user for the server. The OPDS feed authenticates with the normal web login — use a dedicated account with only the View and Download roles, not your admin account. If the instance allows anonymous browsing, the server can also run without credentials.

Configuration

Variable Required Description
CALIBRE_WEB_URL yes Root URL of the instance, e.g. https://books.example.com. The /opds path is appended automatically.
CALIBRE_WEB_USERNAME yes¹ Username of the Calibre-Web account.
CALIBRE_WEB_PASSWORD yes¹ Password of that account (the web login password).
CALIBRE_WEB_INSECURE_TLS no true to accept self-signed certificates — scoped to the configured host only.

¹ Leave both unset for an instance that allows anonymous browsing; setting only one of them is a configuration error.

Claude Code

claude mcp add calibreweb \
  -e CALIBRE_WEB_URL=https://books.example.com \
  -e CALIBRE_WEB_USERNAME=reader \
  -e CALIBRE_WEB_PASSWORD=... \
  -- npx calibreweb-mcp

Claude Desktop

{
  "mcpServers": {
    "calibreweb": {
      "command": "npx",
      "args": ["calibreweb-mcp"],
      "env": {
        "CALIBRE_WEB_URL": "https://books.example.com",
        "CALIBRE_WEB_USERNAME": "reader",
        "CALIBRE_WEB_PASSWORD": "..."
      }
    }
  }
}

Codex

[mcp_servers.calibreweb]
command = "npx"
args = ["calibreweb-mcp"]
env = { CALIBRE_WEB_URL = "https://books.example.com", CALIBRE_WEB_USERNAME = "reader", CALIBRE_WEB_PASSWORD = "..." }

Tools

All tools are read-only (readOnlyHint: true).

Tool Description
search_books Search by title, author, series, publisher and tags. Calibre-Web returns every match at once; the result is capped client-side (limit, default 50) and reports the real match count.
list_books Book listings by view: new (default), hot, rated, discover (random), read, unread, or all (optionally narrowed to an initial letter).
list_shelves Public shelves plus the configured user's own shelves.
get_shelf_books The books on a shelf, in shelf order.
get_cover A book's cover, returned as an image the client can display.
get_stats Total books, authors, categories and series.

Book entries include authors, tags, series (with index), rating, a bounded summary, a cover URL and per-format download URLs — ready-made links a human can open, since the model itself has no reason to download an EPUB.

Pagination

Feeds are paginated by the instance's books per page setting (default 60); the page size is not client-controllable. Every listing returns pagination.nextOffset when more pages exist — pass it as offset in the next call. The discover view is a random selection and not paginated.

Deliberately out of scope

  • No writes. The OPDS feed has none, and this server would not add any.
  • No file downloads. Tools return download URLs, not ebook payloads.
  • No facet browsing (authors/series/tags/publishers/languages/formats as their own index feeds). search_books covers those lookups; the routes exist and tools for them can be added if there is a real use case.

Safety

  • The server is read-only by construction — GET requests only, no state anywhere.
  • Book metadata is untrusted third-party data; every result says so, control characters are stripped, and XML entity processing is disabled (documents declaring a DOCTYPE or entities are refused outright).
  • Responses are bounded before parsing (8 MB feeds, 1 MB covers) and again before they reach the model (per-book and per-response budgets).
  • Feed hrefs are only passed through when they resolve to the configured origin over http(s) — a hostile feed cannot plant javascript:, file: or cross-origin URLs into the results.
  • Redirects are refused so the Basic credentials can never be replayed to another host; covers are only passed through for real image content types.
  • The password is scrubbed from the process environment at startup, and URLs are credential-redacted before they appear in any log or result.

Container

docker run -i --rm \
  -e CALIBRE_WEB_URL=https://books.example.com \
  -e CALIBRE_WEB_USERNAME=reader \
  -e CALIBRE_WEB_PASSWORD=... \
  ghcr.io/ni-c/calibreweb-mcp

Development

npm install
npm test            # unit tests against a stubbed OPDS feed, no instance needed
npm run lint
npm run build

See CONTRIBUTING.md.

Releasing

  1. Update CHANGELOG.md and bump the version in package.json (+ lockfile).
  2. npm run lint && npm run test:coverage && npm run build
  3. Tag the release: git tag -s vX.Y.Z -m "vX.Y.Z" && git push origin vX.Y.Z

License

MIT

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选