PowerPoint Automation
STDIOMCP server for comprehensive PowerPoint automation using python-pptx library
MCP server for comprehensive PowerPoint automation using python-pptx library
A Model Context Protocol (MCP) server that provides comprehensive PowerPoint automation capabilities using python-pptx. This server enables AI assistants to create, modify, and manage PowerPoint presentations programmatically.
https://github.com/user-attachments/assets/3daf3bef-4d75-4639-a891-0e64b80b4807
git clone https://github.com/buckylee2019/powerpoint-automation-mcp.git cd powerpoint-automation-mcp uv sync
uv run --directory /path/to/powerpoint-automation-mcp mcp-ppt-server
The server provides 25+ tools for comprehensive PowerPoint automation. All operations work with a single active presentation to simplify the API.
initialize_powerpoint() -> boolInitialize the PowerPoint automation system.
create_presentation(template: str = None) -> DictCreate a new presentation, optionally from a template.
template: Optional path to template fileopen_presentation(file_path: str) -> DictOpen an existing PowerPoint file.
file_path: Full path to .pptx fileget_presentation() -> DictGet information about the currently active presentation.
save_presentation(path: str = None) -> DictSave the active presentation.
path: Optional save path (uses current path if omitted)close_presentation() -> DictClose the active presentation.
get_slides() -> List[Dict]Get list of all slides with metadata.
add_slide(layout_index: int = 1) -> DictAdd a new slide with specified layout.
layout_index: Layout type (0=Title, 1=Title+Content, etc.)delete_slide(slide_index: int) -> DictDelete a slide from the presentation.
slide_index: 0-based slide indexget_slide_layouts() -> DictGet all available slide layouts with their properties.
set_slide_title(slide_index: int, title: str) -> DictSet the title of a slide.
get_slide_shapes(slide_index: int) -> DictALWAYS RUN FIRST! Get all shapes in a slide with properties and IDs.
get_slide_text(slide_index: int) -> DictGet all text content in a slide organized by shape.
update_text(slide_index: int, shape_index: int, text: str, font_name: str = None, font_size: int = None, bold: bool = None, italic: bool = None, preserve_existing: bool = True) -> DictUpdate text content with optional formatting.
preserve_existing: Keep original formatting for unspecified propertiesupdate_shape_by_id(slide_index: int, shape_id: str, text: str = None, left: float = None, top: float = None, width: float = None, height: float = None) -> DictUpdate shape properties by ID.
add_textbox(slide_index: int, text: str, left: float = 1, top: float = 1, width: float = 4, height: float = 2) -> DictAdd a text box to a slide.
add_image(slide_index: int, image_path: str, left: float = 1, top: float = 1, width: float = None, height: float = None) -> DictAdd an image to a slide.
add_table(slide_index: int, rows: int, cols: int, left: float = 1, top: float = 1, width: float = 8, height: float = 4) -> DictAdd a table to a slide.
add_chart(slide_index: int, chart_type: str, categories: List[str], series_names: List[str], series_values: List[List[float]], left: float = 1, top: float = 1, width: float = 8, height: float = 4, has_legend: bool = True) -> DictAdd a chart with multiple data series.
chart_type: 'COLUMN', 'LINE', 'PIE', 'BAR'categories: X-axis labelsseries_names: Legend labelsseries_values: Data values for each seriesupdate_table_cell(slide_index: int, shape_index: int, row: int, col: int, text: str) -> DictUpdate text in a specific table cell.
get_table_content(slide_index: int, shape_index: int) -> DictRetrieve all content from a table.
ungroup_shapes(slide_index: int) -> DictUngroup all text-containing groups in a slide.
initialize_powerpoint()open_presentation() or create_presentation()get_slide_shapes() first to understand slide structureungroup_shapes() if grouped shapes are detectedsave_presentation() to persist changesAll functions return dictionaries with either success data or error information:
// Success response { "success": true, "message": "Operation completed", "data": {...} } // Error response { "error": "Description of what went wrong" }
Add to your MCP settings:
{ "mcpServers": { "powerpoint-automation": { "command": "uv", "args": [ "run", "--directory", "/path/to/powerpoint-automation-mcp", "mcp-ppt-server" ] } } }
python-pptx: PowerPoint file manipulationmcp: Model Context Protocol frameworkfastmcp: Simplified MCP server creationMIT License - see LICENSE file for details.