PDF转Markdown MCP服务器 - Python版本
Project description
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服务器实现
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pdf_to_markdown_mcp-0.1.0.tar.gz
(60.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pdf_to_markdown_mcp-0.1.0.tar.gz.
File metadata
- Download URL: pdf_to_markdown_mcp-0.1.0.tar.gz
- Upload date:
- Size: 60.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88822e270aa19cab8504ae47d6e13fd7adb5709baaa8a21117f19b2e4343a69e
|
|
| MD5 |
f51a23ebf98ed48dc304755f0ed979c0
|
|
| BLAKE2b-256 |
00da4189728ccc36e124220daa87bc9f4d4c1def4127880ba12f5bd19481223b
|
File details
Details for the file pdf_to_markdown_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pdf_to_markdown_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d0300b8df5b2716edf0d4f5e084cb9b411f91908617e16277fb33b8dcab1fa3
|
|
| MD5 |
8b45479c8ef1537bbb6bc93525182648
|
|
| BLAKE2b-256 |
7a8f22d2c95cbddeca26f81e1fc69b75b99e9143b25576f935913aeed3407e61
|