
Huoshui Pdf Converter
io.github.huoshuiai42Published by GitHub account huoshuiai42v1.0.0Updated Oct 24, 2026
An MCP server that provides PDF file conversion
Overview
A local MCP server that converts PDF files to Markdown and Markdown files to PDF, with Unicode and CJK support.
- What you can do
- Convert PDF files to Markdown, optionally extracting images and preserving layout formatting, writing the result to a chosen output path. Convert Markdown files to PDF with configurable page size, margins and font size, using automatic engine selection. List the supported formats and conversion engines. Validate input files before running a conversion.
- When to use it
- Useful when an assistant needs to turn PDF documents into editable Markdown text, or to produce a PDF from Markdown notes or reports, especially with Chinese, Japanese or Korean content. It runs locally, so it suits desktop setups where files stay on the user's machine.
- Requirements
- Runs as a local process on the user's machine (desktop only), installed from the PyPI package huoshui-pdf-converter, for example via uvx or python -m. Needs a Python environment with the package's dependencies; no accounts, API keys or environment variables are declared. Unicode fonts should be present on the system for CJK output.
Installation
In SourceWeft
- Open Huoshui Pdf Converter in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
活水 PDF 转换器 (Huoshui PDF Converter)
[License: MIT] [Python 3.10+] [MCP] [PyPI version]
A high-quality, cross-platform PDF ↔ Markdown converter implemented as an MCP (Model Context Protocol) server. Supports bidirectional conversion with full Unicode/CJK character support.
Features
Core Capabilities
- PDF → Markdown: Extract text and images with layout preservation
- Markdown → PDF: Generate beautiful PDFs with multiple rendering engines
- Unicode Support: Full support for Chinese, Japanese, Korean, and other Unicode characters
- Cross-Platform: Works on Windows, macOS, and Linux
- MCP Integration: Use with Claude Desktop or any MCP-compatible client
Technical Features
- Pure Python: No external system dependencies required
- Automatic Font Detection: Finds and uses system Unicode fonts
- Smart Engine Selection: Automatically switches engines based on content
- Comprehensive Error Handling: Graceful degradation and detailed logging
- Async Architecture: Non-blocking operations for better performance
Installation
From MCP Registry (Recommended)
This server is available in the Model Context Protocol Registry. Install it using your MCP client.
mcp-name: io.github.huoshuiai42/huoshui-pdf-converter
As a Python Package
Or using uv (recommended):
As an MCP Server
Add to your Claude Desktop configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
Or if you prefer to use a specific Python environment:
Usage
Command Line Interface
As a Python Library
MCP Tools
When used as an MCP server, the following tools are available:
-
pdf_to_markdown: Convert PDF files to Markdown
-
markdown_to_pdf: Convert Markdown files to PDF
-
list_supported_formats: Get supported formats and engines
-
validate_file: Validate input files before conversion
Supported Formats
Input Formats
- PDF: All standard PDF files (PDF 1.0 - 1.7)
- Markdown: CommonMark and GitHub Flavored Markdown
Output Options
- Page Sizes: A4, A3, Letter, Legal
- Margins: Customizable (e.g., "1cm", "0.5in")
- Font Sizes: Any size in points
- Images: PNG, JPEG extraction from PDFs
Unicode and Font Support
The converter automatically detects and uses appropriate fonts for different languages:
- macOS: Arial Unicode, PingFang SC, STHeiti
- Windows: Microsoft YaHei, SimSun, Arial Unicode MS
- Linux: Noto Sans CJK, Source Han Sans, WenQuanYi
Architecture
Conversion Engines
PDF → Markdown
- PyMuPDF (MuPDF): High-quality text and image extraction
Markdown → PDF
- ReportLab: Best Unicode support, cross-platform compatibility
- xhtml2pdf: Good HTML/CSS rendering (fallback)
- fpdf2: Basic PDF generation (last resort)
Engine Selection Logic
- Detects CJK characters → Uses ReportLab
- Complex formatting → Uses xhtml2pdf
- Basic documents → Uses any available engine
Development
Setup Development Environment
Project Structure
Troubleshooting
Common Issues
-
Chinese characters not displaying:
- Ensure Arial Unicode or similar fonts are installed
- The converter will automatically detect and use appropriate fonts
-
Import errors:
- Install all dependencies:
pip install huoshui-pdf-converter[all]
- Install all dependencies:
-
MCP connection issues:
- Check Claude Desktop logs
- Ensure Python is in your PATH
Logging
Enable debug logging:
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Built with FastMCP for Model Context Protocol support
- Uses PyMuPDF for PDF parsing
- Uses ReportLab for PDF generation
- Inspired by the need for better PDF ↔ Markdown conversion tools
Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: [email protected]
Source: README.md at commit ab5f444
Tools
0Version history
1- v1.0.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts