Okppt
@NeekChaw
Okppt について
这个项目是一个基于MCP (Model Context Protocol) 的服务器工具,名为 "MCP OKPPT Server"。它的核心功能是允许大型语言模型(如Claude、GPT等)通过生成SVG图像来间接设计和创建PowerPoint演示文稿。工具负责将这些SVG图像高质量地插入到PPTX幻灯片中,并保留其矢量特性,确保图像在PowerPoint中可缩放且清晰。
基本情報
設定
以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。
{
"mcpServers": {
"okppt": {
"command": "uvx",
"args": [
"mcp-server-okppt"
]
}
}
}ツール
14将SVG图像插入到PPTX文件的指定位置。(如果需要替换已有的幻灯片,请组合使用`delete_slide`和`insert_blank_slide`功能) 如果未提供PPTX路径,将自动创建一个临时文件,位于服务器同级目录的tmp目录。 如果未提供输出路径,将使用标准输出目录,位于服务器同级目录的output目录。 如果未提供坐标,默认对齐幻灯片左上角。 如果未提供宽度和高度,默认覆盖整个幻灯片(16:9)。 支持批量处理: - 如果svg_path是单个字符串数组,则将SVG添加到slide_number指定的页面 - 如果svg_path是列表,则从slide_number开始顺序添加每个SVG,即第一个SVG添加到 slide_number页,第二个添加到slide_number+1页,依此类推 Args: pptx_path: PPTX文件路径,如果未提供则自动创建一个临时文件,最好使用英文路径 svg_path: SVG文件路径或SVG文件路径列表,最好使用英文路径 slide_number: 起始幻灯片编号(从1开始) x_inches: X坐标(英寸),如果未指定则默认为0 y_inches: Y坐标(英寸),如果未指定则默认为0 width_inches: 宽度(英寸),如果未指定则使用幻灯片宽度 height_inches: 高度(英寸),如果未指定则根据宽度计算或使用幻灯片高度 output_path: 输出文件路径,如果未指定则使用标准输出目录 create_if_not_exists: 如果为True且PPTX文件不存在,将自动创建一个新文件 Returns: 操作结果消息,包含详细的错误信息(如果有)
列出目录中的文件,可选按文件类型过滤。 如需查看svg文件是否正确保存,请输入svg文件的保存路径。 Args: directory: 要列出文件的目录路径 file_type: 文件类型过滤,可以是 "svg" 或 "pptx" Returns: 文件列表(每行一个文件)
获取文件信息,如存在状态、大小等。 Args: file_path: 要查询的文件路径 Returns: 文件信息
将SVG文件转换为PNG图像。 Args: svg_path: SVG文件路径 output_path: 输出PNG文件路径,如果未指定则使用相同文件名但扩展名为.png Returns: 操作结果消息
获取PPTX文件的基本信息,包括幻灯片数量。 Args: pptx_path: PPTX文件路径 Returns: 包含文件信息和幻灯片数量的字符串
将SVG代码保存为SVG文件并返回保存的绝对路径。 !!!注意:特殊字符如"&"需要转义为"&" Args: svg_code: SVG代码内容 Returns: 操作结果消息,包含保存的文件路径或错误信息
从PPTX文件中删除指定编号的幻灯片。 !!!注意: 在使用SVG替换PPT幻灯片内容时,我们发现了一些关键点,以下是正确替换PPT内容的方法总结: ### 正确替换PPT内容的方法 1. **完全替换法**(最可靠): - 删除需要替换的幻灯片(使用`delete_slide`功能) - 在同一位置插入空白幻灯片(使用`insert_blank_slide`功能) - 将新的SVG内容插入到空白幻灯片(使用`insert_svg`功能) 2. **新文件法**(适合多页修改): - 创建全新的PPT文件 - 将所有需要的SVG(包括已修改的)按顺序插入到新文件中 - 这样可以避免在旧文件上操作导致的混淆和叠加问题 3. **注意事项**: - 直接对现有幻灯片插入SVG会导致新内容叠加在原内容上,而非替换 - 文件名可能会随着多次操作变得过长,影响可读性 - 批量插入SVG时,`svg_path`参数必须是数组形式,即使只有一个文件 - 操作后应检查输出文件以确认修改是否成功 ### 推荐工作流 1. 先保存修改后的SVG内容到文件 2. 创建一个全新的PPT文件 3. 按顺序一次性插入所有SVG(包括已修改和未修改的) 4. 使用简洁直观的文件名 这种方法避免了多步骤操作导致的文件混乱,也能确保每张幻灯片都是干净的、不包含叠加内容的。 Args: pptx_path: PPTX文件路径 slide_number: 要删除的幻灯片编号(从1开始) output_path: 输出文件路径,如果未指定则使用标准输出目录 Returns: 操作结果消息
在PPTX文件的指定位置插入一个空白幻灯片。 !!!注意: 在使用SVG替换PPT幻灯片内容时,我们发现了一些关键点,以下是正确替换PPT内容的方法总结: ### 正确替换PPT内容的方法 1. **完全替换法**(最可靠): - 删除需要替换的幻灯片(使用`delete_slide`功能) - 在同一位置插入空白幻灯片(使用`insert_blank_slide`功能) - 将新的SVG内容插入到空白幻灯片(使用`insert_svg`功能) 2. **新文件法**(适合多页修改): - 创建全新的PPT文件 - 将所有需要的SVG(包括已修改的)按顺序插入到新文件中 - 这样可以避免在旧文件上操作导致的混淆和叠加问题 3. **注意事项**: - 直接对现有幻灯片插入SVG会导致新内容叠加在原内容上,而非替换 - 文件名可能会随着多次操作变得过长,影响可读性 - 批量插入SVG时,`svg_path`参数必须是数组形式,即使只有一个文件 - 操作后应检查输出文件以确认修改是否成功 ### 推荐工作流 1. 先保存修改后的SVG内容到文件 2. 创建一个全新的PPT文件 3. 按顺序一次性插入所有SVG(包括已修改和未修改的) 4. 使用简洁直观的文件名 这种方法避免了多步骤操作导致的文件混乱,也能确保每张幻灯片都是干净的、不包含叠加内容的。 Args: pptx_path: PPTX文件路径 slide_number: 要插入幻灯片的位置编号(从1开始) layout_index: 幻灯片布局索引,默认为6(空白布局) output_path: 输出文件路径,如果未指定则使用标准输出目录 create_if_not_exists: 如果为True且PPTX文件不存在,将自动创建一个新文件 Returns: 操作结果消息
专门用于复制包含SVG图像的幻灯片,确保SVG和相关引用都被正确复制。 此函数使用直接操作PPTX内部XML文件的方式,确保SVG图像及其引用在复制过程中完全保留。 与普通的copy_slide函数相比,此函数特别关注SVG图像的复制,保证SVG的矢量属性在复制后依然可用。 Args: source_pptx_path: 源PPTX文件路径 target_pptx_path: 目标PPTX文件路径,如果为空则创建新文件 source_slide_number: 要复制的源幻灯片页码(从1开始) target_slide_number: 要插入到目标文件的位置(从1开始),如果为None则添加到末尾 output_path: 输出文件路径,如果未指定则使用标准输出目录 create_if_not_exists: 如果为True且目标PPTX文件不存在,将自动创建一个新文件 Returns: 操作结果消息
使用SVG设计宗师角色提示,当用户希望大模型生成或优化ppt时,使用此prompt对用户需求进行细化
Analyzes the layout details of a PowerPoint presentation and returns a JSON string of the analysis.
Inserts a new slide with a specified layout into a presentation and returns a JSON string of the result.
Clears content from placeholders in specified slides of a presentation and returns a JSON string of the result.
Assigns content to a specific placeholder on a specific slide and returns a JSON string of the result.
概要
What is Okppt?
Okppt is an MCP server that inserts SVG images into PowerPoint presentations while preserving vector properties, ensuring high quality and scalability. It enables large language models (e.g., Claude, GPT) to autonomously design PowerPoint slides by generating SVG images and inserting them full-screen.
How to use Okppt?
Install via pip or uv: pip install mcp-server-okppt or uv pip install mcp-server-okppt. Configure in Claude Desktop or Cursor IDE by adding the server configuration to the respective JSON file. Use tools like insert_svg, save_svg_code, convert_svg_to_png, etc., via an MCP client.
Key features of Okppt
- Inserts SVG as true vector graphics into PPTX
- Supports batch processing of multiple SVG files and slides
- Creates new presentations directly from SVG files
- Copies and replaces SVG slides intelligently
- Handles SVG code input and saves as files
- Built-in SVG to PNG conversion
Use cases of Okppt
- AI-generated PowerPoint slides with full design control
- Creating high-quality, scalable vector graphics presentations
- Batch inserting multiple SVGs into existing or new presentations
- Replacing slide content with new SVG designs
- Converting SVG code to editable PPTX slides
FAQ from Okppt
Why does SVG become a bitmap instead of vector after insertion?
Use copy_svg_slide or create_pptx_from_svg functions, which are designed to preserve SVG vector properties.
How to batch process multiple SVG files?
Use insert_svg with a list of SVG paths, or use create_pptx_from_svg to create a presentation with multiple SVGs at once.
Why are filenames long and complex?
Each operation appends a timestamp. Use the "new file method" to create the final file in one step, or specify a concise output filename in the last operation.
「その他」の他のコンテンツ
Inbox Zero AI MCP
elie222The world's best AI personal assistant for email. Open source app to help you reach inbox zero fast.
Reactive Resume
amruthpillaiA one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!
ICSS
chokcoco不止于 CSS
Nginx UI
0xJackyYet another WebUI for Nginx
MCP Registry
modelcontextprotocolA community driven registry service for Model Context Protocol (MCP) servers.
コメント