Skip to content
Back to search

Office-PowerPoint-MCP-Server

A 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.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/gongrzhe--office-powerpoint-mcp-server/badge.svg)](/listings/gongrzhe--office-powerpoint-mcp-server)

HTML

<a href="/listings/gongrzhe--office-powerpoint-mcp-server"><img src="/api/listings/gongrzhe--office-powerpoint-mcp-server/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Installing via Smithery

To install PowerPoint Manipulation Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@GongRzhe/Office-PowerPoint-MCP-Server):

npx -y @smithery/cli install @GongRzhe/Office-PowerPoint-MCP-Server --client claude

Prerequisites

- Python 3.6 or higher (as specified in pyproject.toml) - pip package manager - Optional: uvx for package execution without local installation

Installation Options

Option 1: Using the Setup Script (Recommended)

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: - Check prerequisites - Offer installation options: - Install from PyPI (recommended for most users) - Set up local development environment - Install required dependencies - Generate the appropriate MCP configuration file - Provide instructions for integrating with Claude Desktop

The script offers different paths based on your environment: - If you have `uvx` installed, it will configure using UVX (recommended) - If the server is already installed, it provides configuration options - If the server is not installed, it offers installation methods

Option 2: Manual Installation

1. Clone the repository:

   git clone https://github.com/GongRzhe/Office-PowerPoint-MCP-Server.git
   cd Office-PowerPoint-MCP-Server

2. Install dependencies:

   pip install -r requirements.txt

3. Make the server executable:

   chmod +x ppt_mcp_server.py

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 986 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Office-PowerPoint-MCP-Server
  2. [![smithery badge](https://smithery.ai/badge/@GongRzhe/Office-PowerPoint-MCP-Server)](https://smithery.ai/server/@GongRzhe/Office-PowerPoint-MCP-Server)
  3. ![](https://badge.mcpx.dev?type=server 'MCP Server')
  4. 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.
  5. ----
  6. # **Not so ugly anymore with new slide_layout_templates**
  7. <img width="1509" alt="截屏2025-06-20 15 53 45" src="https://github.com/user-attachments/assets/197d82cb-017a-4c00-b969-6e40440ffa36" />
  8. ----
  9. ### Example
  10. #### Prompt
  11. <img width="1280" alt="650f4cc5d0f1ea4f3b1580800cb0deb" src="https://github.com/user-attachments/assets/90633c97-f373-4c85-bc9c-a1d7b891c344" />
  12. #### Output
  13. <img width="1640" alt="084f1cf4bc7e4fcd4890c8f94f536c1" src="https://github.com/user-attachments/assets/420e63a0-15a4-46d8-b149-1408d23af038" />
  14. #### Demo's GIF -> (./public/demo.mp4)
  15. ![demo](./public/demo.gif)
  16. ## Features
  17. ### Core PowerPoint Operations
  18. - **Round-trip support** for any Open XML presentation (.pptx file) including all elements
  19. - **Template support** with automatic theme and layout preservation
  20. - **Multi-presentation management** with global state tracking
  21. - **Core document properties** management (title, subject, author, keywords, comments)
  22. ### Content Creation & Management
  23. - **Slide management** with flexible layout selection
  24. - **Text manipulation** with placeholder population and bullet point creation
  25. - **Advanced text formatting** with font, color, alignment, and style controls
  26. - **Text validation** with automatic fit checking and optimization suggestions
  27. ### Visual Elements
  28. - **Image handling** with file and base64 input support
  29. - **Image enhancement** using Pillow with brightness, contrast, saturation, and filter controls
  30. - **Professional image effects** including shadows, reflections, glows, and soft edges
  31. - **Shape creation** with 20+ auto shape types (rectangles, ovals, flowchart elements, etc.)
  32. - **Table creation** with advanced cell formatting and styling
  33. ### Charts & Data Visualization
  34. - **Chart support** for column, bar, line, and pie charts
  35. - **Data series management** with categories and multiple series support
  36. - **Chart formatting** with legends, data labels, and titles
  37. ### Professional Design Features
  38. - **4 professional color schemes** (Modern Blue, Corporate Gray, Elegant Green, Warm Red)
  39. - **Professional typography** with Segoe UI font family and size presets
  40. - **Theme application** with automatic styling across presentations
  41. - **Gradient backgrounds** with customizable directions and color schemes
  42. - **Slide enhancement** tools for existing content
  43. - **25 built-in slide templates** with dynamic sizing and visual effects
  44. - **Advanced template features** including auto-wrapping, dynamic font sizing, and professional animations
  45. ### Advanced Features
  46. - **Font analysis and optimization** using FontTools
  47. - **Picture effects** with 9 different visual effects (shadow, reflection, glow, bevel, etc.)
  48. - **Comprehensive validation** with automatic error fixing
  49. - **Template search** with configurable directory paths
  50. - **Professional layout calculations** with margin and spacing management
  51. ## Installation
  52. ### Installing via Smithery
  53. To install PowerPoint Manipulation Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@GongRzhe/Office-PowerPoint-MCP-Server):
  54. ```bash
  55. npx -y @smithery/cli install @GongRzhe/Office-PowerPoint-MCP-Server --client claude
  56. ```
  57. ### Prerequisites
  58. - Python 3.6 or higher (as specified in pyproject.toml)
  59. - pip package manager
  60. - Optional: uvx for package execution without local installation
  61. ### Installation Options
  62. #### Option 1: Using the Setup Script (Recommended)
  63. The easiest way to set up the PowerPoint MCP Server is using the provided setup script, which automates the installation process:
  64. ```bash
  65. python setup_mcp.py
  66. ```
  67. This script will:
  68. - Check prerequisites
  69. - Offer installation options:
  70. - Install from PyPI (recommended for most users)
  71. - Set up local development environment
  72. - Install required dependencies
  73. - Generate the appropriate MCP configuration file
  74. - Provide instructions for integrating with Claude Desktop
  75. The script offers different paths based on your environment:
  76. - If you have `uvx` installed, it will configure using UVX (recommended)
  77. - If the server is already installed, it provides configuration options
  78. - If the server is not installed, it offers installation methods
  79. #### Option 2: Manual Installation
  80. 1. Clone the repository:
  81. ```bash
  82. git clone https://github.com/GongRzhe/Office-PowerPoint-MCP-Server.git
  83. cd Office-PowerPoint-MCP-Server
  84. ```
  85. 2. Install dependencies:
  86. ```bash
  87. pip install -r requirements.txt
  88. ```
  89. 3. Make the server executable:
  90. ```bash
  91. chmod +x ppt_mcp_server.py
  92. ```
  93. ## Usage
  94. Display help text:
  95. ```bash
  96. python ppt_mcp_server.py -h
  97. ```
  98. ### Starting the Stdio Server
  99. Run the stdio server:
  100. ```bash
  101. python ppt_mcp_server.py
  102. ```
  103. ### Starting the Streamable-Http Server
  104. Run the streamable-http server on port 8000:
  105. ```bash
  106. python ppt_mcp_server.py --transport http --port 8000
  107. ```
  108. Run in Docker
  109. ```bash
  110. docker build -t ppt_mcp_server .
  111. docker run -d --rm -p 8000:8000 ppt_mcp_server -t http
  112. ```
  113. ### MCP Configuration
  114. #### Option 1: Local Python Server
  115. Add the server to your MCP settings configuration file:
  116. ```json
  117. {
  118. "mcpServers": {
  119. "ppt": {
  120. "command": "python",
  121. "args": ["/path/to/ppt_mcp_server.py"],
  122. "env": {}
  123. }
  124. }
  125. }
  126. ```
  127. #### Option 2: Using UVX (No Local Installation Required)
  128. If you have `uvx` installed, you can run the server directly from PyPI without local installation:
  129. ```json
  130. {
  131. "mcpServers": {
  132. "ppt": {
  133. "command": "uvx",
  134. "args": [
  135. "--from", "office-powerpoint-mcp-server", "ppt_mcp_server"
  136. ],
  137. "env": {}
  138. }
  139. }
  140. }
  141. ```
  142. ## 🚀 What's New in v2.0
  143. ### **Comprehensive Tool Suite (32 Tools)**
  144. - **Complete PowerPoint manipulation** with 34 specialized tools
  145. - **11 organized modules** covering all aspects of presentation creation
  146. - **Enhanced parameter handling** with comprehensive validation
  147. - **Intelligent defaults** and operation-based interfaces
  148. ### **Built-in Slide Templates**
  149. - **25+ professional slide templates** with dynamic features built-in
  150. - **Advanced template system** with auto-generation capabilities
  151. - **Auto-sizing text** that adapts to content length and container size
  152. - **Professional visual effects** including shadows, glows, and gradients
  153. - **Complete presentation generation** from template sequences
  154. ### **Modular Architecture**
  155. - **11 specialized modules**: presentation, content, structural, professional, template, hyperlink, chart, connector, master, and transition tools
  156. - **Better maintainability** with separated concerns
  157. - **Easier extensibility** for adding new features
  158. - **Cleaner code structure** with shared utilities
  159. ## Available Tools
  160. The server provides **34 specialized tools** organized into the following categories:
  161. ### **Presentation Management (7 tools)**
  162. 1. **create_presentation** - Create new presentations
  163. 2. **create_presentation_from_template** - Create from templates with theme preservation
  164. 3. **open_presentation** - Open existing presentations
  165. 4. **save_presentation** - Save presentations to files
  166. 5. **get_presentation_info** - Get comprehensive presentation information
  167. 6. **get_template_file_info** - Analyze template files and layouts
  168. 7. **set_core_properties** - Set document properties
  169. ### **Content Management (8 tools)**
  170. 8. **add_slide** - Add slides with optional background styling
  171. 9. **get_slide_info** - Get detailed slide information
  172. 10. **extract_slide_text** - ✨ **NEW** Extract all text content from a specific slide
  173. 11. **extract_presentation_text** - ✨ **NEW** Extract text content from all slides in presentation
  174. 12. **populate_placeholder** - Populate placeholders with text
  175. 13. **add_bullet_points** - Add formatted bullet points
  176. 14. **manage_text** - ✨ **Unified text tool** (add/format/validate/format_runs)
  177. 15. **manage_image** - ✨ **Unified image tool** (add/enhance)
  178. ### **Template Operations (7 tools)**
  179. 16. **list_slide_templates** - Browse available slide layout templates
  180. 17. **apply_slide_template** - Apply structured layout templates to existing slides
  181. 18. **create_slide_from_template** - Create new slides using layout templates
  182. 19. **create_presentation_from_templates** - Create complete presentations from template sequences
  183. 20. **get_template_info** - Get detailed information about specific templates
  184. 21. **auto_generate_presentation** - Automatically generate presentations based on topic
  185. 22. **optimize_slide_text** - Optimize text elements for better readability and fit
  186. ### **Structural Elements (4 tools)**
  187. 23. **add_table** - Create tables with enhanced formatting
  188. 24. **format_table_cell** - Format individual table cells
  189. 25. **add_shape** - Add shapes with text and formatting options
  190. 26. **add_chart** - Create charts with comprehensive customization
  191. ### **Professional Design (3 tools)**
  192. 27. **apply_professional_design** - ✨ **Unified design tool** (themes/slides/enhancement)
  193. 28. **apply_picture_effects** - ✨ **Unified effects tool** (9+ effects combined)
  194. 29. **manage_fonts** - ✨ **Unified font tool** (analyze/optimize/recommend)
  195. ### **Specialized Features (5 tools)**
  196. 30. **manage_hyperlinks** - Complete hyperlink management (add/remove/list/update)
  197. 31. **manage_slide_masters** - Access and manage slide master properties and layouts
  198. 32. **add_connector** - Add connector lines/arrows between points on slides
  199. 33. **update_chart_data** - Replace existing chart data with new categories and series
  200. 34. **manage_slide_transitions** - Basic slide transition management
  201. ## 🌟 Key Unified Tools
  202. ### **`manage_text`** - All-in-One Text Management
  203. ```python
  204. # Add text box
  205. manage_text(slide_index=0, operation="add", text="Hello World", font_size=24)
  206. # Format existing text
  207. manage_text(slide_index=0, operation="format", shape_index=0, bold=True, color=[255,0,0])
  208. # Validate text fit with auto-fix
  209. manage_text(slide_index=0, operation="validate", shape_index=0, validation_only=False)
  210. ```
  211. ### **`manage_image`** - Complete Image Handling
  212. ```python
  213. # Add image with enhancement
  214. manage_image(slide_index=0, operation="add", image_source="logo.png",
  215. enhancement_style="presentation")
  216. # Enhance existing image
  217. manage_image(slide_index=0, operation="enhance", image_source="photo.jpg",
  218. brightness=1.2, contrast=1.1, saturation=1.3)
  219. ```
  220. ### **`apply_picture_effects`** - Multiple Effects in One Call
  221. ```python
  222. # Apply combined effects
  223. apply_picture_effects(slide_index=0, shape_index=0, effects={
  224. "shadow": {"blur_radius": 4.0, "color": [128,128,128]},
  225. "glow": {"size": 5.0, "color": [0,176,240]},
  226. "rotation": {"rotation": 15.0}
  227. })
  228. ```
  229. ### **`apply_professional_design`** - Theme & Design Management
  230. ```python
  231. # Add professional slide
  232. apply_professional_design(operation="slide", slide_type="title_content",
  233. color_scheme="modern_blue", title="My Presentation")
  234. # Apply theme to entire presentation
  235. apply_professional_design(operation="theme", color_scheme="corporate_gray")
  236. # Enhance existing slide
  237. apply_professional_design(operation="enhance", slide_index=0, color_scheme="elegant_green")
  238. ```
  239. ## Examples
  240. ### Creating a New Presentation
  241. ```python
  242. # Create a new presentation
  243. result = use_mcp_tool(
  244. server_name="ppt",
  245. tool_name="create_presentation",
  246. arguments={}
  247. )
  248. presentation_id = result["presentation_id"]
  249. # Add a title slide
  250. result = use_mcp_tool(
  251. server_name="ppt",
  252. tool_name="add_slide",
  253. arguments={
  254. "layout_index": 0, # Title slide layout
  255. "title": "My Presentation",
  256. "presentation_id": presentation_id
  257. }
  258. )
  259. slide_index = result["slide_index"]
  260. # Populate subtitle placeholder
  261. result = use_mcp_tool(
  262. server_name="ppt",
  263. tool_name="populate_placeholder",
  264. arguments={
  265. "slide_index": slide_index,
  266. "placeholder_idx": 1, # Subtitle placeholder
  267. "text": "Created with PowerPoint MCP Server",
  268. "presentation_id": presentation_id
  269. }
  270. )
  271. # Save the presentation
  272. result = use_mcp_tool(
  273. server_name="ppt",
  274. tool_name="save_presentation",
  275. arguments={
  276. "file_path": "my_presentation.pptx",
  277. "presentation_id": presentation_id
  278. }
  279. )
  280. ```
  281. ### Creating a Professional Presentation with v2.0
  282. ```python
  283. # Create a professional slide with modern styling - CONSOLIDATED TOOL
  284. result = use_mcp_tool(
  285. server_name="ppt",
  286. tool_name="apply_professional_design",
  287. arguments={
  288. "operation": "slide",
  289. "slide_type": "title_content",
  290. "color_scheme": "modern_blue",
  291. "title": "Quarterly Business Review",
  292. "content": [
  293. "Revenue increased by 15% compared to last quarter",
  294. "Customer satisfaction scores reached all-time high of 94%",
  295. "Successfully launched 3 new product features",
  296. "Expanded team by 12 new talented professionals"
  297. ]
  298. }
  299. )
  300. # Apply professional theme to entire presentation - SAME TOOL, DIFFERENT OPERATION
  301. result = use_mcp_tool(
  302. server_name="ppt",
  303. tool_name="apply_professional_design",
  304. arguments={
  305. "operation": "theme",
  306. "color_scheme": "modern_blue",
  307. "apply_to_existing": True
  308. }
  309. )
  310. # Add slide with gradient background - ENHANCED ADD_SLIDE
  311. result = use_mcp_tool(
  312. server_name="ppt",
  313. tool_name="add_slide",
  314. arguments={
  315. "layout_index": 0,
  316. "background_type": "professional_gradient",
  317. "color_scheme": "modern_blue",
  318. "gradient_direction": "diagonal"
  319. }
  320. )
  321. ```
  322. ### Working with Built-in Slide Templates (New in v2.0)
  323. ```python
  324. # List all available slide templates with their features
  325. result = use_mcp_tool(
  326. server_name="ppt",
  327. tool_name="list_slide_templates",
  328. arguments={}
  329. )
  330. # Apply a professional template to an existing slide
  331. result = use_mcp_tool(
  332. server_name="ppt",
  333. tool_name="apply_slide_template",
  334. arguments={
  335. "slide_index": 0,
  336. "template_id": "title_slide",
  337. "color_scheme": "modern_blue",
  338. "content_mapping": {
  339. "title": "Quarterly Business Review",
  340. "subtitle": "Q4 2024 Results",
  341. "author": "Leadership Team"
  342. }
  343. }
  344. )
  345. # Create a new slide using a template
  346. result = use_mcp_tool(
  347. server_name="ppt",
  348. tool_name="create_slide_from_template",
  349. arguments={
  350. "template_id": "text_with_image",
  351. "color_scheme": "elegant_green",
  352. "content_mapping": {
  353. "title": "Our Revolutionary Solution",
  354. "content": "• 250% increase in efficiency\n• 98% customer satisfaction\n• Industry-leading performance"
  355. },
  356. "image_paths": {
  357. "supporting": "path/to/product_image.jpg"
  358. }
  359. }
  360. )
  361. # Generate a complete presentation from multiple templates
  362. result = use_mcp_tool(
  363. server_name="ppt",
  364. tool_name="create_presentation_from_templates",
  365. arguments={
  366. "template_sequence": [
  367. {
  368. "template_id": "title_slide",
  369. "content": {
  370. "title": "2024 Annual Report",
  371. "subtitle": "Growth and Innovation",
  372. "author": "Executive Team"
  373. }
  374. },
  375. {
  376. "template_id": "key_metrics_dashboard",
  377. "content": {
  378. "metric_1_value": "94%",
  379. "metric_2_value": "$2.4M",
  380. "metric_3_value": "247"
  381. }
  382. },
  383. {
  384. "template_id": "before_after_comparison",
  385. "content": {
  386. "content_left": "Manual processes taking hours",
  387. "content_right": "Automated workflows in minutes"
  388. }
  389. }
  390. ],
  391. "color_scheme": "modern_blue"
  392. }
  393. )
  394. ```
  395. ### Enhanced Image Management with v2.0
  396. ```python
  397. # Add image with automatic enhancement - CONSOLIDATED TOOL
  398. result = use_mcp_tool(
  399. server_name="ppt",
  400. tool_name="manage_image",
  401. arguments={
  402. "slide_index": 1,
  403. "operation": "add",
  404. "image_source": "company_logo.png",
  405. "left": 1.0,
  406. "top": 1.0,
  407. "width": 3.0,
  408. "height": 2.0,
  409. "enhancement_style": "presentation"
  410. }
  411. )
  412. # Apply multiple picture effects at once - CONSOLIDATED TOOL
  413. result = use_mcp_tool(
  414. server_name="ppt",
  415. tool_name="apply_picture_effects",
  416. arguments={
  417. "slide_index": 1,
  418. "shape_index": 0,
  419. "effects": {
  420. "shadow": {
  421. "shadow_type": "outer",
  422. "blur_radius": 4.0,
  423. "distance": 3.0,
  424. "direction": 315.0,
  425. "color": [128, 128, 128],
  426. "transparency": 0.6
  427. },
  428. "glow": {
  429. "size": 5.0,
  430. "color": [0, 176, 240],
  431. "transparency": 0.4
  432. }
  433. }
  434. }
  435. )
  436. ```
  437. ### Advanced Text Management with v2.0
  438. ```python
  439. # Add and format text in one operation - CONSOLIDATED TOOL
  440. result = use_mcp_tool(
  441. server_name="ppt",
  442. tool_name="manage_text",
  443. arguments={
  444. "slide_index": 0,
  445. "operation": "add",
  446. "left": 1.0,
  447. "top": 2.0,
  448. "width": 8.0,
  449. "height": 1.5,
  450. "text": "Welcome to Our Quarterly Review",
  451. "font_size": 32,
  452. "font_name": "Segoe UI",
  453. "bold": True,
  454. "color": [0, 120, 215],
  455. "alignment": "center",
  456. "auto_fit": True
  457. }
  458. )
  459. # Validate and fix text fit issues - SAME TOOL, DIFFERENT OPERATION
  460. result = use_mcp_tool(
  461. server_name="ppt",
  462. tool_name="manage_text",
  463. arguments={
  464. "slide_index": 0,
  465. "operation": "validate",
  466. "shape_index": 0,
  467. "validation_only": False, # Auto-fix enabled
  468. "min_font_size": 10,
  469. "max_font_size": 48
  470. }
  471. )
  472. ```
  473. ### Creating a Presentation from Template
  474. ```python
  475. # First, inspect a template to see its layouts and properties
  476. result = use_mcp_tool(
  477. server_name="ppt",
  478. tool_name="get_template_info",
  479. arguments={
  480. "template_path": "company_template.pptx"
  481. }
  482. )
  483. template_info = result
  484. # Create a new presentation from the template
  485. result = use_mcp_tool(
  486. server_name="ppt",
  487. tool_name="create_presentation_from_template",
  488. arguments={
  489. "template_path": "company_template.pptx"
  490. }
  491. )
  492. presentation_id = result["presentation_id"]
  493. # Add a slide using one of the template's layouts
  494. result = use_mcp_tool(
  495. server_name="ppt",
  496. tool_name="add_slide",
  497. arguments={
  498. "layout_index": 1, # Use layout from template
  499. "title": "Quarterly Report",
  500. "presentation_id": presentation_id
  501. }
  502. )
  503. # Save the presentation
  504. result = use_mcp_tool(
  505. server_name="ppt",
  506. tool_name="save_presentation",
  507. arguments={
  508. "file_path": "quarterly_report.pptx",
  509. "presentation_id": presentation_id
  510. }
  511. )
  512. ```
  513. ### Adding Advanced Charts and Data Visualization
  514. ```python
  515. # Add a chart slide
  516. result = use_mcp_tool(
  517. server_name="ppt",
  518. tool_name="add_slide",
  519. arguments={
  520. "layout_index": 1, # Content slide layout
  521. "title": "Sales Data",
  522. "presentation_id": presentation_id
  523. }
  524. )
  525. slide_index = result["slide_index"]
  526. # Add a column chart with comprehensive customization
  527. result = use_mcp_tool(
  528. server_name="ppt",
  529. tool_name="add_chart",
  530. arguments={
  531. "slide_index": slide_index,
  532. "chart_type": "column",
  533. "left": 1.0,
  534. "top": 2.0,
  535. "width": 8.0,
  536. "height": 4.5,
  537. "categories": ["Q1", "Q2", "Q3", "Q4"],
  538. "series_names": ["2023", "2024"],
  539. "series_values": [
  540. [100, 120, 140, 160],
  541. [110, 130, 150, 170]
  542. ],
  543. "has_legend": True,
  544. "legend_position": "bottom",
  545. "has_data_labels": True,
  546. "title": "Quarterly Sales Performance",
  547. "presentation_id": presentation_id
  548. }
  549. )
  550. ```
  551. ### Text Validation and Optimization with v2.0
  552. ```python
  553. # Validate text fit and get optimization suggestions - USING CONSOLIDATED TOOL
  554. result = use_mcp_tool(
  555. server_name="ppt",
  556. tool_name="manage_text",
  557. arguments={
  558. "slide_index": 0,
  559. "operation": "validate",
  560. "shape_index": 0,
  561. "text": "This is a very long title that might not fit properly in the designated text box area",
  562. "font_size": 24,
  563. "validation_only": True
  564. }
  565. )
  566. # Comprehensive slide validation with automatic fixes - SAME TOOL, AUTO-FIX ENABLED
  567. result = use_mcp_tool(
  568. server_name="ppt",
  569. tool_name="manage_text",
  570. arguments={
  571. "slide_index": 0,
  572. "operation": "validate",
  573. "shape_index": 0,
  574. "validation_only": False, # Auto-fix enabled
  575. "min_font_size": 10,
  576. "max_font_size": 48
  577. }
  578. )
  579. ```
  580. ### Reading Slide Content with New Text Extraction Tools (v2.1)
  581. ```python
  582. # Extract text content from a specific slide - NEW TOOL
  583. result = use_mcp_tool(
  584. server_name="ppt",
  585. tool_name="extract_slide_text",
  586. arguments={
  587. "slide_index": 0,
  588. "presentation_id": presentation_id
  589. }
  590. )
  591. # The result includes:
  592. {
  593. "success": True,
  594. "slide_index": 0,
  595. "text_content": {
  596. "slide_title": "Quarterly Business Review",
  597. "placeholders": [
  598. {
  599. "shape_index": 1,
  600. "shape_name": "Subtitle Placeholder 2",
  601. "text": "Q4 2024 Results",
  602. "placeholder_type": "SUBTITLE",
  603. "placeholder_idx": 1
  604. }
  605. ],
  606. "text_shapes": [
  607. {
  608. "shape_index": 3,
  609. "shape_name": "TextBox 4",
  610. "text": "Revenue increased by 15%"
  611. }
  612. ],
  613. "table_text": [],
  614. "all_text_combined": "Quarterly Business Review\nQ4 2024 Results\nRevenue increased by 15%"
  615. },
  616. "total_text_shapes": 2,
  617. "has_title": True,
  618. "has_tables": False
  619. }
  620. # Extract text from all slides in the presentation - NEW TOOL
  621. result = use_mcp_tool(
  622. server_name="ppt",
  623. tool_name="extract_presentation_text",
  624. arguments={
  625. "presentation_id": presentation_id,
  626. "include_slide_info": True
  627. }
  628. )
  629. # The result includes comprehensive text extraction:
  630. {
  631. "success": True,
  632. "presentation_id": "pres_123",
  633. "total_slides": 5,
  634. "slides_with_text": 4,
  635. "total_text_shapes": 12,
  636. "slides_with_titles": 3,
  637. "slides_with_tables": 1,
  638. "slides_text": [...], # Detailed per-slide text content
  639. "all_presentation_text_combined": "=== SLIDE 1 ===\nTitle Here\nContent here..."
  640. }
  641. # Extract text without additional slide metadata for cleaner output
  642. result = use_mcp_tool(
  643. server_name="ppt",
  644. tool_name="extract_presentation_text",
  645. arguments={
  646. "presentation_id": presentation_id,
  647. "include_slide_info": False
  648. }
  649. )
  650. ```
  651. ## Template Support
  652. ### Working with Templates
  653. The PowerPoint MCP Server provides comprehensive template support for creating presentations from existing template files. This feature enables:
  654. - **Corporate branding** with predefined themes, layouts, and styles
  655. - **Consistent presentations** across teams and projects
  656. - **Custom slide masters** and specialized layouts
  657. - **Pre-configured properties** and document settings
  658. - **Flexible template discovery** with configurable search paths
  659. ### Template File Requirements
  660. - **Supported formats**: `.pptx` and `.potx` files
  661. - **Existing content**: Templates can contain existing slides (preserved during creation)
  662. - **Layout availability**: All custom layouts and slide masters are accessible
  663. - **Search locations**: Configurable via `PPT_TEMPLATE_PATH` environment variable
  664. - **Default search paths**: Current directory, `./templates`, `./assets`, `./resources`
  665. ### Template Configuration
  666. Set the `PPT_TEMPLATE_PATH` environment variable to specify custom template directories:
  667. ```bash
  668. # Unix/Linux/macOS
  669. export PPT_TEMPLATE_PATH="/path/to/templates:/another/path"
  670. # Windows
  671. set PPT_TEMPLATE_PATH="C:\templates;C:\company_templates"
  672. ```
  673. ### Template Workflow
  674. 1. **Inspect Template**: Use `get_template_info` to analyze available layouts and properties
  675. 2. **Create from Template**: Use `create_presentation_from_template` with automatic theme preservation
  676. 3. **Use Template Layouts**: Reference layout indices from template analysis when adding slides
  677. 4. **Maintain Branding**: Template themes, fonts, and colors are automatically applied to new content
  678. ### Professional Color Schemes
  679. The server includes 4 built-in professional color schemes:
  680. - **Modern Blue**: Microsoft-inspired blue theme with complementary colors
  681. - **Corporate Gray**: Professional grayscale theme with blue accents
  682. - **Elegant Green**: Forest green theme with cream and light green accents
  683. - **Warm Red**: Deep red theme with orange and yellow accents
  684. Each scheme includes primary, secondary, accent, light, and text colors optimized for business presentations.
  685. ## 🎨 Built-in Slide Templates (New in v2.0)
  686. The PowerPoint MCP Server now includes **25 professional slide templates** with advanced dynamic features. All templates support:
  687. ### **Dynamic Features**
  688. - **Automatic text sizing** based on content length and container dimensions
  689. - **Intelligent text wrapping** to fit within specified areas
  690. - **Visual effects** including shadows, glows, and outlines
  691. - **Gradient backgrounds** with multi-layer compositions
  692. - **Professional animations** ready for presentation delivery
  693. - **Interactive hover effects** for enhanced user experience
  694. - **Smart content overflow handling** with automatic adjustments
  695. ### **Available Template Categories**
  696. #### **Title & Introduction Slides**
  697. - `title_slide` - Dynamic title slide with gradient background and text effects
  698. - `chapter_intro` - Section divider with chapter numbering and styling
  699. - `thank_you_slide` - Closing slide with contact information and effects
  700. #### **Content Layout Slides**
  701. - `text_with_image` - Text content with stylized image and interactive elements
  702. - `two_column_text` - Two equal columns of text with dynamic sizing
  703. - `two_column_text_images` - Two columns with text and corresponding images
  704. - `three_column_layout` - Three equal columns with text and images
  705. - `full_image_slide` - Large background image with text overlay
  706. #### **Business & Analytics Slides**
  707. - `key_metrics_dashboard` - Interactive metrics dashboard with animated counters
  708. - `before_after_comparison` - Dynamic comparison layout with visual dividers
  709. - `chart_comparison` - Two charts side by side for performance comparison
  710. - `data_table_slide` - Slide focused on tabular data with professional styling
  711. - `timeline_slide` - Horizontal timeline with milestones and effects
  712. #### **Process & Flow Slides**
  713. - `process_flow` - Step-by-step process visualization with enhanced effects
  714. - `agenda_slide` - Table of contents or agenda overview with styling
  715. - `quote_testimonial` - Featured quote or customer testimonial with effects
  716. #### **Team & Organization Slides**
  717. - `team_introduction` - Team member showcase with photos and roles
  718. ### **Template Usage Examples**
  719. ```python
  720. # Browse all available templates
  721. templates = use_mcp_tool("ppt", "list_slide_templates", {})
  722. # Key templates with their features:
  723. {
  724. "title_slide": {
  725. "features": ["Dynamic text sizing", "Gradient backgrounds", "Text effects"],
  726. "elements": ["title", "subtitle", "author", "decorative_accent"]
  727. },
  728. "key_metrics_dashboard": {
  729. "features": ["Animated counters", "Gradient containers", "Trend visualization"],
  730. "elements": ["3 metric containers", "trend chart", "insights callout"]
  731. },
  732. "before_after_comparison": {
  733. "features": ["Split gradient background", "VS divider", "Improvement arrow"],
  734. "elements": ["before/after headers", "comparison content", "improvement metrics"]
  735. }
  736. }
  737. ```
  738. ### **Color Scheme Integration**
  739. All templates work seamlessly with the 4 professional color schemes:
  740. - **modern_blue**: Microsoft-inspired theme with dynamic gradients
  741. - **corporate_gray**: Professional grayscale with blue accents
  742. - **elegant_green**: Forest green with cream and light accents
  743. - **warm_red**: Deep red with orange and yellow highlights
  744. ### **Dynamic Content Adaptation**
  745. Templates automatically adjust to content:
  746. - **Font sizes** scale based on text length (8pt - 44pt range)
  747. - **Line spacing** adjusts for readability (1.0x - 1.4x)
  748. - **Text wrapping** intelligently breaks lines at optimal points
  749. - **Container sizing** adapts to content overflow
  750. - **Visual effects** scale appropriately with element sizes
  751. ## 📁 File Structure
  752. ```
  753. Office-PowerPoint-MCP-Server/
  754. ├── ppt_mcp_server.py # Main consolidated server (v2.0)
  755. ├── slide_layout_templates.json # 25+ professional slide templates with dynamic features
  756. ├── tools/ # 11 specialized tool modules (32 tools total)
  757. │ ├── __init__.py
  758. │ ├── presentation_tools.py # Presentation management (7 tools)
  759. │ ├── content_tools.py # Content & slides (6 tools)
  760. │ ├── template_tools.py # Template operations (7 tools)
  761. │ ├── structural_tools.py # Tables, shapes, charts (4 tools)
  762. │ ├── professional_tools.py # Themes, effects, fonts (3 tools)
  763. │ ├── hyperlink_tools.py # Hyperlink management (1 tool)
  764. │ ├── chart_tools.py # Advanced chart operations (1 tool)
  765. │ ├── connector_tools.py # Connector lines/arrows (1 tool)
  766. │ ├── master_tools.py # Slide master management (1 tool)
  767. │ └── transition_tools.py # Slide transitions (1 tool)
  768. ├── utils/ # 7 organized utility modules (68+ functions)
  769. │ ├── __init__.py
  770. │ ├── core_utils.py # Error handling & safe operations
  771. │ ├── presentation_utils.py # Presentation management utilities
  772. │ ├── content_utils.py # Content & slide operations
  773. │ ├── design_utils.py # Themes, colors, effects & fonts
  774. │ ├── template_utils.py # Template management & dynamic features
  775. │ └── validation_utils.py # Text & layout validation
  776. ├── setup_mcp.py # Interactive setup script
  777. ├── pyproject.toml # Updated for v2.0
  778. └── README.md # This documentation
  779. ```
  780. ## 🏗️ Architecture Benefits
  781. ### **Modular Design**
  782. - **7 focused utility modules** with clear responsibilities
  783. - **11 organized tool modules** for comprehensive coverage
  784. - **68+ utility functions** organized by functionality
  785. - **32 MCP tools** covering all PowerPoint manipulation needs
  786. - **Clear separation of concerns** for easier development
  787. ### **Code Organization**
  788. - **Logical grouping** of related functionality across modules
  789. - **Better discoverability** with organized tool categories
  790. - **Improved testability** with isolated modules
  791. - **Future extensibility** through modular structure
  792. ### **Comprehensive Coverage**
  793. - **Complete PowerPoint lifecycle** from creation to presentation
  794. - **Advanced template system** with auto-generation capabilities
  795. - **Professional design tools** with multiple effects and styling options
  796. - **Specialized features** including hyperlinks, connectors, and slide masters
  797. ### **Developer Experience**
  798. - **Clear responsibility boundaries** between modules
  799. - **Easier debugging** with smaller, focused files
  800. - **Simpler testing** with isolated functionality
  801. - **Enhanced maintainability** through separation of concerns
  802. ## 🔄 What's New in Version 2.0
  803. **Enhanced functionality with comprehensive tool coverage!** The updated server provides:
  804. ### **New Specialized Tools Added:**
  805. - **`manage_hyperlinks`** - Complete hyperlink management for text elements
  806. - **`update_chart_data`** - Advanced chart data replacement and updating
  807. - **`add_connector`** - Connector lines and arrows between slide elements
  808. - **`manage_slide_masters`** - Access to slide master properties and layouts
  809. - **`manage_slide_transitions`** - Basic slide transition management
  810. - **`auto_generate_presentation`** - AI-powered presentation generation
  811. - **`optimize_slide_text`** - Text optimization for better readability
  812. ### **Enhanced Existing Tools:**
  813. - **`manage_text`** - Now supports text run formatting with `format_runs` operation
  814. - **`create_presentation_from_templates`** - Enhanced template sequence processing
  815. - **`apply_picture_effects`** - Expanded effect combinations and options
  816. ## 🔄 What's New in Version 2.1
  817. **Text extraction capabilities added!** Now you can read content from existing presentations:
  818. ### **New Text Extraction Tools Added:**
  819. - **`extract_slide_text`** - Extract all text content from a specific slide including titles, placeholders, text shapes, and tables
  820. - **`extract_presentation_text`** - Extract text content from all slides in a presentation with comprehensive statistics and combined output
  821. ### **Key Features of Text Extraction:**
  822. - **Complete text coverage** - Extracts from titles, placeholders, text boxes, and table cells
  823. - **Structured output** - Organized by content type (titles, placeholders, shapes, tables)
  824. - **Presentation-wide analysis** - Statistics on text distribution across slides
  825. - **Flexible output options** - Individual slide content or combined presentation text
  826. - **Error handling** - Graceful handling of slides that cannot be processed
  827. ## License
  828. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.