PDF Craft

io.github.oomol-lab由 GitHub 账号 oomol-lab 发布v1.0.0更新于 Nov 19, 2026

Convert scanned PDFs to Markdown or EPUB, and translate PDF and EPUB books via MCP.

发布方自己的服务:Craft

已验证Streamable HTTP可网页运行文件与存储媒体与设计

概览

AI 生成的概览

远程 MCP 服务,可将扫描版 PDF 转换为 Markdown 或 EPUB,并翻译 PDF 与 EPUB 书籍。

可以做什么
  • 将扫描版 PDF 转换为可编辑的 Markdown,并附带文本与图片资源
  • 生成带书籍元数据与目录的、适合阅读器使用的 EPUB
  • 翻译 PDF 或 EPUB 内容,支持双语 EPUB 以及把译文写回 PDF 页面
  • 提取时识别正文、章节、目录、脚注、表格、公式与图片
  • 复用提取结果,供后续渲染或翻译使用
适用场景
适合把扫描版书籍、研究论文或技术文档变成可搜索、可编辑的 Markdown 或便于阅读的 EPUB,也适合把书籍翻译成其他语言。更适合通过托管服务做一次性转换,而不是自行搭建 OCR 流程。
运行要求
通过 streamable HTTP 访问的远程端点,需使用 OAuth 登录;托管转换方式无需本地运行时、Python、CUDA 或 OCR 密钥。文件上传到服务后,待处理完成再下载结果。
安装前请注意
上传的文档会由第三方在线服务处理,除非可以接受,否则不要提交机密或敏感文件。转换质量取决于扫描质量、版式与 OCR 模型,批量处理前应先检查一份有代表性的文档。输出结果不会自动校验。

安装

在 SourceWeft 中

  1. 打开 控制台中的 PDF Craft,将其添加到工作区。
  2. 连接 所需的 凭据。它们会被私密存储,绝不会在公开页面上展示。
  3. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.oomol-lab%2Fpdf-craft/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。 客户端会在首次连接时完成 OAuth 登录。

{
  "mcpServers": {
    "pdf-craft": {
      "type": "http",
      "url": "https://api.pdfcraft.ai/v1/mcp"
    }
  }
}

README

PDF Craft is a Python library for scanned books, research papers, and technical documents. It converts scanned PDFs into editable Markdown or reader-friendly EPUB. It can also translate PDF and EPUB content into another language, create translated or bilingual EPUBs, and write translations back onto the original PDF pages. It recognizes body text, chapters, tables of contents, footnotes, tables, formulas, and images so the content can be searched, edited, and read beyond the scanned page.

Convert online — no installation needed

Have a scanned PDF you want to edit or read as an ebook? Use PDF Craft Online · pdfcraft.ai: upload your file in a browser, submit a conversion task, and download the result when it is ready. There is no Python to install, no CUDA to configure, and no OCR provider or API key to set up.

PDF Craft Online is the official online service for this open-source project. Use it to convert your files directly, or use the Python library below to build conversion into your own application or run OCR on your own machine.

Upload your PDF and convert it online →

[PDF Craft Online conversion interface — click to upload a PDF]

Conversion examples

Markdown: edit, search, and process the content.

[PDF to Markdown example]

EPUB: read the book in an ebook reader.

[PDF to EPUB example]

Results depend on scan quality, page layout, and the OCR model. Check a representative document before processing a larger collection.

Want to see how your own file turns out? Upload a PDF and convert it to Markdown or EPUB →

What you can do

Your goalPDF Craft provides
Edit scanned booksPDF → Markdown, with text and image assets
Read in an ebook readerPDF → EPUB, with book metadata and table of contents
Read books in another languageTranslate during conversion or translate an existing EPUB; translation-only and bilingual output modes
Create a translated PDFTranslate extracted text and write it back onto the source pages
Integrate conversion into an appPython APIs and reusable extraction files for later rendering or translation

Choose how to use it

PathBest forRequirements
Online conversionUpload a file and download Markdown or EPUBA browser; no Python installation or OCR service setup
Python + remote OCRDevelopers who do not want to run OCR models locallyPython, Poppler, a compatible OCR service URL and credentials
Python + local OCRDevelopers with their own NVIDIA GPUPython, Poppler, CUDA, sufficient VRAM, and model files

Remote OCR sends pages to the configured service and does not require local CUDA. Local OCR runs on your machine; using a remote LLM for translation or table-of-contents analysis still sends the corresponding content to that service.

Python quick start

This example uses remote OCR to convert a PDF to Markdown. Prepare Python 3.11–3.13, Poppler, and a working DeepSeek OCR-compatible service configuration. See the installation guide for Poppler setup.

Just need to convert a file without setting up a development environment or OCR service? Use PDF Craft Online and upload your PDF in a browser.

1. Install

bash
python -m pip install pdf-craft

2. Convert a PDF

Place input.pdf in the directory where you run your script. Replace the URL, API key, and model name with your service configuration:

python
from pdf_craft import DeepSeekOCRVendorConfig, PDFCraft, PDFOptions
craft = PDFCraft(    pdf=PDFOptions(        ocr=DeepSeekOCRVendorConfig(            base_url="https://example.com/v1",            api_key="your-api-key",            model="deepseek-ocr",        ),    ),)
craft.convert_pdf_to_markdown("input.pdf", "output.md")

Async applications use the same options through AsyncPDFCraft; callbacks may also be async def functions and run on the caller's event loop:

python
import asynciofrom pdf_craft import AsyncPDFCraft, DeepSeekOCRVendorConfig, PDFOptions
async def main():    craft = AsyncPDFCraft(pdf=PDFOptions(ocr=DeepSeekOCRVendorConfig(        base_url="https://example.com/v1",        api_key="your-api-key",        model="deepseek-ocr",    )))    await craft.convert_pdf_to_markdown("input.pdf", "output.md")
asyncio.run(main())

Do not call the synchronous PDFCraft facade from a running event loop; use AsyncPDFCraft and await its corresponding method instead.

https://example.com/v1 is a placeholder, not a working endpoint. Use a compatible service that actually provides the OCR model. See OCR configuration for other models. If you do not have an OCR service yet, you can convert your files with PDF Craft Online.

Open output.md after conversion. Documents containing images also produce asset files; keep those files with the Markdown when moving or sharing it.

3. Create an EPUB

Reuse the configured craft instance above and replace the last line with:

python
craft.convert_pdf_to_epub("input.pdf", "output.epub")

Open output.epub in an EPUB reader. For title, author, and rendering options, see PDF conversion and translation. For installation or runtime problems, see troubleshooting.

For EPUB bibliographic metadata, opt in to front-page OCR metadata extraction and provide a separate metadata LLM. PDF Craft accepts only values it can verify against OCR evidence. PDF file properties fill missing fields; they never override information printed in the book.

Optional input assertions

Conversion does not automatically validate the whole input. If needed, call assert_pdf_readable, assert_pdf_renderable, assert_pdf_editable, or assert_epub_readable from pdf_craft before conversion. Choose the operation you need: success returns None, failure raises the original exception, and the input is never repaired or modified. Passing does not guarantee later OCR or translation succeeds. See usage and capability limits.

Translation and reusable extraction

Translate books. Supply an XMLTranslator when converting PDF to Markdown or EPUB, or translate an existing EPUB directly. Translation uses a separate text LLM; OCR and translation have independent configurations. EPUB translation can replace the original text or append the translation for bilingual reading.

Create a translated PDF. Extract the content, translate it, and write the translation back onto the original pages. This workflow also needs Ghostscript and suitable local fonts. Check the resulting layout against the source and translated text.

Extract once, reuse later. Save a .pcex extraction file for subsequent rendering, translation, or processing on another machine. Reuse the configured craft instance:

python
craft.convert_pdf_to_markdown(    "input.pdf",    "output.md",    extraction_path="book.pcex",)

Preview content as it is processed. PDF extraction, EPUB translation, and PCEX translation/rendering support optional callbacks. Receive source-mapped paragraphs, translated EPUB fragments, final PDF layout data, and finalized book metadata before the complete output file is ready. See incremental callbacks.

See PDF conversion and translation, EPUB translation, and the .pcex format reference.

OCR and runtime requirements

PDF Craft supports DeepSeek OCR, DeepSeek OCR 2, and Unlimited OCR, each with local and remote configurations.

The standard installation supports remote OCR. For local OCR, install the extra:

bash
python -m pip install "pdf-craft[local]"

Local execution also requires a matching CUDA-enabled PyTorch build, sufficient VRAM, and model files. Models download from Hugging Face by default; you can also download them in advance and load them locally. Presets and requirements vary by model; see OCR configuration.

Language support depends on the processing stage. README languages describe documentation availability. Text recognition depends on the OCR model, and translation depends on the translator and text LLM. The EPUB label_language parameter selects fixed navigation/default-title labels (zh / en, with English as the default and fallback); it does not restrict content or translation languages; see the API reference.

Documentation

TaskGuide
Preview task size and inspect remote resource consumptionUsage and sizing
Install system dependencies and configure a local GPUInstallation
Select OCR models, remote services, or model cachesOCR backends
Convert PDFs, create EPUBs, or write translations into PDFsPDF conversion and translation
Translate existing EPUBs and configure bilingual outputEPUB translation
Display incremental content and source locationsCallback guide
Understand extraction streaming and latency tradeoffsDesign rationale (Chinese)
Look up parameters, types, and methodsAPI reference
Store or exchange extraction results.pcex format
Resolve installation and conversion issuesTroubleshooting
Upgrade to 2.6.0: retry and recovery policiesMigration guide
Upgrade to 2.6.4: progress API migration and concurrencyRelease notes · Migration guide

Feedback and contributions

Report problems or suggest improvements through Issues. For conversion problems, include the package version, OCR configuration type, error logs, and a minimal file you can share publicly. Remove credentials and private content first.

Pull requests improving code, documentation, and translations are welcome. Use the Chinese README as the content baseline for all languages. Write naturally for local readers, preserving the focus on online conversion and translation capabilities, and keep API examples accurate.

If PDF Craft helps you, a Star helps others discover it.

Related projects

Wiki Graph can turn converted EPUB or Markdown books into structured summaries, chapter topology, and knowledge graphs.

License and acknowledgments

PDF Craft uses the MIT license. Third-party dependencies and selected OCR models retain their own licenses.

Thanks to DeepSeek OCR, DeepSeek OCR 2, Unlimited OCR, doc-page-extractor, pyahocorasick and the open-source projects that make PDF Craft possible.

Contributors

Thanks to everyone who has contributed to PDF Craft. Contributions to code, documentation, and translations are welcome.

[PDF Craft contributors]

Star History

[PDF Craft star history]

Translation progress reports source words (one Han character per word, long-word cap 20), with complete pre-scanned totals and per-round updates. See translation progress.

Extraction and translation share unit progress events, with upfront counts, integer stages, and source words.

来源:README.md,提交 e755c82

工具

0
该服务器需要登录,因此 SourceWeft 无法在没有账号的情况下读取其工具,也未收录。已连接账号所能看到的内容可能因账号及其权限而异。

版本历史

1
  1. v1.0.0最新Nov 19, 2026

评分

已满足适用检查项的 85%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Craft 集成