PDF转Markdown MCP服务器
这是一个基于Python的MCP (Model Context Protocol) 服务器,用于将PDF文件转换为Markdown格式。
功能特性
- 🚀 直接使用Python的
markitdown库,性能更高 - 🔧 简单的API接口
- 📄 支持各种PDF格式
- 🛡️ 完整的错误处理
安装和使用
1. 安装依赖
cd /Users/fengjinchao/Desktop/mcp/skills/python/pdf-to-markdown
uv sync
2. Claude配置
在Claude的MCP配置中添加:
{
"pdf-to-markdown-python": {
"name": "PDF转markdown(Python)",
"type": "stdio",
"description": "Python版本的PDF转markdown工具,性能更好",
"isActive": true,
"command": "uv",
"args": ["--directory", "/Users/fengjinchao/Desktop/mcp/skills/python/pdf-to-markdown", "run", "pdf-to-markdown-mcp"]
}
}
3. 使用工具
{
"name": "pdf-to-markdown",
"arguments": {
"filepath": "/path/to/your/document.pdf"
}
}
Python版本的优势
- 更简单的实现: 直接调用
markitdown.convert(), 不需要子进程 - 更好的性能: 避免了进程间通信的开销
- 更好的错误处理: Python的异常处理更直观
- 更少的依赖: 不需要TypeScript构建工具链
代码结构
pdf-to-markdown/
├── pyproject.toml # 项目配置
├── README.md # 说明文档
└── pdf_to_markdown_mcp/ # 主要代码
├── __init__.py # 包初始化
└── server.py # MCP服务器实现
Metadata
Release files for pdf-to-markdown-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pdf_to_markdown_mcp-0.1.0.tar.gz | 60.8 kB | Without provenance | Details for pdf_to_markdown_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pdf_to_markdown_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pdf_to_markdown_mcp-0.1.0-py3-none-any.whl |
Total release size: 64.5 kB
Release files / pdf_to_markdown_mcp-0.1.0.tar.gz
| Download URL | pdf_to_markdown_mcp-0.1.0.tar.gz |
|---|---|
| Size | 60.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
88822e270aa19cab8504ae47d6e13fd7adb5709baaa8a21117f19b2e4343a69e
|
|
BLAKE2b-256 checksum How to use checksums |
00da4189728ccc36e124220daa87bc9f4d4c1def4127880ba12f5bd19481223b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / pdf_to_markdown_mcp-0.1.0-py3-none-any.whl
| Download URL | pdf_to_markdown_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4d0300b8df5b2716edf0d4f5e084cb9b411f91908617e16277fb33b8dcab1fa3
|
|
BLAKE2b-256 checksum How to use checksums |
7a8f22d2c95cbddeca26f81e1fc69b75b99e9143b25576f935913aeed3407e61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Security for pdf-to-markdown-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.