The PPTX MCP Server is a powerful tool that allows you to programmatically create, edit, and render PowerPoint presentations through an API. It leverages FastMCP to provide functionality for creating slides, adding content, inserting shapes and images, and rendering slides as PNG images.
Install Python dependencies:
pip install .
Optional: Install python-dotenv for development environment variables:
pip install python-dotenv
Install LibreOffice (required for image rendering):
sudo pacman -S libreoffice-fresh
or
sudo apt install libreoffice
brew install --cask libreoffice
Start the server with default settings:
python server.py
You can configure the server's host and port in two ways:
HOST=0.0.0.0 PORT=9000 python server.py
Create or edit a .env
file in the project root:
HOST=0.0.0.0
PORT=9000
Then start the server:
python server.py
For development with FastMCP:
fastmcp dev server.py
The server provides the following functionality:
create_or_clear_presentation(filename)
- Create a new or reset an existing presentationget_pptx_file(filename)
- Download the generated presentationadd_slide(filename, layout_index)
- Insert a new slide with the specified layoutget_slide_content_description(filename, slide_index)
- Get a text description of slide contentsget_slide_image(filename, slide_index)
- Render a slide as PNG image (requires LibreOffice)add_title_and_content(filename, slide_index, title, content)
- Add title and content to a slideadd_textbox(filename, slide_index, text, left_inches, top_inches, width_inches, height_inches, font_size_pt, bold)
- Add a custom textboxadd_shape(filename, slide_index, shape_type_name, left_inches, top_inches, width_inches, height_inches, text)
- Insert shapes including flowchart elementsadd_picture(filename, slide_index, image, left_inches, top_inches, width_inches, height_inches)
- Embed images into slidespresentations/
directorypresentations/templates/
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.