📊 PPTX转换器MCP
  
使用将PowerPoint演示文稿转换为Markdown AI驱动的图像描述.
作为CLI工具或 主控程序 服务器与Claude Code无缝集成。
______________________________________________________________________
✨ 特性
- 🤖 AI图像描述 --通过Vision LLM自动生成幻灯片图像的描述性文本
- 🔌 多个LLM后端 --OpenAI、Azure OpenAI、Anthropic、本地模型(vLLM、Ollama)
- 📄 单次和批量 --转换一个文件或整个文件夹
- ⚡ 线程 --并行图像分析,实现更快的转换
- 💾 智能缓存 --跳过已处理的图像
- 🔧 MCP服务器 --直接在Claude Code中用作工具
🔄 运作原理
┌──────────┐ ┌───────────────┐ ┌────────────┐ ┌──────────┐
│ .pptx │────>│ MarkItDown │────>│ Vision LLM │────>│ Markdown │
│ file(s) │ │ (text/layout)│ │ (images) │ │ output │
└──────────┘ └───────────────┘ └────────────┘ └──────────┘通过以下方式提取文本和布局 微软MarkItDown,然后将每个嵌入的图像发送到Vision LLM进行描述,合并为干净的Markdown输出。
🚀 快速开始
1.安装
git clone https://github.com/Loveacup/pptx-converter-mcp.git
cd pptx-converter-mcp
./install.sh2.配置LLM
cp .env.example .env
vim .env # set your LLM provider and API key3.重新加载外壳
source ~/.zshrc # or ~/.bashrc4.转换
# Single file
pptx-to-md "presentation.pptx" "output.md"
# Batch — all .pptx files in a folder
pptx-batch-convert "/path/to/ppt/folder"
# Or use in Claude Code directly:
# > Please convert presentation.pptx to Markdown⚙️ 配置
环境变量
| 变量 | 必填 | 默认 | 描述 |
|---|---|---|---|
LLM_API_URL | ✅ | — | LLM API端点URL |
LLM_MODEL | ✅ | — | 型号名称 |
LLM_API_KEY | - | neneneba API密钥(某些提供程序需要) | |
MAX_WORKERS | 3 | 并发线程 | |
CACHE_DIR | /tmp/ppt_image_cache | 缓存目录 |
提供商示例
OpenAI
LLM_API_URL=https://api.openai.com/v1/chat/completions
LLM_API_KEY=sk-your-api-key
LLM_MODEL=gpt-4oAzure OpenAI
LLM_API_URL=https://your-resource.openai.azure.com/openai/deployments/your-deployment/chat/completions?api-version=2024-02-15-preview
LLM_API_KEY=your-azure-api-key
LLM_MODEL=gpt-4oLocal Models (vLLM / Ollama)
LLM_API_URL=http://localhost:8000/v1/chat/completions
LLM_MODEL=your-model-name
# LLM_API_KEY is not needed for most local setups看 .env.示例 和 config/llm-config.yaml示例 更多配置。
📁 项目结构
pptx-converter-mcp/
├── bin/
│ ├── pptx-to-md # Single file CLI
│ ├── pptx-batch-convert # Batch conversion CLI
│ └── pptx-converter-mcp # MCP server entry point
├── config/
│ ├── mcp.json.template # MCP config template
│ └── llm-config.yaml.example # LLM config reference
├── docs/
│ ├── README.md # Full documentation
│ └── MCP-DEPLOYMENT.md # MCP deployment guide
├── examples/
│ └── example.pptx # Sample presentation
├── .env.example
├── install.sh # One-click installer
└── LICENSE📋 需求
- macOS或Linux
- Python 3.11+
- 具有与OpenAI兼容的API的Vision LLM
📚 文档
🙏 致谢
建立在 微软MarkItDown --一个优秀的文件到Markdown转换库。
