PPTX MCP Server
Enables AI assistants to create, edit, and manipulate PowerPoint presentations programmatically with support for text styling, shapes, slide rearrangement, and direct Office XML access.
README
📊 PPTX MCP Server
A Model Context Protocol (MCP) server that enables AI assistants to create, edit, and manipulate PowerPoint presentations programmatically.
✨ Features
- Full PowerPoint Control - Create, read, and modify
.pptxfiles without needing PowerPoint installed - AI-Native Design - Built specifically for LLMs to generate and edit presentations through structured JSON
- Rich Formatting Support - Text styling, colors, alignment, bullets, shapes, and backgrounds
- Template Workflows - Extract content from existing presentations, modify, and regenerate
- Visual Debugging - Generate thumbnail grids to preview slides programmatically
- Office XML Access - Direct access to underlying OOXML for advanced customization
🚀 Quick Start
1. Install
# Clone the repository
git clone https://github.com/YOUR_USERNAME/pptx-mcp-server.git
cd pptx-mcp-server
# Install the package
pip install -e .
2. Configure Your MCP Client
Add to your MCP settings:
<details> <summary><b>Claude Desktop</b></summary>
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"pptx": {
"command": "python",
"args": ["-m", "pptx_mcp_server"]
}
}
}
</details>
<details> <summary><b>Cursor</b></summary>
Add to your MCP configuration:
{
"mcpServers": {
"pptx": {
"command": "python",
"args": ["-m", "pptx_mcp_server"]
}
}
}
</details>
<details> <summary><b>Using a Virtual Environment (conda/venv)</b></summary>
Specify the full path to your Python interpreter:
{
"mcpServers": {
"pptx": {
"command": "/path/to/your/python",
"args": ["-m", "pptx_mcp_server"]
}
}
}
Examples:
- Conda:
/Users/username/miniconda3/bin/python - venv:
/path/to/project/.venv/bin/python</details>
3. Restart Your MCP Client
Restart Claude Desktop, Cursor, or your MCP client to load the server.
📦 Requirements
- Python 3.10+
- Dependencies (installed automatically):
mcp- Model Context Protocol SDKpython-pptx- PowerPoint file manipulationPillow- Image processinglxml- XML parsingdefusedxml- Secure XML parsing
Optional (for thumbnails)
# macOS
brew install --cask libreoffice
brew install poppler
# Ubuntu/Debian
sudo apt-get install libreoffice poppler-utils
🛠️ Available Tools
| Tool | Description |
|---|---|
create_presentation |
Create new presentations from scratch |
extract_text_inventory |
Extract text content with positions and formatting |
apply_text_replacements |
Replace text using JSON specifications |
rearrange_slides |
Duplicate, delete, and reorder slides |
create_thumbnail_grid |
Generate visual thumbnail grids |
unpack_office_document |
Extract Office files to editable XML |
pack_office_document |
Rebuild Office files from XML |
validate_office_document |
Validate document structure |
📖 Usage Examples
Create a New Presentation
{
"output_path": "/path/to/presentation.pptx",
"layout": "16:9",
"slides": [
{
"background": "#0f172a",
"shapes": [
{
"type": "textbox",
"left": 0.5,
"top": 3,
"width": 12,
"height": 1.5,
"text": "Welcome to My Presentation",
"font_size": 54,
"bold": true,
"color": "#ffffff",
"alignment": "center"
},
{
"type": "textbox",
"left": 0.5,
"top": 5,
"width": 12,
"height": 1,
"text": "Subtitle goes here",
"font_size": 24,
"color": "#94a3b8",
"alignment": "center"
}
]
},
{
"shapes": [
{
"type": "textbox",
"left": 0.5,
"top": 0.5,
"width": 12,
"height": 1,
"text": "Key Points",
"font_size": 36,
"bold": true
},
{
"type": "textbox",
"left": 0.5,
"top": 1.8,
"width": 12,
"height": 5,
"paragraphs": [
{"text": "First important point", "font_size": 24, "bullet": true},
{"text": "Second important point", "font_size": 24, "bullet": true},
{"text": "Third important point", "font_size": 24, "bullet": true}
]
}
]
}
]
}
Supported shape types:
textbox- Text contentrectangle- Rectangle (can contain text)rounded_rectangle- Rounded cornersoval- Circle/ellipseimage- Image file (usepathproperty)line- Line connector
Supported layouts: 16:9, 4:3, widescreen, standard
Extract Text Inventory
Get all text content from an existing presentation:
{
"pptx_path": "/path/to/presentation.pptx"
}
Returns structured JSON:
{
"slide-0": {
"shape-0": {
"left": 0.5,
"top": 1.0,
"width": 12.0,
"height": 1.5,
"paragraphs": [
{"text": "Title Text", "font_size": 44.0, "bold": true}
]
}
}
}
Replace Text Content
Modify text in an existing presentation:
{
"pptx_path": "/path/to/template.pptx",
"output_path": "/path/to/output.pptx",
"replacements_json": {
"slide-0": {
"shape-0": [
{"text": "New Title", "font_size": 44, "bold": true}
]
}
}
}
Rearrange Slides
Reorder, duplicate, or remove slides:
{
"template_path": "/path/to/template.pptx",
"output_path": "/path/to/output.pptx",
"slide_sequence": "0,2,2,1,3"
}
0,2,2,1,3→ Keep slide 0, duplicate slide 2, then slides 1 and 3- Omit an index to delete that slide
Unpack/Pack for XML Editing
// Unpack to directory
{
"office_file": "/path/to/document.pptx",
"output_dir": "/path/to/unpacked"
}
// Pack back to file
{
"input_dir": "/path/to/unpacked",
"output_file": "/path/to/output.pptx"
}
🔧 Troubleshooting
<details> <summary><b>ModuleNotFoundError: No module named 'mcp'</b></summary>
Ensure you're using the correct Python environment:
# Check which Python pip uses
pip --version
# Install with specific Python
/path/to/python -m pip install -e .
</details>
<details> <summary><b>Server not appearing in MCP client</b></summary>
- Verify the config file path is correct for your OS
- Ensure JSON syntax is valid (no trailing commas)
- Restart the MCP client completely
- Check logs for errors </details>
<details> <summary><b>Thumbnail generation fails</b></summary>
Install LibreOffice and poppler:
# macOS
brew install --cask libreoffice && brew install poppler
# Linux
sudo apt-get install libreoffice poppler-utils
</details>
<details> <summary><b>Permission denied errors</b></summary>
Ensure the output paths are writable and parent directories exist. </details>
📁 Project Structure
pptx-mcp-server/
├── pyproject.toml # Package configuration
├── README.md
└── pptx_mcp_server/
├── __init__.py
├── server.py # MCP server implementation
└── tools/
├── __init__.py
├── create.py # Create new presentations
├── inventory.py # Extract text content
├── replace.py # Text replacement
├── rearrange.py # Slide manipulation
├── thumbnail.py # Visual thumbnails
└── ooxml.py # XML pack/unpack/validate
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
🙏 Acknowledgments
- Built with python-pptx
- Uses the Model Context Protocol by Anthropic
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。