PPTX MCP 服务器
一个基于 FastMCP 的服务器,用于以编程方式创建、编辑和渲染 PowerPoint (PPTX) 演示文稿。支持幻灯片创建、文本和形状插入、图像嵌入以及将幻灯片渲染为 PNG(使用 LibreOffice)。
特征
**创建/清除演示文稿:**开始新的或重置现有的 PPTX 文件。
**添加幻灯片:**插入具有可自定义布局的幻灯片。
**文本和内容:**向幻灯片添加标题、内容和自定义文本框。
**形状:**插入各种各样的 PowerPoint 形状(包括流程图元素)。
**图像:**将图像嵌入幻灯片。
**幻灯片描述:**获取幻灯片内容的文本摘要以供验证。
**幻灯片渲染:**将幻灯片渲染为 PNG 图像(需要 LibreOffice)。
**下载PPTX:**下载生成的演示文稿文件。
要求
Python 3.12+
LibreOffice (用于幻灯片图像渲染;必须单独安装并位于系统 PATH 中)
安装
安装 Python 依赖项:
pip install -r requirements.txt(或者查看
安装 LibreOffice (用于图像渲染):
Linux:
sudo pacman -S libreoffice-fresh或sudo apt install libreofficemacOS:
brew install --cask libreofficeWindows:从 libreoffice.org 下载
用法
启动服务器:
您可以使用环境变量设置服务器的主机和端口:
HOST(默认值:127.0.0.1)PORT(默认值:8000)
例如,要在所有接口和端口 9000 上运行:
或者(使用 FastMCP 进行开发):
API 概述
服务器通过 FastMCP 公开工具和资源,包括:
create_or_clear_presentation(filename)add_slide(filename, layout_index)add_title_and_content(filename, slide_index, title, content)add_textbox(filename, slide_index, text, left_inches, top_inches, width_inches, height_inches, font_size_pt, bold)add_shape(filename, slide_index, shape_type_name, left_inches, top_inches, width_inches, height_inches, text)add_picture(filename, slide_index, image, left_inches, top_inches, width_inches, height_inches)get_slide_content_description(filename, slide_index)get_slide_image(filename, slide_index)(需要 LibreOffice)get_pptx_file(filename)
查看代码以了解完整的参数详细信息和可用的形状类型。
演示文稿和模板
演示文稿保存在
presentations/目录中。您可以在
presentations/templates/中添加自己的模板。
执照
请参阅许可证以了解详情。
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
由 FastMCP 提供支持的服务器,用于以编程方式创建、编辑和渲染 PowerPoint (PPTX) 演示文稿,具有幻灯片创建、内容插入和 PNG 渲染功能。
Related MCP Servers
- AsecurityAlicenseAqualityCreates and manipulates PowerPoint presentations with capabilities for adding various slide types, generating images, and incorporating tables and charts through natural language commands.Last updated -11128MIT License
- -securityFlicense-qualityA Model Context Protocol server that enables AI models to create and manipulate PowerPoint presentations with advanced features like financial charts, formatting, and template management.Last updated -25
- -securityAlicense-qualityA server that enables creating and editing PowerPoint presentations programmatically through the Model Context Protocol, supporting features like adding slides, images, textboxes, charts, and tables.Last updated -1,115MIT License
- AsecurityAlicenseAqualityA server that enables AI assistants to create and edit PowerPoint presentations with features for adding various slide types, tables, charts, and AI-generated images through Stable Diffusion.Last updated -1141MIT License