by GongRzhe
A MCP (Model Context Protocol) server for PowerPoint manipulation using python-pptx, offering comprehensive tools for creating, editing, and manipulating PowerPoint presentations.
Office-PowerPoint-MCP-Server is a comprehensive Model Context Protocol (MCP) server designed for advanced PowerPoint manipulation using the python-pptx
library. It provides a robust set of tools to programmatically create, read, edit, and manage Microsoft PowerPoint presentations. Version 2.0 significantly expands its capabilities with 32 specialized tools organized into 11 modules, focusing on complete presentation creation, management, and professional design.
Installation:
npx -y @smithery/cli install @GongRzhe/Office-PowerPoint-MCP-Server --client claude
python setup_mcp.py
This script automates prerequisite checks, offers installation options (PyPI or local development), installs dependencies, and generates the MCP configuration.git clone https://github.com/GongRzhe/Office-PowerPoint-MCP-Server.git
cd Office-PowerPoint-MCP-Server
pip install -r requirements.txt
chmod +x ppt_mcp_server.py
Running the Server:
python ppt_mcp_server.py
python ppt_mcp_server.py --transport http --port 8000
docker build -t ppt_mcp_server .
docker run -d --rm -p 8000:8000 ppt_mcp_server -t http
MCP Configuration:
Integrate with your MCP settings by adding server configurations (e.g., for local Python server or using uvx
for direct PyPI execution).
Example Usage (Python):
Interact with the server using use_mcp_tool
to call specific functions:
# Create a new presentation
result = use_mcp_tool(
server_name="ppt",
tool_name="create_presentation",
arguments={}
)
presentation_id = result["presentation_id"]
# Add a title slide
result = use_mcp_tool(
server_name="ppt",
tool_name="add_slide",
arguments={
"layout_index": 0,
"title": "My Presentation",
"presentation_id": presentation_id
}
)
# Save the presentation
result = use_mcp_tool(
server_name="ppt",
tool_name="save_presentation",
arguments={
"file_path": "my_presentation.pptx",
"presentation_id": presentation_id
}
)
.pptx
files, template support with theme preservation, multi-presentation management, and core document properties management.manage_text
, manage_image
, apply_picture_effects
, and apply_professional_design
for streamlined operations.auto_generate_presentation
), and text optimization (optimize_slide_text
).Q: What are the prerequisites for running the server?
A: Python 3.6 or higher and pip
package manager. uvx
is optional for package execution without local installation.
Q: How can I specify custom template directories?
A: Set the PPT_TEMPLATE_PATH
environment variable to your desired directories.
Q: What kind of templates does the server support?
A: It supports .pptx
and .potx
files, including those with existing content and custom layouts. It also includes 25+ built-in professional slide templates.
Q: Can I apply multiple picture effects at once?
A: Yes, with the apply_picture_effects
tool, you can apply combined effects like shadow, glow, and rotation in a single call.
Q: Does the server support text validation and auto-fixing?
A: Yes, the manage_text
tool includes operations for validating text fit and can automatically fix issues by adjusting font sizes.
Q: How does the server handle professional design?
A: It offers 4 built-in color schemes, professional typography, theme application, gradient backgrounds, and a unified apply_professional_design
tool for managing themes, slides, and enhancements.
Q: What is the Model Context Protocol (MCP)? A: MCP is a protocol that allows applications to interact with specialized servers, like this PowerPoint server, to perform specific tasks. This server implements MCP to enable programmatic control over PowerPoint.
A comprehensive MCP (Model Context Protocol) server for PowerPoint manipulation using python-pptx. Version 2.0 provides 32 powerful tools organized into 11 specialized modules, offering complete PowerPoint creation, management, and professional design capabilities. The server features a modular architecture with enhanced parameter handling, intelligent operation selection, and comprehensive error handling.
To install PowerPoint Manipulation Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @GongRzhe/Office-PowerPoint-MCP-Server --client claude
The easiest way to set up the PowerPoint MCP Server is using the provided setup script, which automates the installation process:
python setup_mcp.py
This script will:
The script offers different paths based on your environment:
uvx
installed, it will configure using UVX (recommended)Clone the repository:
git clone https://github.com/GongRzhe/Office-PowerPoint-MCP-Server.git
cd Office-PowerPoint-MCP-Server
Install dependencies:
pip install -r requirements.txt
Make the server executable:
chmod +x ppt_mcp_server.py
Display help text:
python ppt_mcp_server.py -h
Run the stdio server:
python ppt_mcp_server.py
Run the streamable-http server on port 8000:
python ppt_mcp_server.py --transport http --port 8000
Run in Docker
docker build -t ppt_mcp_server .
docker run -d --rm -p 8000:8000 ppt_mcp_server -t http
Add the server to your MCP settings configuration file:
{
"mcpServers": {
"ppt": {
"command": "python",
"args": ["/path/to/ppt_mcp_server.py"],
"env": {}
}
}
}
If you have uvx
installed, you can run the server directly from PyPI without local installation:
{
"mcpServers": {
"ppt": {
"command": "uvx",
"args": [
"--from", "office-powerpoint-mcp-server", "ppt_mcp_server"
],
"env": {}
}
}
}
The server provides 32 specialized tools organized into the following categories:
manage_text
- All-in-One Text Management# Add text box
manage_text(slide_index=0, operation="add", text="Hello World", font_size=24)
# Format existing text
manage_text(slide_index=0, operation="format", shape_index=0, bold=True, color=[255,0,0])
# Validate text fit with auto-fix
manage_text(slide_index=0, operation="validate", shape_index=0, validation_only=False)
manage_image
- Complete Image Handling# Add image with enhancement
manage_image(slide_index=0, operation="add", image_source="logo.png",
enhancement_style="presentation")
# Enhance existing image
manage_image(slide_index=0, operation="enhance", image_source="photo.jpg",
brightness=1.2, contrast=1.1, saturation=1.3)
apply_picture_effects
- Multiple Effects in One Call# Apply combined effects
apply_picture_effects(slide_index=0, shape_index=0, effects={
"shadow": {"blur_radius": 4.0, "color": [128,128,128]},
"glow": {"size": 5.0, "color": [0,176,240]},
"rotation": {"rotation": 15.0}
})
apply_professional_design
- Theme & Design Management# Add professional slide
apply_professional_design(operation="slide", slide_type="title_content",
color_scheme="modern_blue", title="My Presentation")
# Apply theme to entire presentation
apply_professional_design(operation="theme", color_scheme="corporate_gray")
# Enhance existing slide
apply_professional_design(operation="enhance", slide_index=0, color_scheme="elegant_green")
# Create a new presentation
result = use_mcp_tool(
server_name="ppt",
tool_name="create_presentation",
arguments={}
)
presentation_id = result["presentation_id"]
# Add a title slide
result = use_mcp_tool(
server_name="ppt",
tool_name="add_slide",
arguments={
"layout_index": 0, # Title slide layout
"title": "My Presentation",
"presentation_id": presentation_id
}
)
slide_index = result["slide_index"]
# Populate subtitle placeholder
result = use_mcp_tool(
server_name="ppt",
tool_name="populate_placeholder",
arguments={
"slide_index": slide_index,
"placeholder_idx": 1, # Subtitle placeholder
"text": "Created with PowerPoint MCP Server",
"presentation_id": presentation_id
}
)
# Save the presentation
result = use_mcp_tool(
server_name="ppt",
tool_name="save_presentation",
arguments={
"file_path": "my_presentation.pptx",
"presentation_id": presentation_id
}
)
# Create a professional slide with modern styling - CONSOLIDATED TOOL
result = use_mcp_tool(
server_name="ppt",
tool_name="apply_professional_design",
arguments={
"operation": "slide",
"slide_type": "title_content",
"color_scheme": "modern_blue",
"title": "Quarterly Business Review",
"content": [
"Revenue increased by 15% compared to last quarter",
"Customer satisfaction scores reached all-time high of 94%",
"Successfully launched 3 new product features",
"Expanded team by 12 new talented professionals"
]
}
)
# Apply professional theme to entire presentation - SAME TOOL, DIFFERENT OPERATION
result = use_mcp_tool(
server_name="ppt",
tool_name="apply_professional_design",
arguments={
"operation": "theme",
"color_scheme": "modern_blue",
"apply_to_existing": True
}
)
# Add slide with gradient background - ENHANCED ADD_SLIDE
result = use_mcp_tool(
server_name="ppt",
tool_name="add_slide",
arguments={
"layout_index": 0,
"background_type": "professional_gradient",
"color_scheme": "modern_blue",
"gradient_direction": "diagonal"
}
)
# List all available slide templates with their features
result = use_mcp_tool(
server_name="ppt",
tool_name="list_slide_templates",
arguments={}
)
# Apply a professional template to an existing slide
result = use_mcp_tool(
server_name="ppt",
tool_name="apply_slide_template",
arguments={
"slide_index": 0,
"template_id": "title_slide",
"color_scheme": "modern_blue",
"content_mapping": {
"title": "Quarterly Business Review",
"subtitle": "Q4 2024 Results",
"author": "Leadership Team"
}
}
)
# Create a new slide using a template
result = use_mcp_tool(
server_name="ppt",
tool_name="create_slide_from_template",
arguments={
"template_id": "text_with_image",
"color_scheme": "elegant_green",
"content_mapping": {
"title": "Our Revolutionary Solution",
"content": "• 250% increase in efficiency\n• 98% customer satisfaction\n• Industry-leading performance"
},
"image_paths": {
"supporting": "path/to/product_image.jpg"
}
}
)
# Generate a complete presentation from multiple templates
result = use_mcp_tool(
server_name="ppt",
tool_name="create_presentation_from_templates",
arguments={
"template_sequence": [
{
"template_id": "title_slide",
"content": {
"title": "2024 Annual Report",
"subtitle": "Growth and Innovation",
"author": "Executive Team"
}
},
{
"template_id": "key_metrics_dashboard",
"content": {
"metric_1_value": "94%",
"metric_2_value": "$2.4M",
"metric_3_value": "247"
}
},
{
"template_id": "before_after_comparison",
"content": {
"content_left": "Manual processes taking hours",
"content_right": "Automated workflows in minutes"
}
}
],
"color_scheme": "modern_blue"
}
)
# Add image with automatic enhancement - CONSOLIDATED TOOL
result = use_mcp_tool(
server_name="ppt",
tool_name="manage_image",
arguments={
"slide_index": 1,
"operation": "add",
"image_source": "company_logo.png",
"left": 1.0,
"top": 1.0,
"width": 3.0,
"height": 2.0,
"enhancement_style": "presentation"
}
)
# Apply multiple picture effects at once - CONSOLIDATED TOOL
result = use_mcp_tool(
server_name="ppt",
tool_name="apply_picture_effects",
arguments={
"slide_index": 1,
"shape_index": 0,
"effects": {
"shadow": {
"shadow_type": "outer",
"blur_radius": 4.0,
"distance": 3.0,
"direction": 315.0,
"color": [128, 128, 128],
"transparency": 0.6
},
"glow": {
"size": 5.0,
"color": [0, 176, 240],
"transparency": 0.4
}
}
}
)
# Add and format text in one operation - CONSOLIDATED TOOL
result = use_mcp_tool(
server_name="ppt",
tool_name="manage_text",
arguments={
"slide_index": 0,
"operation": "add",
"left": 1.0,
"top": 2.0,
"width": 8.0,
"height": 1.5,
"text": "Welcome to Our Quarterly Review",
"font_size": 32,
"font_name": "Segoe UI",
"bold": True,
"color": [0, 120, 215],
"alignment": "center",
"auto_fit": True
}
)
# Validate and fix text fit issues - SAME TOOL, DIFFERENT OPERATION
result = use_mcp_tool(
server_name="ppt",
tool_name="manage_text",
arguments={
"slide_index": 0,
"operation": "validate",
"shape_index": 0,
"validation_only": False, # Auto-fix enabled
"min_font_size": 10,
"max_font_size": 48
}
)
# First, inspect a template to see its layouts and properties
result = use_mcp_tool(
server_name="ppt",
tool_name="get_template_info",
arguments={
"template_path": "company_template.pptx"
}
)
template_info = result
# Create a new presentation from the template
result = use_mcp_tool(
server_name="ppt",
tool_name="create_presentation_from_template",
arguments={
"template_path": "company_template.pptx"
}
)
presentation_id = result["presentation_id"]
# Add a slide using one of the template's layouts
result = use_mcp_tool(
server_name="ppt",
tool_name="add_slide",
arguments={
"layout_index": 1, # Use layout from template
"title": "Quarterly Report",
"presentation_id": presentation_id
}
)
# Save the presentation
result = use_mcp_tool(
server_name="ppt",
tool_name="save_presentation",
arguments={
"file_path": "quarterly_report.pptx",
"presentation_id": presentation_id
}
)
# Add a chart slide
result = use_mcp_tool(
server_name="ppt",
tool_name="add_slide",
arguments={
"layout_index": 1, # Content slide layout
"title": "Sales Data",
"presentation_id": presentation_id
}
)
slide_index = result["slide_index"]
# Add a column chart with comprehensive customization
result = use_mcp_tool(
server_name="ppt",
tool_name="add_chart",
arguments={
"slide_index": slide_index,
"chart_type": "column",
"left": 1.0,
"top": 2.0,
"width": 8.0,
"height": 4.5,
"categories": ["Q1", "Q2", "Q3", "Q4"],
"series_names": ["2023", "2024"],
"series_values": [
[100, 120, 140, 160],
[110, 130, 150, 170]
],
"has_legend": True,
"legend_position": "bottom",
"has_data_labels": True,
"title": "Quarterly Sales Performance",
"presentation_id": presentation_id
}
)
# Validate text fit and get optimization suggestions - USING CONSOLIDATED TOOL
result = use_mcp_tool(
server_name="ppt",
tool_name="manage_text",
arguments={
"slide_index": 0,
"operation": "validate",
"shape_index": 0,
"text": "This is a very long title that might not fit properly in the designated text box area",
"font_size": 24,
"validation_only": True
}
)
# Comprehensive slide validation with automatic fixes - SAME TOOL, AUTO-FIX ENABLED
result = use_mcp_tool(
server_name="ppt",
tool_name="manage_text",
arguments={
"slide_index": 0,
"operation": "validate",
"shape_index": 0,
"validation_only": False, # Auto-fix enabled
"min_font_size": 10,
"max_font_size": 48
}
)
The PowerPoint MCP Server provides comprehensive template support for creating presentations from existing template files. This feature enables:
.pptx
and .potx
filesPPT_TEMPLATE_PATH
environment variable./templates
, ./assets
, ./resources
Set the PPT_TEMPLATE_PATH
environment variable to specify custom template directories:
# Unix/Linux/macOS
export PPT_TEMPLATE_PATH="/path/to/templates:/another/path"
# Windows
set PPT_TEMPLATE_PATH="C:\templates;C:\company_templates"
get_template_info
to analyze available layouts and propertiescreate_presentation_from_template
with automatic theme preservationThe server includes 4 built-in professional color schemes:
Each scheme includes primary, secondary, accent, light, and text colors optimized for business presentations.
The PowerPoint MCP Server now includes 25 professional slide templates with advanced dynamic features. All templates support:
title_slide
- Dynamic title slide with gradient background and text effectschapter_intro
- Section divider with chapter numbering and stylingthank_you_slide
- Closing slide with contact information and effectstext_with_image
- Text content with stylized image and interactive elementstwo_column_text
- Two equal columns of text with dynamic sizingtwo_column_text_images
- Two columns with text and corresponding imagesthree_column_layout
- Three equal columns with text and imagesfull_image_slide
- Large background image with text overlaykey_metrics_dashboard
- Interactive metrics dashboard with animated countersbefore_after_comparison
- Dynamic comparison layout with visual dividerschart_comparison
- Two charts side by side for performance comparisondata_table_slide
- Slide focused on tabular data with professional stylingtimeline_slide
- Horizontal timeline with milestones and effectsprocess_flow
- Step-by-step process visualization with enhanced effectsagenda_slide
- Table of contents or agenda overview with stylingquote_testimonial
- Featured quote or customer testimonial with effectsteam_introduction
- Team member showcase with photos and roles# Browse all available templates
templates = use_mcp_tool("ppt", "list_slide_templates", {})
# Key templates with their features:
{
"title_slide": {
"features": ["Dynamic text sizing", "Gradient backgrounds", "Text effects"],
"elements": ["title", "subtitle", "author", "decorative_accent"]
},
"key_metrics_dashboard": {
"features": ["Animated counters", "Gradient containers", "Trend visualization"],
"elements": ["3 metric containers", "trend chart", "insights callout"]
},
"before_after_comparison": {
"features": ["Split gradient background", "VS divider", "Improvement arrow"],
"elements": ["before/after headers", "comparison content", "improvement metrics"]
}
}
All templates work seamlessly with the 4 professional color schemes:
Templates automatically adjust to content:
Office-PowerPoint-MCP-Server/
├── ppt_mcp_server.py # Main consolidated server (v2.0)
├── slide_layout_templates.json # 25+ professional slide templates with dynamic features
├── tools/ # 11 specialized tool modules (32 tools total)
│ ├── __init__.py
│ ├── presentation_tools.py # Presentation management (7 tools)
│ ├── content_tools.py # Content & slides (6 tools)
│ ├── template_tools.py # Template operations (7 tools)
│ ├── structural_tools.py # Tables, shapes, charts (4 tools)
│ ├── professional_tools.py # Themes, effects, fonts (3 tools)
│ ├── hyperlink_tools.py # Hyperlink management (1 tool)
│ ├── chart_tools.py # Advanced chart operations (1 tool)
│ ├── connector_tools.py # Connector lines/arrows (1 tool)
│ ├── master_tools.py # Slide master management (1 tool)
│ └── transition_tools.py # Slide transitions (1 tool)
├── utils/ # 7 organized utility modules (68+ functions)
│ ├── __init__.py
│ ├── core_utils.py # Error handling & safe operations
│ ├── presentation_utils.py # Presentation management utilities
│ ├── content_utils.py # Content & slide operations
│ ├── design_utils.py # Themes, colors, effects & fonts
│ ├── template_utils.py # Template management & dynamic features
│ └── validation_utils.py # Text & layout validation
├── setup_mcp.py # Interactive setup script
├── pyproject.toml # Updated for v2.0
└── README.md # This documentation
Enhanced functionality with comprehensive tool coverage! The updated server provides:
manage_hyperlinks
- Complete hyperlink management for text elementsupdate_chart_data
- Advanced chart data replacement and updatingadd_connector
- Connector lines and arrows between slide elementsmanage_slide_masters
- Access to slide master properties and layoutsmanage_slide_transitions
- Basic slide transition managementauto_generate_presentation
- AI-powered presentation generationoptimize_slide_text
- Text optimization for better readabilitymanage_text
- Now supports text run formatting with format_runs
operationcreate_presentation_from_templates
- Enhanced template sequence processingapply_picture_effects
- Expanded effect combinations and optionsMIT
Reviews feature coming soon
Stay tuned for community discussions and feedback