/ 目錄 / 演練場 / ebook-mcp
● 社群 onebirdrocks ⚡ 即開即用

ebook-mcp

作者 onebirdrocks · onebirdrocks/ebook-mcp

將 Claude 指向你的 EPUB 和 PDF 書庫——以結構化形式取得元資料、目錄與章節內容,讓模型能精確引用與摘要。

ebook-mcp 將 Python 常見的 EPUB/PDF 函式庫封裝為 MCP 工具。不同於一般的「讀取檔案」,它暴露了目錄結構與章節邊界,讓 Claude 只需擷取你所詢問的特定章節,而非將 500 頁全部塞入上下文。

為什麼要用

核心特性

即時演示

實際使用效果

ebook.replay ▶ 就緒
0/0

安裝

選擇你的客戶端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "ebook": {
      "command": "uvx",
      "args": [
        "ebook-mcp"
      ],
      "_inferred": true
    }
  }
}

開啟 Claude Desktop → Settings → Developer → Edit Config。儲存後重啟應用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "ebook": {
      "command": "uvx",
      "args": [
        "ebook-mcp"
      ],
      "_inferred": true
    }
  }
}

Cursor 使用與 Claude Desktop 相同的 mcpServers 格式。專案級設定優先於全域。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "ebook": {
      "command": "uvx",
      "args": [
        "ebook-mcp"
      ],
      "_inferred": true
    }
  }
}

點擊 Cline 側欄中的 MCP Servers 圖示,然後選 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "ebook": {
      "command": "uvx",
      "args": [
        "ebook-mcp"
      ],
      "_inferred": true
    }
  }
}

格式與 Claude Desktop 相同。重啟 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "ebook",
      "command": "uvx",
      "args": [
        "ebook-mcp"
      ]
    }
  ]
}

Continue 使用伺服器物件陣列,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "ebook": {
      "command": {
        "path": "uvx",
        "args": [
          "ebook-mcp"
        ]
      }
    }
  }
}

加入 context_servers。Zed 儲存後熱重載。

claude mcp add ebook -- uvx ebook-mcp

一行命令搞定。用 claude mcp list 驗證,claude mcp remove 移除。

使用場景

實戰用法: ebook-mcp

尋找並引用模糊記得的段落

👤 讀者/研究人員 ⏱ ~5 min beginner

何時使用: 「那本書裡有段關於 X 的內容……」——你需要確切的引文,卻懶得翻頁查找。

前置條件
  • 磁碟上的書籍檔案 — EPUB 或 PDF
步驟
  1. 載入目錄
    Show me the TOC of ~/Books/deep-work.epub. Which chapter likely discusses shallow work vs deep work?✓ 已複製
    → 目錄+最可能的章節
  2. 擷取章節
    Get the text of chapter 3. Find the passage about shallow-work-as-default.✓ 已複製
    → 引用段落

結果: 2 分鐘內取得可引用的原文段落。

注意事項
  • 掃描版 PDF 沒有文字層 — 請先執行 OCR

逐章摘要一本技術書籍

👤 從待讀清單中學習的工程師 ⏱ ~30 min intermediate

何時使用: 你想判斷是否值得閱讀某本書,或讀完後需要複習重點。

步驟
  1. 先取得目錄
    Load TOC of book.pdf. Show me chapter titles and approximate page ranges.✓ 已複製
    → 章節大綱
  2. 逐章摘要
    For each chapter, load its content and produce a 3-bullet summary. Output as a single Markdown doc.✓ 已複製
    → 完整的書籍摘要文件

結果: 可分享或日後複習的 1-2 頁書籍精華。

注意事項
  • 一次載入所有章節會超出 token 預算 — 一次處理一章,並將中間摘要寫入磁碟
搭配使用: filesystem

稽核電子書庫的元資料

👤 Calibre 使用者、電子書收藏者 ⏱ ~15 min beginner

何時使用: 你的書庫有 500 本電子書,想找出缺少書名或作者元資料的檔案。

步驟
  1. 掃描
    For each .epub under ~/Books, get metadata. List any where title or author is missing or contains 'Unknown'.✓ 已複製
    → 元資料不完整的清單

結果: 快速完成元資料整理。

搭配使用: filesystem

組合

與其他 MCP 搭配,撬動十倍槓桿

ebook + local-rag

建立可搜尋的書庫索引

For each book, get_chapter by chapter, ingest into local-rag with book title as source.✓ 已複製
ebook + notion

自動填寫你的讀書筆記

Take this just-finished book; summarize each chapter; create a Notion page in 'Books Read'.✓ 已複製

工具

此 MCP 暴露的能力

工具輸入參數何時呼叫成本
get_metadata path: str 對任何書籍進行第一步操作 free
get_toc path: str 在擷取章節內容之前呼叫 free
get_chapter path, chapter_id or id_range 載入特定章節 free
get_pages path, from_page, to_page (PDF only) 用於 PDF 的頁面範圍擷取 free

成本與限制

運行它的成本

API 配額
None
每次呼叫 Token 數
章節約 2k-30k tokens,視長度而定
費用
免費(Apache 2.0)
提示
永遠先載入目錄,再逐章載入內容,而非一次載入整本書。

安全

權限、密鑰、影響範圍

憑證儲存: 無——僅使用本機檔案
資料出站: 書籍內容會傳送至你的 LLM 服務提供商

故障排查

常見錯誤與修復

Unable to parse PDF

掃描版或純圖片 PDF 沒有文字層,請先執行 ocrmypdf。

驗證: pdftotext input.pdf - | head
EPUB chapter ID not found

章節 ID 須與目錄完全一致,請先呼叫 get_toc。

Large PDF makes get_chapter timeout

改用 get_pages 並縮小頁面範圍,分批處理。

替代方案

ebook-mcp 對比其他方案

替代方案何時用它替代權衡
Calibre + custom script你需要完整的 Calibre 整合設定較複雜;沒有 MCP 封裝
pdfplumber / pymupdf directly你要自行開發工具需要自行實作 MCP 封裝

更多

資源

📖 閱讀 GitHub 上的官方 README

🐙 查看未解決的 issue

🔍 瀏覽全部 400+ MCP 伺服器和 Skills