
Huoshui Pdf Converter
io.github.huoshuiai42由 GitHub 账号 huoshuiai42 发布v1.0.0更新于 Oct 24, 2026
An MCP server that provides PDF file conversion
概览
一个本地 MCP 服务器,可将 PDF 文件转换为 Markdown,也可将 Markdown 转换为 PDF,支持 Unicode 与中日韩字符。
- 可以做什么
- 将 PDF 文件转换为 Markdown,可选择提取图片并保留排版格式,结果写入指定输出路径。将 Markdown 文件转换为 PDF,可设置页面尺寸、页边距和字号,并自动选择渲染引擎。列出支持的格式与转换引擎。在转换前校验输入文件。
- 适用场景
- 适合需要把 PDF 文档转成可编辑 Markdown 文本,或把 Markdown 笔记、报告生成 PDF 的场景,尤其是包含中文、日文或韩文的内容。它在本地运行,适合文件保留在用户自己电脑上的桌面环境。
- 运行要求
- 作为本地进程在用户机器上运行(仅桌面端),从 PyPI 包 huoshui-pdf-converter 安装,例如通过 uvx 或 python -m 启动。需要带依赖的 Python 环境;未声明账号、API 密钥或环境变量。输出中日韩文字需要系统已安装相应 Unicode 字体。
安装
在 SourceWeft 中
- 打开 控制台中的 Huoshui Pdf Converter,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
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]
来源:README.md,提交 ab5f444
工具
0版本历史
1- v1.0.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分