PPTX MCP Server

by samos123
Apache 2.0
7
  • Linux
  • Apple

Integrations

  • Used for rendering PowerPoint slides as PNG images, enabling visual export of presentation content for preview or sharing purposes.

  • Leverages Python libraries like python-pptx for programmatically creating and manipulating PowerPoint presentations, enabling slide creation, content insertion, and presentation formatting.

PPTX MCP 服务器

一个基于 FastMCP 的服务器,用于以编程方式创建、编辑和渲染 PowerPoint (PPTX) 演示文稿。支持幻灯片创建、文本和形状插入、图像嵌入以及将幻灯片渲染为 PNG(使用 LibreOffice)。

特征

  • **创建/清除演示文稿:**开始新的或重置现有的 PPTX 文件。
  • **添加幻灯片:**插入具有可自定义布局的幻灯片。
  • **文本和内容:**向幻灯片添加标题、内容和自定义文本框。
  • **形状:**插入各种各样的 PowerPoint 形状(包括流程图元素)。
  • **图像:**将图像嵌入幻灯片。
  • **幻灯片描述:**获取幻灯片内容的文本摘要以供验证。
  • **幻灯片渲染:**将幻灯片渲染为 PNG 图像(需要 LibreOffice)。
  • **下载PPTX:**下载生成的演示文稿文件。

要求

  • Python 3.12+
  • python-pptx
  • 枕头
  • FastMCP
  • LibreOffice (用于幻灯片图像渲染;必须单独安装并位于系统 PATH 中)

安装

  1. 安装 Python 依赖项:
    pip install -r requirements.txt
    (或者查看pyproject.toml了解依赖项)
  2. 安装 LibreOffice (用于图像渲染):
    • Linux: sudo pacman -S libreoffice-freshsudo apt install libreoffice
    • macOS: brew install --cask libreoffice
    • Windows:从 libreoffice.org 下载

用法

启动服务器:

python server.py

您可以使用环境变量设置服务器的主机和端口:

  • HOST (默认值: 127.0.0.1
  • PORT (默认值: 8000

例如,要在所有接口和端口 9000 上运行:

HOST=0.0.0.0 PORT=9000 python server.py

或者(使用 FastMCP 进行开发):

fastmcp dev server.py

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/中添加自己的模板。

执照

请参阅许可证以了解详情。

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

由 FastMCP 提供支持的服务器,用于以编程方式创建、编辑和渲染 PowerPoint (PPTX) 演示文稿,具有幻灯片创建、内容插入和 PNG 渲染功能。

  1. 特征
    1. 要求
      1. 安装
        1. 用法
          1. API 概述
            1. 演示文稿和模板
              1. 执照

                Related MCP Servers

                • A
                  security
                  A
                  license
                  A
                  quality
                  A powerful MCP server for fetching and transforming web content into various formats (HTML, JSON, Markdown, Plain Text) with ease.
                  Last updated -
                  4
                  146
                  12
                  TypeScript
                  MIT License
                  • Apple
                  • Linux
                • 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 MCP server that provides browser automation tools, allowing users to navigate websites, take screenshots, click elements, fill forms, and execute JavaScript through Playwright.
                  Last updated -
                  Python
                  Apache 2.0
                  • Apple
                • -
                  security
                  A
                  license
                  -
                  quality
                  A 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 -
                  43
                  Python
                  MIT License
                  • Linux
                  • Apple

                View all related MCP servers

                ID: p6bie4tj1u