Skip to content

ebook-rs Documentation

Pure Rust multi-format eBook engine (EPUB, MOBI, AZW3, KFX, FB2, LIT, CBZ, PDF, DOCX, RTF) featuring Readium CFI/LCP, AI RAG BM25 chunking, zero-alloc SIMD search, Python/WASM bindings, and native Model Context Protocol (MCP) server.

⚑ 10-20Γ— Faster than Calibre

Empirical conversion benchmarks show 19.4Γ— faster DOCX, 9.4Γ— faster AZW3, and 10.4Γ— faster KFX parsing with zero memory leaks.

πŸ€– AI RAG & MCP Server

Built-in Model Context Protocol (MCP 2024-11-05) stdio & HTTP servers with Okapi BM25 relevance ranking and CFI citations for Claude, Cursor, and Antigravity.

πŸ“‚ 12+ Universal Formats

Native support for EPUB 2/3 (FXL), MOBI, AZW3 (KF8), KFX (Clean-Room), FB2, LIT, CBZ, PDF (Reflow), DOCX, RTF, and Markdown.

🌐 Polyglot SDKs

Seamless bindings for Rust, Python (pip install ebook-rs), WebAssembly / TypeScript (npm i @sv-stark/ebook-rs), and UniFFI (Swift/Kotlin).


Empirically measured conversion benchmark converting sample eBook corpora to EPUB 3 on AMD Ryzen 9 / PCIe 4.0 NVMe:

Input Format Sample Book πŸš€ ebook-rs (v0.16.4) 🐍 Calibre ebook-convert Speedup Image Assets Extracted Chapter Sections Output Parity
MOBI β†’ EPUB Alice in Wonderland (MOBI) 0.34s ⚑ 2.23s 6.5Γ— Faster 38 / 38 (100%) βœ… 17 chapters Fully Matched
AZW3 (KF8) β†’ EPUB Alice in Wonderland (AZW3) 0.22s ⚑ 2.03s 9.4Γ— Faster 38 / 38 (100%) βœ… 14 chapters Fully Matched
FB2 β†’ EPUB Alice in Wonderland (FB2) 0.18s ⚑ 1.66s 9.1Γ— Faster 37 / 37 (100%) βœ… 15 chapters Fully Matched
LIT β†’ EPUB Alice in Wonderland (LIT) 0.32s ⚑ 1.94s 6.0Γ— Faster 37 / 37 (100%) βœ… 21 chapters Fully Matched
KFX β†’ EPUB Clean-Room Container (KFX) 0.29s ⚑ 3.84s (Plugin Req.) 10.4Γ— Faster 37 / 37 (100%) βœ… 53 chapters Structural Text & Assets
DOCX β†’ EPUB Alice in Wonderland (DOCX) 0.15s ⚑ 2.85s 19.4Γ— Faster 37 / 37 (100%) βœ… 13 chapters Fully Matched
RTF β†’ EPUB Alice in Wonderland (RTF) 0.85s ⚑ 2.34s 2.8Γ— Faster 36 / 36 (100%) βœ… 15 chapters Fully Matched

Cargo.toml
[dependencies]
ebook-rs = "0.16.4"
Terminal window
# Python
pip install ebook-rs
# CLI Binary
cargo install ebook-rs
```\n