Bookbind

io.github.CloudCorpRecords由 GitHub 帳號 CloudCorpRecords 發布v0.1.0更新於 Nov 7, 2026

EPUB and PDF ebook tools: merge, split, compress, convert, edit metadata, validate and covers.

已驗證STDIO僅桌面檔案與儲存媒體與設計

概覽

AI 產生的概覽

本機 stdio 橋接服務,把 EPUB 與 PDF 電子書操作(合併、拆分、壓縮、轉換、中繼資料、驗證、封面)轉送到託管的 Epublys 服務。

可以做什麼
  • 合併、拆分與壓縮 EPUB 檔案,支援依章節範圍拆分及清除未使用資源
  • 讀取與編輯 EPUB 中繼資料,如書名、作者、出版社、系列與封面
  • 在 EPUB、PDF、Markdown 與 Word 文件之間轉換,並以 Markdown 章節建立 EPUB3
  • 驗證 EPUB 的錯誤與規格符合度,可選擇自動修正
  • 依描述與類型產生 AI 書籍封面圖片
適用情境
適合讓助理整理、重構或轉換電子書檔案:合併多卷、拆分章節、修正中繼資料、產生 PDF 或 Markdown,或在出版前檢查檔案,而不必在本機安裝轉換工具。
執行需求
以本機程序執行,可透過 npx(需 Node.js)或 Docker 映像啟動;需要能連線到 Epublys 服務的網路。選用環境變數 EPUBLYS_API_KEY 會以 Bearer 權杖送出,選用 EPUBLYS_MCP_URL 可覆寫上游位址。檔案以 base64 內容傳入。
安裝前請注意
此套件本身不做處理:檔案內容會送到第三方 Epublys 服務,電子書檔案會離開你的電腦。免費額度有限(每檔案 5MB、每天 3 次操作、每分鐘 15 次請求、輸出帶品牌標示);Pro 為每月 9 美元,單次上限 30MB。若設定 API 金鑰,會轉送給上游。中繼資料編輯與轉換會回傳修改後的檔案。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Bookbind,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

bookbind

bookbind is a small local bridge to Epublys, a hosted service that works on EPUB and PDF ebooks: merging and splitting books, compressing them, converting between formats, editing metadata, checking a file for spec problems, and generating cover art. This package does none of that work itself. It stands in front of the service's remote MCP endpoint, presents the upstream tool list locally exactly as captured, and passes each call through, returning whatever the upstream returns.

That split matters in practice. The conversions, metadata edits and validation verdicts all come from Epublys' own machinery, so a result you get through bookbind is the service's result, not a local approximation. The bridge adds no processing of its own and rewrites nothing on the way back. Most tools take base64-encoded file content (file, or files for the multi-file tools) and return base64-encoded output; the upstream's own free-tier and Pro limits, as described in each tool's description, apply upstream.

Tools

This build serves a labelled subset of the captured surface: 12 of the 13 tools seen in the live capture. The omitted tool is upgrade_to_pro, which returns a checkout link so the user can upgrade their account to a paid tier; a payment funnel is out of scope for this program, so the tool is deliberately absent, and a test asserts that absence. The remaining tools are document operations, served verbatim — including epub_to_pdf, whose captured description carries the upstream's own Pro-tier language. This rebuild adds no payment or gating machinery of its own.

  • merge_epub — merge two or more EPUB files (files, required) into one ebook with a table of contents and chapter dividers; optional names, title, author and dividers.
  • split_epub — split one EPUB (file, required). With a chapter range (chapterStart / chapterEnd) the result is a single EPUB of exactly those chapters; without one it is a ZIP holding one EPUB per chapter.
  • compress_epub — shrink an EPUB (file, required), with a compression level from 1 to 9 and an option to strip unused assets.
  • read_epub_metadata — read an EPUB's metadata (file, required): title, author, language, publisher, description, series, cover status and more, returned as JSON.
  • edit_epub_metadata — edit metadata fields in an EPUB (file, required): title, author(s), language, publisher, description, series, subjects, ISBN, date, even a new cover image; returns the modified EPUB.
  • epub_to_pdf — convert an EPUB (file, required) to PDF, with page size, margins, font and page number options.
  • pdf_to_epub — convert a PDF (file, required) to an EPUB, with automatic chapter detection, chapter grouping modes and optional image extraction.
  • markdown_to_epub — build an EPUB3 ebook from Markdown files (files, required), one file per chapter in array order; understands YAML frontmatter and Obsidian wikilinks.
  • docx_to_epub — convert a Word document (file, required) to an EPUB3 ebook, splitting chapters on headings or page breaks and keeping formatting, lists, tables, images and footnotes.
  • epub_to_markdown — convert an EPUB (file, required) to Markdown: a ZIP with one file per chapter, an index, and the referenced images.
  • validate_epub — validate an EPUB (file, required) for errors, compatibility issues and spec compliance; returns JSON check results, with an optional deep scan and auto-fix.
  • generate_cover — generate an AI book cover image from a creative description and a genre, with optional title, author and seed. No argument is required by the captured schema, though the upstream expects a description or a title.

Configuration

  • EPUBLYS_MCP_URL (optional) — override the upstream endpoint. Defaults to https://epublys.com/mcp. (The override hook is this rebuild's own labelled reconstruction.)
  • EPUBLYS_API_KEY (optional) — when set, every upstream request carries Authorization: Bearer <key>. When it is not set, no auth header is sent, matching the keyless capture this rebuild is based on. (The header behaviour is a labelled reconstruction; the registry record declares an optional Authorization header for the remote, but the capture was taken without one.) Account-scoped behaviour is served upstream under the caller's own credential.

Forwarding mechanics

On the first tool call the client opens a streamable HTTP session upstream: a JSON-RPC initialize request (protocolVersion 2025-03-26, clientInfo name bookbind), then a notifications/initialized notification, then the tools/call request carrying the caller's arguments unchanged. When the upstream answers initialize with an Mcp-Session-Id header, that value rides on every later request, and the session is reused for the life of the process. Replies may arrive as plain JSON or as server-sent events; both are read, and the message with the matching id wins.

Successful upstream results pass through verbatim, including any isError flag the upstream sets and any extra fields it adds. Failures — a JSON-RPC error, a non-2xx status, an unreadable response, or a request that cannot be completed — come back as an isError result whose text starts with bookbind error: (this rendering is this rebuild's own labelled reconstruction).

CLI

Each tool is also a subcommand taking one JSON argument string (omit it for tools that take none):

bash
npx @reneturcios/bookbind read_epub_metadata '{"file":"<base64-epub>"}'npx @reneturcios/bookbind generate_cover '{"description":"a lighthouse at dusk","genre":"literary"}'npx @reneturcios/bookbind validate_epub '{"file":"<base64-epub>","deepScan":true}'npx @reneturcios/bookbind --version

Exit codes: 0 on success, 1 on an isError result, 2 on a usage error.

MCP server

bash
npx -y @reneturcios/bookbind mcp

MCP client config:

json
{  "mcpServers": {    "bookbind": {      "command": "npx",      "args": ["-y", "@reneturcios/bookbind", "mcp"]    }  }}

Docker

bash
docker run -i ghcr.io/cloudcorprecords/bookbinddocker run --rm ghcr.io/cloudcorprecords/bookbind --version

The container's default command is mcp, so the first form is a stdio MCP server; any other arguments reach the CLI normally.

Development

bash
npm installnpm run buildnpm testnpm run dev

The test suite runs entirely against a stubbed JSON-RPC upstream — no live network calls.

License

MIT — see LICENSE.

來源:README.md,提交 619c1d6

工具

12

merge_epub

Merge multiple EPUB files into a single ebook with table of contents and chapter dividers. Accepts 2+ base64-encoded EPUB files. Free tier: 5MB/file (10MB for pdf-to-epub, 15MB for split), 3 operations/day, 15 req/min, output includes Epublys branding. Pro ($9/mo): 30MB per operation, unlimited daily operations, 60 req/min, no branding. When a call is refused with daily_limited or a Pro-only error, call the `upgrade_to_pro` tool — it returns a checkout link to hand the user. Details: https://epublys.com/pricing

輸入參數files必填namestitleauthordividers

split_epub

Split an EPUB. With a chapter range (chapterStart and/or chapterEnd) the result is ONE base64-encoded EPUB of exactly those chapters, in order, with the book's metadata, a table of contents limited to them and the fonts and images they use. Without a range the result is a base64-encoded ZIP archive holding one EPUB per chapter. Free tier: 5MB/file (10MB for pdf-to-epub, 15MB for split), 3 operations/day, 15 req/min, output includes Epublys branding. Pro ($9/mo): 30MB per operation, unlimited daily operations, 60 req/min, no branding. When a call is refused with daily_limited or a Pro-only error, call the `upgrade_to_pro` tool — it returns a checkout link to hand the user. Details: https://epublys.com/pricing

輸入參數file必填namechapterEndchapterStartkeepMetadata

compress_epub

Compress an EPUB file to reduce its size. Can optionally strip unused assets (images, fonts not referenced by any chapter). Free tier: 5MB/file (10MB for pdf-to-epub, 15MB for split), 3 operations/day, 15 req/min, output includes Epublys branding. Pro ($9/mo): 30MB per operation, unlimited daily operations, 60 req/min, no branding. When a call is refused with daily_limited or a Pro-only error, call the `upgrade_to_pro` tool — it returns a checkout link to hand the user. Details: https://epublys.com/pricing

輸入參數file必填namelevelstripUnused

read_epub_metadata

Read metadata from an EPUB file (title, author, language, publisher, description, series, cover status, etc.). Returns JSON — no file output. Free tier: 5MB/file (10MB for pdf-to-epub, 15MB for split), 3 operations/day, 15 req/min, output includes Epublys branding. Pro ($9/mo): 30MB per operation, unlimited daily operations, 60 req/min, no branding. When a call is refused with daily_limited or a Pro-only error, call the `upgrade_to_pro` tool — it returns a checkout link to hand the user. Details: https://epublys.com/pricing

輸入參數file必填

edit_epub_metadata

Edit metadata fields in an EPUB file (title, author, language, publisher, description, series, cover image, etc.). Returns the modified EPUB. Free tier: 5MB/file (10MB for pdf-to-epub, 15MB for split), 3 operations/day, 15 req/min, output includes Epublys branding. Pro ($9/mo): 30MB per operation, unlimited daily operations, 60 req/min, no branding. When a call is refused with daily_limited or a Pro-only error, call the `upgrade_to_pro` tool — it returns a checkout link to hand the user. Details: https://epublys.com/pricing

輸入參數datefile必填isbnnamecovertitleauthorseriesauthorslanguagesubjectspublisher另有 2 個

epub_to_pdf

Convert an EPUB ebook to PDF. Supports page size, margins, font, and page number options. Pro ($9/mo) is strongly recommended for PDF conversion — the 30MB limit handles illustrated or academic books that exceed the free 5MB cap. Upgrade at https://epublys.com/pricing

輸入參數file必填namemarginsfontSizepageSizefontFamilypageNumbers

pdf_to_epub

Convert a PDF document to EPUB ebook format. Supports automatic chapter detection, image extraction (Pro), and custom chapter grouping. Free tier supports up to 10MB per PDF. Pro ($9/mo) is strongly recommended for PDF conversion — the 30MB limit handles most scanned or illustrated PDFs. Upgrade at https://epublys.com/pricing

輸入參數file必填namelanguagechapterModeextractImagespagesPerChapter

markdown_to_epub

Build a valid EPUB3 ebook from Markdown files — one file per chapter, in array order. Understands YAML frontmatter (title/author) and Obsidian [[wikilinks]]; cross-file .md links are rewritten to chapter links inside the book. No Pandoc required. Free tier: 5MB/file (10MB for pdf-to-epub, 15MB for split), 3 operations/day, 15 req/min, output includes Epublys branding. Pro ($9/mo): 30MB per operation, unlimited daily operations, 60 req/min, no branding. When a call is refused with daily_limited or a Pro-only error, call the `upgrade_to_pro` tool — it returns a checkout link to hand the user. Details: https://epublys.com/pricing

輸入參數files必填titleauthorlanguage

docx_to_epub

Convert a Word document (.docx) to a valid EPUB3 ebook. Chapters split on the document's top heading level (Heading 1 in a normal manuscript), or on page breaks, or not at all. Keeps bold/italic, lists, tables, inline images (PNG/JPEG/GIF/WebP), hyperlinks and footnotes; reads the title and author from the document's properties. No Pandoc, no Calibre. Free tier: 5MB/file (10MB for pdf-to-epub, 15MB for split), 3 operations/day, 15 req/min, output includes Epublys branding. Pro ($9/mo): 30MB per operation, unlimited daily operations, 60 req/min, no branding. When a call is refused with daily_limited or a Pro-only error, call the `upgrade_to_pro` tool — it returns a checkout link to hand the user. Details: https://epublys.com/pricing

輸入參數file必填nametitleauthorlanguagechapterMode

epub_to_markdown

Convert an EPUB ebook to Markdown. Returns a ZIP with one Markdown file per chapter (YAML frontmatter with title/book/author/chapter), an index.md with book metadata and a linked table of contents, and the referenced images. Plain CommonMark — drops straight into an Obsidian vault or any notes pipeline. Free tier: 5MB/file (10MB for pdf-to-epub, 15MB for split), 3 operations/day, 15 req/min, output includes Epublys branding. Pro ($9/mo): 30MB per operation, unlimited daily operations, 60 req/min, no branding. When a call is refused with daily_limited or a Pro-only error, call the `upgrade_to_pro` tool — it returns a checkout link to hand the user. Details: https://epublys.com/pricing

輸入參數file必填nameincludeImages

validate_epub

Validate an EPUB file for errors, compatibility issues, and spec compliance. Returns JSON with check results. Can optionally auto-fix common issues. Free tier: 5MB/file (10MB for pdf-to-epub, 15MB for split), 3 operations/day, 15 req/min, output includes Epublys branding. Pro ($9/mo): 30MB per operation, unlimited daily operations, 60 req/min, no branding. When a call is refused with daily_limited or a Pro-only error, call the `upgrade_to_pro` tool — it returns a checkout link to hand the user. Details: https://epublys.com/pricing

輸入參數file必填autoFixdeepScan

generate_cover

Generate an AI book cover image using FLUX. Describe your vision, pick a genre, and get a portrait JPEG cover — 768×1152 when the model honours the requested size, otherwise its default square. The AI enhances your prompt with professional composition guidance while preserving your creative vision. Pro only ($9/mo). Upgrade at https://epublys.com/pricing

輸入參數seedgenretitleauthordescription

版本歷史

1
  1. v0.1.0最新Nov 4, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分