Skip to main content
Glama
calibreweb-mcp

calibreweb-mcp

by ni-c

calibreweb-mcp

CI npm version node license container docs

読み取り専用の Model Context Protocol サーバーで、Calibre-Web(および Calibre-Web Automated)向けのものです。Calibre-Web はセルフホスト型の電子書籍ライブラリ Web UI です。

Calibre-Web には REST API はありません。唯一安定した機械可読インターフェースは、電子書籍リーダーアプリ向けの OPDS カタログフィードです。このサーバーはそのフィードを扱います:Atom XML で HTTP Basic 認証を受け付け、構造化された書籍データを出力します。ライブラリを検索し、キュレーションされたビューや棚をブラウズし、フォーマットごとのダウンロードリンクをたどり、カバー画像をそのまま会話に取り込めます。書き込みは一切行いません。すべてのツールは OPDS ルートへの GET リクエストです。

デモ: MCP Inspector CLI を使用してツールの一覧表示、ライブラリの検索、統計の読み取りを行っています

📖 完全なドキュメント: calibreweb-mcp.ni-c.de

必要条件

  • Node.js 22 以上

  • Calibre-Web インスタンス(現在の linuxserver/calibre-web イメージに対して開発済み。Calibre-Web Automated も同様に動作します)

  • サーバー用の Calibre-Web ユーザー。OPDS フィードは通常の Web ログインで認証します。管理者アカウントではなく、表示とダウンロードの権限のみを持つ専用アカウントを使用してください。インスタンスが匿名ブラウジングを許可している場合、サーバーは認証情報なしでも実行できます。

Related MCP server: access-calibre

設定

変数

必須

説明

CALIBRE_WEB_URL

はい

インスタンスのルート URL(例: https://books.example.com)。/opds パスは自動的に追加されます。

CALIBRE_WEB_USERNAME

はい¹

Calibre-Web アカウントのユーザー名。

CALIBRE_WEB_PASSWORD

はい¹

そのアカウントのパスワード(Web ログインパスワード)。

CALIBRE_WEB_INSECURE_TLS

いいえ

true に設定すると自己署名証明書を受け入れます。設定されたホストのみにスコープされます。

¹ 匿名ブラウジングを許可するインスタンスの場合は、両方を未設定のままにします。片方だけ設定すると設定エラーになります。

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 = "..." }

ツール

すべてのツールは読み取り専用です(readOnlyHint: true)。

ツール

説明

search_books

タイトル、著者、シリーズ、出版社、タグで検索します。Calibre-Web は一致するすべてを一度に返します。結果はクライアント側で上限(limit、デフォルト 50)が設定され、実際の一致数が報告されます。

list_books

ビューごとに書籍一覧を表示します:new(デフォルト)、hot、rated、discover(ランダム)、read、unread、all(オプションで先頭文字に絞り込み可能)。

list_shelves

公開棚と、設定されたユーザー自身の棚を表示します。

get_shelf_books

棚の本を棚の順序で取得します。

get_cover

本の表紙を、クライアントが表示できる画像として返します。

get_stats

書籍、著者、カテゴリ、シリーズの総数を表示します。

書籍エントリには、著者、タグ、シリーズ(インデックス付き)、評価、制限付きの要約、表紙 URL、フォーマットごとのダウンロード URL が含まれます。モデル自体が EPUB をダウンロードする理由はないため、人間が開ける準備済みのリンクです。

ページネーション

フィードはインスタンスの 1 ページあたりの書籍数 設定(デフォルト 60)でページネーションされます。ページサイズはクライアント側で制御できません。すべての一覧で、さらにページが存在する場合に pagination.nextOffset が返されます。次の呼び出しで offset として渡します。discover ビューはランダム選択であり、ページネーションされません。

意図的に範囲外

  • 書き込みなし。 OPDS フィードには書き込みがなく、このサーバーも追加しません。

  • ファイルダウンロードなし。 ツールはダウンロード URL を返しますが、電子書籍のペイロードは返しません。

  • ファセットブラウジングなし(著者/シリーズ/タグ/出版社/言語/フォーマットを個別のインデックスフィードとして)。search_books でそれらの検索をカバーします。ルートは存在し、実際のユースケースがあればツールを追加できます。

安全性

  • サーバーは設計上読み取り専用です。GET リクエストのみで、状態は一切持ちません。

  • 書籍メタデータは信頼できないサードパーティデータです。すべての結果にその旨が明記され、制御文字は削除され、XML エンティティ処理は無効化されています(DOCTYPE またはエンティティを宣言するドキュメントは完全に拒否されます)。

  • レスポンスは解析前に制限され(フィードは 8 MB、表紙は 1 MB)、さらにモデルに到達する前に制限されます(書籍ごと、レスポンスごとの予算)。

  • フィードの href は、設定されたオリジンに対して http(s) で解決される場合のみ通過します。悪意のあるフィードが javascript:、file:、またはクロスオリジン URL を結果に埋め込むことはできません。

  • リダイレクトは拒否されるため、Basic 認証情報が別のホストに再生されることはありません。表紙は、実際の画像コンテンツタイプの場合のみ通過します。

  • パスワードは起動時にプロセス環境から消去され、URL はログや結果に表示される前に認証情報が編集されます。

コンテナ

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

開発

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

CONTRIBUTING.md を参照してください。

リリース

  1. CHANGELOG.md を更新し、package.json(+ ロックファイル)のバージョンを上げます。

  2. npm run lint && npm run test:coverage && npm run build

  3. リリースにタグを付けます:git tag -s vX.Y.Z -m "vX.Y.Z" && git push origin vX.Y.Z

ライセンス

MIT

Available Tools

6 tools
get_coverGet a book coverA
Read-onlyIdempotent

Fetches the cover of a book and returns it as an image. Book ids come from the other tools (books with id null have no cover). Calibre-Web serves the full-size cover; images over 1 MB are refused to protect the context window — use the coverUrl from the book entry instead.

Inputs: book_id (required). Returns: bytes, bookId, mimeType

get_shelf_booksList books on a shelfA
Read-onlyIdempotent

Lists the books on a shelf, in the shelf’s own order. Shelf ids come from list_shelves. Book entries include per-format download URLs and a cover URL; fetch the cover image itself with get_cover.

Inputs: shelf_id (required), offset. Returns: books, notes, source, shelfId, +2 more

get_statsGet library statisticsA
Read-onlyIdempotent

Returns the total number of books, authors, categories (tags) and series in the library.

Inputs: no named parameters. Returns: books, series, authors, categories

list_booksList booksA
Read-onlyIdempotent

Lists books from one of the Calibre-Web views: new (recently added, default), hot (most downloaded), rated (best rated), discover (random selection), read / unread (per-user reading state), or all (the full library ordered by title, optionally narrowed to titles starting with a letter). Page size is a server-side setting; pass the returned pagination.nextOffset as offset to fetch the next page. The discover view is random and not paginated.

Inputs: view, letter, offset. Returns: view, books, notes, source, +2 more

list_shelvesList shelvesA
Read-onlyIdempotent

Lists the shelves visible to the configured user: every public shelf plus the user’s own private ones. Use the returned id with get_shelf_books. isPublic is only reported on English-locale instances (Calibre-Web marks public shelves with a localized title suffix).

Inputs: offset. Returns: notes, source, shelves, untrusted, +1 more

search_booksSearch booksA
Read-onlyIdempotent

Searches the library by title, author, series, publisher and tags. Calibre-Web returns every match in a single response, so broad queries on a large library are truncated client-side — totalFound reports the real match count. Book entries include per-format download URLs and a cover URL; fetch the cover image itself with get_cover.

Inputs: query (required), limit. Returns: books, notes, source, truncated, +2 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool targets a distinct operation: searching, listing views, listing shelves, fetching shelf contents, fetching covers, and retrieving library stats. Even the two book-listing tools are clearly separated by search vs. browse intent.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern: search_books, list_books, list_shelves, get_shelf_books, get_cover, get_stats. The naming style is uniform and predictable across the entire set.

    Tool Count5/5

    Six tools is well-scoped for a read-only Calibre-Web library interface. Each tool covers a meaningful slice of the domain without redundancy or bloat.

    Completeness4/5

    The core read-only workflows are covered: search, browse, shelves, covers, and stats. Minor gaps exist such as direct single-book lookup by ID and author/tag browsing, but book entries from search and list tools carry enough detail to work around them.

    Maintenance

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      An MCP server to manage and organize a Calibre ebook library, enabling metadata editing, search, conversion, and more through AI assistants.
      17
      5
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A local stdio MCP server that enables AI tools to search a self-hosted Calibre library over SSH, supporting metadata queries, full-text search, and book details.
      7
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that lets an LLM browse, search, and download books from OPDS catalogs (e.g., Project Gutenberg, Standard Ebooks) using tools for feed navigation, full-text search, and acquisition link downloads.
      4
      1
      AGPL 3.0