DEV Community

shaun
shaun

Posted on

Connect Claude Code, Cursor, and Codex to an Open-Source PDF OCR Engine via Remote MCP

Most AI coding agents struggle the moment you hand them a scanned book, a two-column academic PDF, or a technical manual full of LaTeX formulas and footnotes. Standard text extractors scramble columns, repeat running headers on every page, and lose table structure.

We built PDFCraft (backed by the MIT-licensed open-source library oomol-lab/pdf-craft, 6,800+ GitHub stars, archived on CERN Zenodo at DOI 10.5281/zenodo.24855404) to reconstruct clean reading order, Markdown, reflowable EPUB, and 22-language translations from complex PDFs.

Today, in addition to running pip install pdf-craft locally or using the online workspace, you can connect AI agents directly to PDFCraft over Remote MCP (Streamable HTTP) or the Public REST API.

1. Connect via Remote MCP (Streamable HTTP)

PDFCraft exposes a hosted Streamable HTTP MCP server at:

https://api.pdfcraft.ai/v1/mcp
Enter fullscreen mode Exit fullscreen mode

It supports OAuth 2.1 (scope pdfcraft:use, browser sign-in with zero key copying) or a standard Bearer API key (from pdfcraft.ai/api-keys), and is listed in the Official MCP Registry under io.github.oomol-lab/pdf-craft.

Claude Code

claude mcp add --transport http -s user pdfcraft https://api.pdfcraft.ai/v1/mcp
Enter fullscreen mode Exit fullscreen mode

OpenAI Codex CLI

codex mcp add pdfcraft --url https://api.pdfcraft.ai/v1/mcp
Enter fullscreen mode Exit fullscreen mode

Cursor / Windsurf / MCP Clients (mcp.json)

{
  "mcpServers": {
    "pdfcraft": {
      "url": "https://api.pdfcraft.ai/v1/mcp"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Full setup instructions for every client live at pdfcraft.ai/connect/.

2. What Your Agent Can Do Once Connected

  • Scanned PDF to Markdown (pdfcraft.ai/pdf-to-markdown/): Preserves multi-column reading order, merges cross-page paragraphs, strips headers/footers, and retains tables and LaTeX math for RAG and context windows.
  • PDF OCR to Reflowable EPUB (pdfcraft.ai/ocr-pdf/): Extracts chapters, footnotes, and images into clean reader-friendly EPUBs.
  • 22-Language Book Translation (pdfcraft.ai/pdf-translator/ and pdfcraft.ai/epub-translator/): Supports replace, bilingual, and bilingual-inline layouts with custom glossary prompts.

3. Prefer a Direct REST API, Local Python, or Apify?

  pip install pdf-craft
  # Or with local NVIDIA CUDA GPU acceleration:
  pip install "pdf-craft[local]"
Enter fullscreen mode Exit fullscreen mode

If you run into tricky multi-column papers or historical scans, drop an issue on github.com/oomol-lab/pdf-craft and let us know what layout edge cases you want improved next.

Top comments (0)