TC

trieloff/calibre-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

59 stars 4 forks 品質 64 トレンド 13Apache-2.0

ライブラリから書籍を検索し、読むためのMCPサーバー

概要

ライブラリから書籍を検索し、読むためのモデルコンテキストプロトコル(MCP)サーバー。 - 自動phraseマッチングとfuzzyフォールバック - または部分的なマッチング - キーワード強調とページネーションの本から - キャリバーブ CLIを使用して純粋なバッシュ実装 - キャリバーディープリンク(calibre://)とファイルURL(file://)を返す - macOSの互換性のための迅速なタイムアウト処理 - /Applications/calibre.appにインストールされたCalibreライブラリ - /Calibre Library - テキスト(.txt)は、抜粋機能のための書籍のエクスポート - Bash 4.0以降 MCPインスペクタを使用してサーバーをテストします。 Claudeデスクトップの設定に追加します。 Calibreのフルテキスト検索エンジンを使用して書籍を検索します。 - クエリ(必須):検索クエリ。 マルチワードのクエリは自動的にphrase-searched - limit(オプション): 最大結果(デフォルト:50) - fuzzy fallback(オプション): 正確な検索が失敗した場合、関連する用語でフォールバッククエリ 部分的なマッチングで著者名で検索します.

概要(AI 翻訳)

ライブラリから書籍を検索し、読むためのモデルコンテキストプロトコル(MCP)サーバー。

##特徴

  • 全文検索 自動フレーズマッチングとファジーフォールバック
  • 著者で検索 または** 部分的なマッチングで**
  • キーワード強調とペジネーションの本からテキスト抜粋を抽出する
  • [calibredb CLIを使用したピュアバッシュ実装
  • キャリバーディープリンク(calibre://)とファイルURL([file://])を返す
  • macOSの互換性のための強力なタイムアウト処理

前提条件

  • [/Applications/calibre.appにインストールされたキャリバー
  • [~/Calibre Libraryのライブラリ
  • テキスト(.txt)は、優れた機能性のための書籍のエクスポート
  • Bash 4.0以降

インストール

  1. このリポジトリをクローンする:

  2. スクリプトを実行可能にする:

使用法

##MCPインスペクターと####

MCPインスペクタを使用してサーバーをテストします。

##Claudeデスクトップ付き

Claudeデスクトップの設定に追加します。

利用可能なツール

##検索フルテキスト

Calibreのフルテキスト検索エンジンを使用して書籍を検索します。

パラメーター:

  • [query(必須):検索クエリ。 複数の単語のクエリは自動的にフレーズ検索されます
  • [limit (オプション): 最大結果 (デフォルト:50)

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

calibre-mcp

A Model Context Protocol (MCP) server for searching and reading books from your Calibre ebook library.

Features

  • Full-text search with automatic phrase matching and fuzzy fallback
  • Search by author or title with partial matching
  • Extract text excerpts from books with keyword highlighting and pagination
  • Pure bash implementation using calibredb CLI
  • Returns Calibre deep links (calibre://) and file URLs (file://)
  • Robust timeout handling for macOS compatibility

Prerequisites

  • Calibre installed at /Applications/calibre.app
  • A Calibre library at ~/Calibre Library
  • Text (.txt) exports of your books for excerpt functionality
  • Bash 4.0 or later

Installation

  1. Clone this repository:
git clone https://github.com/trieloff/calibre-mcp.git
cd calibre-mcp
  1. Make the script executable:
chmod +x calibre-mcp.sh

Usage

With MCP Inspector

Test the server using the MCP Inspector:

npx @modelcontextprotocol/inspector /path/to/calibre-mcp.sh

With Claude Desktop

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "calibre": {
      "command": "/path/to/calibre-mcp.sh"
    }
  }
}

Available Tools

search-fulltext

Search books using Calibre’s full-text search engine.

Parameters:

  • query (required): Search query. Multi-word queries are automatically phrase-searched
  • limit (optional): Maximum results (default: 50)
  • fuzzy_fallback (optional): Fallback query with related terms if exact search fails

Example:

{
  "query": "machine learning",
  "fuzzy_fallback": "AI artificial intelligence ML neural networks deep learning"
}

search-author

Search books by author name with partial matching.

Parameters:

  • author (required): Author name (partial match supported)
  • limit (optional): Maximum results (default: 50)

search-title

Search books by title with partial matching.

Parameters:

  • title (required): Book title (partial match supported)
  • limit (optional): Maximum results (default: 50)

get-excerpt

Extract text excerpts from books with keyword context.

Parameters:

  • book_id (required): Calibre book ID
  • keyword (optional): Search term to find in the book
  • context_lines (optional): Lines of context around matches (default: 10)
  • max_results (optional): Results per page (default: 10)
  • page (optional): Page number for pagination (default: 1)

Response Format

Search results include:

  • Book metadata (title, authors, series, tags, publisher)
  • Calibre deep link for opening in Calibre
  • File URL for direct EPUB access
  • Available formats
  • Whether text format is available for excerpts

Logging

The server logs all requests and responses to requests.log for debugging.

Limitations

  • Requires Calibre to be closed or may experience timeouts
  • Full-text search requires indexed books
GitHub で README 全文を見る

インストール

npx @modelcontextprotocol/inspector /path/to/calibre-mcp.sh
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "calibre": { "command": "/path/to/calibre-mcp.sh" } } }