Skip to main content

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版本的优势

  1. 更简单的实现: 直接调用markitdown.convert(), 不需要子进程
  2. 更好的性能: 避免了进程间通信的开销
  3. 更好的错误处理: Python的异常处理更直观
  4. 更少的依赖: 不需要TypeScript构建工具链

代码结构

pdf-to-markdown/
├── pyproject.toml          # 项目配置
├── README.md              # 说明文档
└── pdf_to_markdown_mcp/   # 主要代码
    ├── __init__.py        # 包初始化
    └── server.py          # MCP服务器实现

Project details


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdf_to_markdown_mcp-0.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

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

Hashes for pdf_to_markdown_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 88822e270aa19cab8504ae47d6e13fd7adb5709baaa8a21117f19b2e4343a69e
MD5 f51a23ebf98ed48dc304755f0ed979c0
BLAKE2b-256 00da4189728ccc36e124220daa87bc9f4d4c1def4127880ba12f5bd19481223b

See more details on using hashes here.

File details

Details for the file pdf_to_markdown_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pdf_to_markdown_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4d0300b8df5b2716edf0d4f5e084cb9b411f91908617e16277fb33b8dcab1fa3
MD5 8b45479c8ef1537bbb6bc93525182648
BLAKE2b-256 7a8f22d2c95cbddeca26f81e1fc69b75b99e9143b25576f935913aeed3407e61

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page