PDF2ZH MCP Server
Utilizes OpenAI-compatible APIs to translate scientific PDF documents while maintaining the original layout, formulas, charts, and table of contents.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PDF2ZH MCP Servertranslate research_paper.pdf into Chinese"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PDF2ZH — FeatherFlow MCP Server for PDF Translation
A slim MCP (Model Context Protocol) tool server that translates scientific PDF documents while preserving formulas, charts, table of contents, and layout. Designed to be launched and managed by FeatherFlow.
Based on PDFMathTranslate, stripped down to a single OpenAI-compatible translation backend — reusing the same LLM that FeatherFlow is already connected to.
Features
MCP stdio transport — plug-and-play with FeatherFlow (or any MCP-compatible host)
Preserves formulas & layout — powered by ONNX-based document layout analysis + pdfminer/pymupdf
Dual output — generates both mono (translated-only) and dual (bilingual side-by-side) PDFs
Shares FeatherFlow's LLM — OpenAI-compatible endpoint via environment variables, no extra API key needed
Cross-platform — works on Linux and Windows; all paths use
pathlibfor portability
Related MCP server: PDF2MD MCP Server
MCP Tools
Tool | Description |
| Translate a PDF file. Accepts |
| List all supported language codes ( |
File Path Resolution
The file parameter of translate_pdf supports both absolute and relative paths:
Absolute path — used as-is (e.g.
/home/user/.featherflow/workspace/paper.pdf)Relative path — resolved against the workspace directory (defaults to
~/.featherflow/workspace, overridable via theWORKSPACE_DIRenvironment variable)
Output PDFs are written to the workspace directory by default. The returned paths are always absolute, making them directly usable by other MCP tools (e.g. feishu-mcp upload_file / upload_file_and_share).
Requirements
⚠️ Python Environment Isolation — Important
This project depends on
babeldoc/onnxruntime, which require Python ≥3.10, <3.13. FeatherFlow itself may run on a different Python version (e.g. 3.13+). You must create a separate Python environment for this project and point FeatherFlow's MCP config to this project's Python executable — not FeatherFlow's own Python.
Python 3.10 – 3.12 (recommended: 3.12)
uv (recommended), Conda, or virtualenv for environment isolation
Installation
0. Install uv (one-time setup, recommended)
uv can automatically download and manage any Python version — no need to install Python 3.12 manually.
# Linux / macOS
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows PowerShell
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Restart your terminal after installation, then verify:
uv --version1. Create a dedicated Python 3.12 environment
Using uv (recommended — auto-downloads Python 3.12 even if you only have 3.13+):
cd /path/to/pdftranslate-mcp
uv venv .venv --python 3.12Activate the environment:
# Linux / macOS
source .venv/bin/activate
# Windows PowerShell
.venv\Scripts\Activate.ps1
# Windows CMD
.venv\Scripts\activate.batAlternative: Conda
conda create -p /path/to/pdftranslate-mcp/.venv python=3.12 -y
conda activate /path/to/pdftranslate-mcp/.venvAlternative: venv (only if system Python is already 3.10–3.12)
python3.12 -m venv .venv
source .venv/bin/activate # Linux/macOS
# .venv\Scripts\Activate.ps1 # Windows PowerShell2. Install the package
pip install -e .Or with uv (10-100x faster):
uv pip install -e .This installs all dependencies: pymupdf, pdfminer-six, babeldoc, onnxruntime, openai, mcp, etc.
3. Verify
python -m pdf2zh.mcp_server --helpFeatherFlow Configuration
Edit ~/.featherflow/config.json (or the config file for your setup). Add pdf2zh under tools.mcpServers.
Key point: The
commandmust point to this project's own Python executable, not FeatherFlow's Python. This project requires Python <3.13, while FeatherFlow may run on a newer version.
Example (Linux — production server)
{
"tools": {
"mcpServers": {
"pdf2zh": {
"command": "/opt/PDFMathTranslate/.venv/bin/python",
"args": ["-m", "pdf2zh.mcp_server"],
"toolTimeout": 600,
"env": {
"OPENAI_BASE_URL": "https://openrouter.ai/api/v1",
"OPENAI_API_KEY": "sk-or-v1-xxxxxxxx",
"OPENAI_MODEL": "anthropic/claude-opus-4-5"
}
}
}
}
}Example (Windows — development)
{
"tools": {
"mcpServers": {
"pdf2zh": {
"command": "C:/Users/<you>/code/PDFMathTranslate/.venv/python.exe",
"args": ["-m", "pdf2zh.mcp_server"],
"toolTimeout": 600,
"env": {
"OPENAI_BASE_URL": "https://openrouter.ai/api/v1",
"OPENAI_API_KEY": "sk-or-v1-xxxxxxxx",
"OPENAI_MODEL": "anthropic/claude-opus-4-5"
}
}
}
}
}Tip: On Windows, use forward slashes
/in JSON paths — they work fine with Python'spathlib.
Tool Timeout — Critical for PDF Translation
⚠️ You MUST set
toolTimeoutfor the pdf2zh MCP server.FeatherFlow's default MCP tool timeout is 30 seconds. PDF translation is a heavy operation — a 6-page paper typically takes 1–5 minutes depending on the LLM speed. Without increasing
toolTimeout, the tool call will be cancelled mid-translation, and the agent will report a failure.Recommended:
"toolTimeout": 600(10 minutes). For very long documents (50+ pages), consider1200(20 minutes).
"pdf2zh": {
"command": "...",
"args": ["-m", "pdf2zh.mcp_server"],
"toolTimeout": 600,
...
}Environment Variables
Variable | Required | Description |
| Yes | API base URL (e.g. |
| Yes | API key for the provider |
| Yes | Model identifier (e.g. |
| No | Override LLM temperature. Omit for reasoning models (e.g. |
| No | Shared workspace directory. Defaults to |
The OPENAI_* variables are the same credentials FeatherFlow uses — just pass them through via env. WORKSPACE_DIR usually does not need to be set; it automatically uses FeatherFlow's default workspace.
Standalone Usage (without FeatherFlow)
stdio mode (default)
python -m pdf2zh.mcp_serverSSE mode (for web-based MCP clients)
python -m pdf2zh.mcp_server --sse --host 0.0.0.0 --port 3001Cross-MCP Workflow: pdf2zh + feishu-mcp
This project is designed to work alongside feishu-mcp. A typical end-to-end flow:
User: "Translate this paper and share it in the Feishu group"
↓
FeatherFlow (LLM orchestration):
1. paper_download → ~/.featherflow/workspace/paper.pdf
2. pdf2zh.translate_pdf(file="paper.pdf", lang_in="en", lang_out="zh")
→ ~/.featherflow/workspace/paper-mono.pdf
→ ~/.featherflow/workspace/paper-dual.pdf
3. feishu-mcp.upload_file_and_share(file_path="/home/user/.featherflow/workspace/paper-dual.pdf")
→ share_url
4. feishu-mcp.send_message(chat_id, share_url)Why this works seamlessly:
pdf2zh writes output to
~/.featherflow/workspaceby defaultfeishu-mcp
upload_file/upload_file_and_shareaccepts absolute file pathspdf2zh returns absolute paths in its result — the LLM can extract and pass them directly to feishu-mcp
Both MCP servers run as local processes on the same machine, sharing the same filesystem
Project Structure
pdf2zh/
__init__.py # Package entry, exports translate_stream
mcp_server.py # MCP server (entry point, tools definition)
translator.py # BaseTranslator + OpenAITranslator
converter.py # PDF content conversion & layout processing
high_level.py # Core translation pipeline (translate_stream)
config.py # Configuration & constants
cache.py # Translation cache (SQLite via peewee)
doclayout.py # ONNX document layout model loading
pdfinterp.py # Extended PDF interpreter
pyproject.toml # Dependencies & build configLicense
Credits
Core PDF translation engine from PDFMathTranslate by Byaidu
MCP host integration for FeatherFlow
Available Tools
2 toolslist_supported_languagesA
List language codes supported for translation.
Returns a table of common language codes that can be used as
lang_in or lang_out parameters.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, but description accurately states it returns a table of codes. Simple read-only tool; no further behavioral traits needed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with the main action, no extraneous words. Perfectly concise for a zero-parameter utility tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Low complexity tool with no parameters and an output schema. Description fully explains purpose, usage context, and relation to sibling. No gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters needed—schema is empty. Description adds value by explaining the codes' purpose (translation parameters), which is not apparent from schema alone.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states the verb 'list' and resource 'language codes supported for translation'. Directly distinguishes from sibling translate_pdf by specifying that these codes are used as translation parameters.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explains that the returned codes can be used as lang_in or lang_out parameters, implying the tool should be called before translation. Lacks explicit when-not-to-use guidance but sufficient given one sibling.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
translate_pdfA
Translate a PDF file while preserving formulas and layout.
Args:
file: Path to the input PDF file. Absolute paths are used
as-is; relative paths are resolved against the shared
workspace directory (~/.featherflow/workspace by default,
overridable via WORKSPACE_DIR env var).
lang_in: Source language code (e.g. "en", "auto" for auto-detect).
lang_out: Target language code (e.g. "zh", "ja", "ko", "fr", "de").
output_dir: Directory for output files. Defaults to the shared
workspace directory so that other MCP tools
(e.g. feishu-mcp upload_file) can access the outputs.
Returns:
A summary with absolute paths to the mono (translated-only) and
dual (bilingual side-by-side) output PDF files. These paths
can be passed directly to feishu-mcp upload_file / upload_file_and_share.
Environment variables that control the LLM used for translation:
OPENAI_BASE_URL – API base URL
OPENAI_API_KEY – API key
OPENAI_MODEL – Model name
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | ||
| lang_in | Yes | ||
| lang_out | Yes | ||
| output_dir | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description fully bears the transparency burden. It discloses that the tool preserves formulas and layout, uses an LLM controlled by environment variables, returns absolute paths, and produces two output files. It does not mention any destructive actions or limitations, but it is sufficiently transparent for a translation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with an 'Args' and 'Returns' section, front-loading the main purpose. It contains several sentences but each earns its place by providing necessary context. Slight improvement could condense some details, but it is not overly verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the 4 parameters, no output schema (though description covers returns), and sibling tool presence, the description covers input handling, output paths, integration hints, and environment variables. It lacks explicit error handling or size limits, but overall it provides a complete picture for usage.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0% description coverage, so the description must add meaning. It does so by explaining path resolution logic (absolute vs relative), providing example language codes, and describing the output directory's default and purpose. This adds significant value beyond the schema's bare type definitions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Translate a PDF file while preserving formulas and layout.' This is a specific verb+resource combination that distinguishes it from the sibling tool 'list_supported_languages'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides context about path resolution, environment variables, and output directory integration with other MCP tools, but it does not explicitly state when to use this tool versus alternatives or when not to use it. It mentions the sibling tool's existence only through context, not in guidelines.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v1.9.11- First observed
list_supported_languages - First observed
translate_pdf
TDQS
Only two tools with clearly distinct purposes: one lists supported languages, the other translates PDFs. No overlap or ambiguity.
Both tools follow a consistent verb_noun pattern: list_supported_languages and translate_pdf. No mixing of conventions.
With only 2 tools, the server feels thin for a broader translation service, but it is scoped to a single core task. The count is borderline acceptable.
The core workflow (translating a PDF with language selection) is fully covered. Missing optional features like output format control, but no critical gaps for the stated purpose.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Hosted MCP server: convert PDFs to clean, LLM-ready Markdown with tables, formulas and OCR.
MCP server for detecting and redacting PII (Personally Identifiable Information) in PDF documents.
MCP server for Translation Services
Document-to-Markdown MCP server — convert PDF, Office and HTML into LLM-ready Markdown.
Related MCP Servers
- AlicenseAqualityFmaintenanceAn MCP server that exports PDF documents to markdown format optimized for LLM processing.11BSD 3-Clause
- AlicenseAqualityDmaintenanceAn MCP server that converts PDF files to Markdown format using AI sampling capabilities, supporting both local files and URLs with incremental conversion features.11MIT
- AlicenseAqualityCmaintenanceAn MCP server for reading, rendering, and searching PDF files, specifically optimized for LLMs to extract text, tables, and technical diagrams. It enables metadata retrieval, multi-format text extraction, and page-to-image rendering using PyMuPDF.577MIT
- AlicenseAqualityDmaintenanceMCP server for translating PDFs using pdf2zh-next, preserving document context by extracting all text segments for LLM translation at once.52MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/lichman0405/pdftranslate-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server