Office PowerPoint MCP Server

2.0.7 · active · verified Thu Apr 16

The `office-powerpoint-mcp-server` library provides a Flask-based HTTP API server for programmatic manipulation of PowerPoint presentations using `python-pptx`. It exposes endpoints to open, save, add slides, add text boxes, and perform various other operations on PPTX files. The current version is 2.0.7, with updates occurring infrequently as it wraps `python-pptx`.

Common errors

Warnings

Install

Imports

Quickstart

This example demonstrates how to start the `office-powerpoint-mcp-server` programmatically using `subprocess`, verify its reachability, and then stop it. In a typical use case, you would run the server in a separate process or container and then interact with its HTTP API endpoints using a client library (e.g., `requests`) or `curl`.

import subprocess
import time
import requests

print("Starting Office PowerPoint MCP Server...")
# Use a non-default port to reduce conflict chances for example
server_process = subprocess.Popen(['python', '-m', 'office_powerpoint_mcp_server', '--host', '127.0.0.1', '--port', '5001'])

server_url = "http://127.0.0.1:5001"

try:
    print(f"Server started. Waiting 5 seconds to ensure it's up on {server_url}...")
    time.sleep(5) # Give the server time to start
    
    # Test if the server is reachable
    try:
        response = requests.get(server_url)
        response.raise_for_status() # Raise an HTTPError for bad responses (4xx or 5xx)
        print(f"Server is reachable! Response: {response.text}")
    except requests.exceptions.ConnectionError:
        print("Error: Could not connect to the server. It might not have started correctly.")
    except requests.exceptions.RequestException as e:
        print(f"An unexpected error occurred: {e}")
        
    print(f"You can now send HTTP requests to its API endpoints, e.g., POST to {server_url}/open or {server_url}/save")
    print("To stop the server, interrupt this script (Ctrl+C).")
    # In a real scenario, you'd make various HTTP requests here to manipulate PowerPoint files.
    input("Press Enter to stop the server...") # Keep process alive until user input
finally:
    print("Stopping server...")
    server_process.terminate()
    server_process.wait()
    print("Server stopped.")

view raw JSON →