Skip to main content
Glama

PowerPoint MCP Server

Office-PowerPoint-MCP-服务器

一个使用 python-pptx 进行 PowerPoint 操作的 MCP(模型上下文协议)服务器。该服务器提供通过 MCP 协议创建、编辑和操作 PowerPoint 演示文稿的工具。

例子

提示
输出
演示的 GIF -> (./public/demo.mp4)

演示

特征

  • 往返任何 Open XML 演示文稿(.pptx 文件)及其所有元素
  • 添加幻灯片
  • 填充文本占位符,例如创建项目符号幻灯片
  • 将图像以任意位置和大小添加到幻灯片中
  • 在幻灯片中添加文本框;控制文本字体大小和粗体
  • 将表格添加到幻灯片
  • 向幻灯片添加自动形状(例如多边形、流程图形状等)
  • 添加和操作柱形图、条形图、折线图和饼图
  • 访问和更改核心文档属性,例如标题和主题

安装

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 PowerPoint Manipulation Server:

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

先决条件

  • Python 3.10 或更高版本
  • pip 包管理器

安装选项

选项 1:使用安装脚本(推荐)

设置 PowerPoint MCP 服务器的最简单方法是使用提供的安装脚本,该脚本可以自动执行安装过程:

python setup_mcp.py

该脚本将:

  • 检查先决条件
  • 提供安装选项:
    • 从 PyPI 安装(推荐大多数用户使用)
    • 设置本地开发环境
  • 安装所需的依赖项
  • 生成适当的 MCP 配置文件
  • 提供与 Claude Desktop 集成的说明

该脚本根据您的环境提供不同的路径:

  • 如果您安装了uvx ,它将使用 UVX 进行配置(推荐)
  • 如果服务器已经安装,它会提供配置选项
  • 如果服务器未安装,则提供安装方法
选项 2:手动安装
  1. 克隆存储库:
    git clone https://github.com/GongRzhe/Office-PowerPoint-MCP-Server.git cd Office-PowerPoint-MCP-Server
  2. 安装依赖项:
    pip install -r requirements.txt
  3. 使服务器可执行:
    chmod +x ppt_mcp_server.py

用法

启动服务器

运行服务器:

python ppt_mcp_server.py

MCP 配置

选项 1:本地 Python 服务器

将服务器添加到您的 MCP 设置配置文件:

{ "mcpServers": { "ppt": { "command": "python", "args": ["/path/to/ppt_mcp_server.py"], "env": {} } } }
选项 2:使用 UVX(无需本地安装)

如果您已经安装了uvx ,则可以直接从 PyPI 运行服务器,而无需本地安装:

{ "mcpServers": { "ppt": { "command": "uvx", "args": [ "--from", "office-powerpoint-mcp-server", "ppt_mcp_server" ], "env": {} } } }

可用工具

演示工具

  • create_presentation :创建一个新的 PowerPoint 演示文稿
  • open_presentation :从文件打开现有的 PowerPoint 演示文稿
  • save_presentation :将当前演示文稿保存到文件
  • get_presentation_info :获取有关当前演示文稿的信息
  • set_core_properties :设置当前演示文稿的核心文档属性

滑动工具

  • add_slide :向当前演示文稿添加新幻灯片
  • get_slide_info :获取有关特定幻灯片的信息
  • populate_placeholder :用文本填充占位符
  • add_bullet_points :将项目符号添加到占位符

文本工具

  • add_textbox :向幻灯片添加文本框

图像工具

  • add_image :向幻灯片添加图像
  • add_image_from_base64 :将 base64 编码字符串中的图像添加到幻灯片

表格工具

  • add_table :向幻灯片添加表格
  • format_table_cell :格式化表格单元格

形状工具

  • add_shape :向幻灯片添加自动形状

图表工具

  • add_chart :向幻灯片添加图表

示例

创建新的演示文稿

# Create a new presentation result = use_mcp_tool( server_name="ppt", tool_name="create_presentation", arguments={} ) presentation_id = result["presentation_id"] # Add a title slide result = use_mcp_tool( server_name="ppt", tool_name="add_slide", arguments={ "layout_index": 0, # Title slide layout "title": "My Presentation", "presentation_id": presentation_id } ) slide_index = result["slide_index"] # Populate subtitle placeholder result = use_mcp_tool( server_name="ppt", tool_name="populate_placeholder", arguments={ "slide_index": slide_index, "placeholder_idx": 1, # Subtitle placeholder "text": "Created with PowerPoint MCP Server", "presentation_id": presentation_id } ) # Save the presentation result = use_mcp_tool( server_name="ppt", tool_name="save_presentation", arguments={ "file_path": "my_presentation.pptx", "presentation_id": presentation_id } )

添加图表

# Add a chart slide result = use_mcp_tool( server_name="ppt", tool_name="add_slide", arguments={ "layout_index": 1, # Content slide layout "title": "Sales Data", "presentation_id": presentation_id } ) slide_index = result["slide_index"] # Add a column chart result = use_mcp_tool( server_name="ppt", tool_name="add_chart", arguments={ "slide_index": slide_index, "chart_type": "column", "left": 1.0, "top": 2.0, "width": 8.0, "height": 4.5, "categories": ["Q1", "Q2", "Q3", "Q4"], "series_names": ["2023", "2024"], "series_values": [ [100, 120, 140, 160], [110, 130, 150, 170] ], "has_legend": True, "legend_position": "bottom", "has_data_labels": True, "title": "Quarterly Sales", "presentation_id": presentation_id } )

执照

麻省理工学院

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

该服务器支持通过模型上下文协议以编程方式创建和编辑 PowerPoint 演示文稿,支持添加幻灯片、图像、文本框、图表和表格等功能。

  1. 例子
    1. 提示
    2. 输出
    3. 演示的 GIF -> (./public/demo.mp4)
  2. 特征
    1. 安装
      1. 通过 Smithery 安装
      2. 先决条件
      3. 安装选项
    2. 用法
      1. 启动服务器
      2. MCP 配置
    3. 可用工具
      1. 演示工具
      2. 滑动工具
      3. 文本工具
      4. 图像工具
      5. 表格工具
      6. 形状工具
      7. 图表工具
    4. 示例
      1. 创建新的演示文稿
      2. 添加图表
    5. 执照

      Related MCP Servers

      • A
        security
        A
        license
        A
        quality
        Creates and manipulates PowerPoint presentations with capabilities for adding various slide types, generating images, and incorporating tables and charts through natural language commands.
        Last updated -
        11
        24
        Python
        MIT License
        • Apple
      • -
        security
        A
        license
        -
        quality
        A server that provides document processing capabilities using the Model Context Protocol, allowing conversion of documents to markdown, extraction of tables, and processing of document images.
        Last updated -
        6
        Python
        MIT License
        • Linux
        • Apple
      • -
        security
        F
        license
        -
        quality
        A 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 -
        1
        Python
      • A
        security
        A
        license
        A
        quality
        A 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 -
        11
        1
        Python
        MIT License
        • Apple
        • Linux

      View all related MCP servers

      MCP directory API

      We provide all the information about MCP servers via our MCP API.

      curl -X GET 'https://glama.ai/api/mcp/v1/servers/GongRzhe/Office-PowerPoint-MCP-Server'

      If you have feedback or need assistance with the MCP directory API, please join our Discord server