pdf-layout-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
vector-pdf-translator-mcp — Open-Core AI Add-On for Layout-Preserving PDF Translation
Local MCP server, HTTP/OpenAPI bridge, and CLI allowing AI agents (Claude Desktop, Antigravity, Cursor, Gemini CLI, ChatGPT, Open WebUI) to translate complex vector PDFs while preserving schematics, table borders, brand banners, and typography.
Why Naive PDF Translators Fail (Engineering Challenges Solved)
Standard PDF translation pipelines either convert pages into blurry raster images or reflow text blindly, breaking multi-column technical tables and engineering drawings. This project solves five core failure modes:
Vector & Image Preservation During Redaction: Source text is excised strictly with
PDF_REDACT_IMAGE_NONEandPDF_REDACT_LINE_ART_NONEso background gradients, CAD schematics, and table grids remain 100% vector-exact.Target Alphabet Glyph Verification (Zero Tofu): Pre-validates every required Unicode code point against the target TrueType/OpenType font (
fitz.Font.has_glyph) before rendering (e.g., MongolianӨөҮү, KazakhӘәҒғҚқҢңӨөҰұҮүҺһІі, UzbekOʻoʻGʻgʻ).Typography Auto-Shrink & Color Fidelity: Translated technical prose frequently expands by 15–35%. A step-down fitting loop (
0.5 ptsteps down to4.5 pt) fits text into originalbboxboundaries while retaining original RGB colors (e.g. white text on dark headers) and bold/regular weights, preserving original text rotation (0°,90°,180°,270°).RTL (Arabic Dialects & Hebrew) + Selective Layout Mirroring: Renders Arabic/Hebrew via MuPDF HarfBuzz (
insert_htmlboxwith<p dir="rtl">) to guarantee proper contextual letter shaping and BiDi ordering of embedded numbers/codes (1000 V,ISO 9001), supports Arabic dialect selection (msa,egyptian,gulf,levantine,maghrebi), and performs selective horizontal mirroring (mirror_layout="auto"): table columns, headers, and axis-aligned dividers mirror Right-to-Left while vector diagrams/schematics, raster images, and arrow callouts stay anchored in place.Audit & Surgical Patching Loop: Multi-pass line audit compares original vs. translated PDFs (normalizing PyMuPDF non-breaking spaces
\xa0) and allows surgical coordinate patching (pdf_patch_regions) without re-laying out approved pages.
Related MCP server: okraPDF PDF MCP server
Open-Core Architecture (Public Core vs. Private Extensions)
This repository implements the Open-Core foundation (complete MCP/OpenAPI server, CLI, baseline vector engine, and synthetic test suite). Advanced enterprise heuristics are isolated behind formal extension protocols in src/pdf_layout_mcp/core/plugins.py and loaded dynamically via PDF_LAYOUT_PLUGIN_MODULE.
Capability | Public Open-Core (This Repo) | Private Production Extensions (Not Included) |
Agent Protocols | Full MCP JSON-RPC 2.0 ( | Multi-tenant queue & worker orchestration |
PDF Vector Engine | In-place PyMuPDF redaction, auto-shrink, RTL BiDi + selective table mirroring, surgical | Multi-row complex table parser, semantic CAD arrow re-anchoring |
Scanned / Raster PDFs | Vector text layer required | Hybrid PaddleOCR / VLM extraction + background inpainting |
Translation & TM | LLM adapter (Gemini / OpenAI / OpenRouter / Ollama) + Arabic dialect selector ( | Domain Translation Memory (TM) + fuzzy matching + industrial glossaries |
Quality Assurance | Text-diff residual auditor + PNG preview exporter | Automated multimodal VLM collision/overflow detector ( |
flowchart LR
Agent["AI App<br/>(Claude / Antigravity / Cursor / ChatGPT)"] -->|MCP stdio or OpenAPI| Server["pdf-layout-mcp<br/>(8 Tools)"]
Server --> Core["Open-Core Engine<br/>(Extract / Redact / Auto-Shrink / Audit)"]
Core -.->|"PDF_LAYOUT_PLUGIN_MODULE<br/>(Optional Private Pro Plugins)"| Pro["LayoutPlugin / VisualQAPlugin<br/>(Table Splitter, OCR, VLM QA, Domain TM)"]
Core --> Output["Translated Vector PDF"]Production Case Study (Anonymized)
The architecture behind this engine was battle-tested in production to localize a 55-page industrial electrical cable catalog (tables, technical specifications, standards, stepped marking diagrams, and vector cross-sections) from Russian to Mongolian Cyrillic:
Protected Domain Integrity: Model codes, standard identifiers (
GOST,IEC,ISO), electrical formulas, and dimensional tolerances stayed untouched.Zero Layout Corruption: Vector schematics and multi-column spec tables preserved intact; residual lines caught via audit and patched surgically.
Business Impact: Accelerated localization from weeks of manual DTP layout work to hours, directly enabling the initiation of an official cross-border B2G/enterprise trade deal.
(Proprietary customer files, industry glossaries, and specialized layout heuristics are intentionally excluded from this public repository.)
Quickstart
1. Local Setup
python3 -m venv .venv
.venv/bin/pip install --upgrade setuptools wheel
.venv/bin/pip install -e ".[dev]"
cp .env.example .envNote on Fonts: No proprietary font binaries are shipped in this repo. On macOS/Linux, system Unicode fonts (
Arial,DejaVu Sans,Liberation Sans,Noto Sans) are auto-discovered. For extended scripts, drop open-source Noto Sans (SIL OFL) fonts intosrc/pdf_layout_mcp/fonts/or pass--font-regular.
2. Connect to Any AI Client
MCP Clients (Claude Desktop, Antigravity, Cursor, Gemini CLI):
Run.venv/bin/pdf-layout-mcp configsto generate a ready-to-pastemcpServersblock with your exact local Python path (or adaptintegrations/mcp_config.json).HTTP / OpenAPI Agents (ChatGPT Custom Actions, Open WebUI, REST):
.venv/bin/pdf-layout-mcp serve-http --port 8765Schema served at
http://127.0.0.1:8765/openapi.json(also exported inintegrations/openapi_schema.json).
3. Run Verification Tests
.venv/bin/pytest tests -vLicense
Released under AGPL-3.0-or-later. Any network/SaaS deployment incorporating this codebase must disclose its modified source under AGPL-3.0, while private/enterprise extensions can be licensed separately.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Convert scanned PDFs to Markdown or EPUB, and translate PDF and EPUB books via MCP.
Translate a user's uploaded text-based PDFs while keeping the layout, check job status, and fetch temporary links to translated or bilingual PDFs. Through MCP, the target language is English or Chinese; the iSomor website supports 92 target languages. OAuth 2.0 with PKCE; the user's iSomor account credits apply. Text-based PDFs only; scanned PDFs, including OCR'd scans, are not supported.
Translate text PDFs, keep the layout, get bilingual PDFs. MCP: EN/ZH. Website: 92 languages.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that translates scientific PDF documents while preserving original formulas, charts, and layout. It utilizes an OpenAI-compatible backend to provide tools for document translation and language listing.23AGPL 3.0
- AlicenseAqualityDmaintenanceThis MCP server enables AI agents to view PDFs as accessible HTML with bounding-box citations, and provides tools for layout-aware parsing, schema extraction, cross-document Q&A, and PDF rendering.27MIT
- AlicenseNot gradedqualityCmaintenanceExtracts text and tables from PDFs for AI agents via MCP, enabling structured data retrieval from invoices, reports, and statements.30 PyPI1MIT

Equalang Translationofficial
AlicenseAqualityBmaintenanceTranslate PDF, Word (DOCX), Excel (XLSX) and PowerPoint (PPTX) files, images, subtitles and text. Turn audio and video into transcripts or translated subtitles. Preserve layout where supported. Requires an Equalang API key and credits.883 npm22Apache 2.0