Skip to main content

PPT转Markdown MCP服务器 - Python版本

Project description

PPT转Markdown MCP服务器

这是一个基于Python的MCP (Model Context Protocol) 服务器,用于将PowerPoint文件转换为Markdown格式。

功能特性

  • 🚀 直接使用Python的markitdown库,支持PowerPoint处理
  • 📊 支持PowerPoint格式 (.pptx, .ppt)
  • 🎯 支持幻灯片结构转换
  • 📝 提取文本、图片描述、表格等内容
  • 🔧 简单的API接口
  • 🛡️ 完整的错误处理

安装和使用

1. 安装依赖

cd /Users/fengjinchao/Desktop/mcp/skills/python/ppt-to-markdown
uv sync

2. Claude配置

在Claude的MCP配置中添加:

{
  "ppt-to-markdown-python": {
    "name": "PPT转markdown(Python)",
    "type": "stdio",
    "description": "Python版本的PPT转markdown工具,支持幻灯片结构",
    "isActive": true,
    "command": "uv",
    "args": ["--directory", "/Users/fengjinchao/Desktop/mcp/skills/python/ppt-to-markdown", "run", "ppt-to-markdown-mcp"]
  }
}

3. 使用工具

基本用法

{
  "name": "pptx-to-markdown",
  "arguments": {
    "filepath": "/path/to/your/presentation.pptx"
  }
}

自定义选项

{
  "name": "pptx-to-markdown", 
  "arguments": {
    "filepath": "/path/to/your/presentation.pptx",
    "include_slides": true
  }
}

支持的文件格式

  • .pptx - PowerPoint 2007+ 格式
  • .ppt - PowerPoint 97-2003 格式(通过markitdown支持)

转换特性

  • 幻灯片结构: 保持幻灯片的逻辑结构
  • 文本内容: 提取所有文本内容包括标题和正文
  • 图片处理: 提取图片描述和alt文本
  • 表格支持: 转换表格为Markdown表格格式
  • 列表处理: 保持项目符号和编号列表
  • 格式保持: 尽可能保持原有格式结构

Python版本优势

  1. 更好的Office文档支持: Python在处理Office文档方面有丰富的库
  2. 更直接的处理: 无需子进程调用,直接API处理
  3. 更好的错误处理: Python异常处理更完善
  4. 更强的扩展性: 易于添加自定义处理逻辑
  5. 更好的性能: 避免进程间通信开销

代码结构

ppt-to-markdown/
├── pyproject.toml               # 项目配置
├── README.md                   # 说明文档
└── ppt_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

ppt_to_markdown_mcp-0.1.0.tar.gz (71.7 kB view details)

Uploaded Source

Built Distribution

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

ppt_to_markdown_mcp-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file ppt_to_markdown_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: ppt_to_markdown_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 71.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for ppt_to_markdown_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5f2b06faa1aab9f584b0dea8a0490383d36c383bdedb28670988e73affe447d7
MD5 586e33fef85f21aebef3867d8f83c1d3
BLAKE2b-256 0a68c998c944039d415e3ade948b9b43fc05eff35ec70659b00a3aeee7b939c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ppt_to_markdown_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 483df49abe7d3091b774bd0be3c0a238a6afb94f24a07c2315bcd899dc6af9c7
MD5 6ffc71a666c165f2dc22724d412c9edf
BLAKE2b-256 25d0d81ecb672e4ab2562b87b72a5d7a06faae97b8fa2c3d71fa635131bea03c

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