Office-PowerPoint-MCP-Server
An MCP (Model Context Protocol) server for PowerPoint manipulation using python-pptx. This server provides tools for creating, editing, and manipulating PowerPoint presentations through the MCP protocol.
Features
- Round-trip any Open XML presentation (.pptx file) including all its elements
- Add slides
- Populate text placeholders, for example to create a bullet slide
- Add image to slide at arbitrary position and size
- Add textbox to a slide; manipulate text font size and bold
- Add table to a slide
- Add auto shapes (e.g. polygons, flowchart shapes, etc.) to a slide
- Add and manipulate column, bar, line, and pie charts
- Access and change core document properties such as title and subject
Installation
Prerequisites
- Python 3.6 or higher
- python-pptx
- mcp[cli] (MCP's Python SDK)
Setup
- Install the required packages:
pip install python-pptx mcp[cli]
- Clone or download this repository:
git clone https://github.com/GongRzhe/Office-PowerPoint-MCP-Server.git
cd Office-PowerPoint-MCP-Server
- Make the server executable:
chmod +x ppt_mcp_server.py
Usage
Starting the Server
Run the server:
python ppt_mcp_server.py
MCP Configuration
Add the server to your MCP settings configuration file:
{
"mcpServers": {
"ppt": {
"command": "python",
"args": ["/path/to/ppt_mcp_server.py"],
"env": {}
}
}
}
Available Tools
Presentation Tools
- create_presentation: Create a new PowerPoint presentation
- open_presentation: Open an existing PowerPoint presentation from a file
- save_presentation: Save the current presentation to a file
- get_presentation_info: Get information about the current presentation
- set_core_properties: Set core document properties of the current presentation
Slide Tools
- add_slide: Add a new slide to the current presentation
- get_slide_info: Get information about a specific slide
- populate_placeholder: Populate a placeholder with text
- add_bullet_points: Add bullet points to a placeholder
Text Tools
- add_textbox: Add a textbox to a slide
Image Tools
- add_image: Add an image to a slide
- add_image_from_base64: Add an image from a base64 encoded string to a slide
Table Tools
- add_table: Add a table to a slide
- format_table_cell: Format a table cell
Shape Tools
- add_shape: Add an auto shape to a slide
Chart Tools
- add_chart: Add a chart to a slide
Examples
Creating a New Presentation
# 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
}
)
Adding a Chart
# 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
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",
"presentation_id": presentation_id
}
)
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file office_powerpoint_mcp_server-1.0.0.tar.gz.
File metadata
- Download URL: office_powerpoint_mcp_server-1.0.0.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e76ae9002e7aa6cd72d7dcf6b75c3e56b3cb6a8f9e5a74d8d4eea0c6351a194a
|
|
| MD5 |
083cec012fd1f4d7aeb72796f50ef0db
|
|
| BLAKE2b-256 |
7741ff7ff6ca2cc68a1d93e107a251abb5411ace196b7cff169ffd12e8a3c522
|
File details
Details for the file office_powerpoint_mcp_server-1.0.0-py3-none-any.whl.
File metadata
- Download URL: office_powerpoint_mcp_server-1.0.0-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
133dcb16abe423db686c7503df95a7cde666c572a1bd29b8a46e6bae92412234
|
|
| MD5 |
3b4627df047b21b07dcde1b006d37e8f
|
|
| BLAKE2b-256 |
e98466be6dbb6ff5bf6dc601f874ec1c82959c662ffd07797cb75a0cc97578dd
|