Skip to main content
Glama

PPT-MCP 3

把中文大纲、Markdown、经营数据或单位模板,一次生成可编辑、带讲稿的 PowerPoint。 支持真实读取、定点修订、图表改数和 PDF/PNG 导出;五套主题,无需模型 API Key。

English · 完整参数 · 样稿下载 · Apache-2.0

经营汇报:PowerPoint 真实导出的原生柱线组合图

真实样稿

图片均由对应 PPTX 经 PowerPoint 导出。正文、流程、表格、图表仍可编辑。

场景

PPTX 与输入

全稿预览

Attention Is All You Need 学术组会,9 页

PPTX / JSON

9 页

虚构奶茶品牌季度复盘,8 页

PPTX / JSON

8 页

初中物理「浮力」,10 页

PPTX / JSON

10 页

考研英语 10 词闪卡,封面+20 张题答卡+总表

PPTX / JSON

22 页

自制上海电力大学风格课程答辩,7 页

PPTX / 模板 / 填充参数

7 页

Markdown 研发周报,6 页

PPTX / Markdown

6 页

校园咖啡店创业计划,全部 23 种版式各一页

PPTX / JSON

23 页

论文方法页:原生流程图 浮力例题:下一页揭答 单词闪卡:大字词面、音标与挖空例句 模板填充:校徽占位、标题栏、页脚和原生表格保留

全部版式一览

新增 formula 后共 23 种版式。以下每页均来自同一套「校园咖啡店创业计划」,按样稿页序展示。

全部版式一览:23 页 PowerPoint 真实导出拼图

Related MCP server: Office-PowerPoint-MCP

启动

要求 Node.js ≥20。生成、读取和编辑不需要 Office;预览另需 LibreOffice 或 Windows PowerPoint。

git clone https://github.com/guangxiangdebizi/PPT-MCP
cd PPT-MCP
npm ci
npm run build
npm start

使用官方稳定 MCP TypeScript SDK v2:@modelcontextprotocol/server@2.4.0、@modelcontextprotocol/node@2.1.2;测试客户端 @modelcontextprotocol/client@2.4.0。版本经 npm registry 核验并锁定,安装方式依据官方 SDK README。

stdio 配置

修改代码所在绝对路径。服务 stdout 只输出 MCP 消息。

{
  "mcpServers": {
    "ppt": {
      "command": "node",
      "args": ["/path/to/PPT-MCP/build/index.js"],
      "env": {
        "MCP_TRANSPORT": "stdio",
        "PPT_ARTIFACT_DIR": "/path/to/PPT-MCP/output"
      }
    }
  }
}

无状态 Streamable HTTP

$env:MCP_TRANSPORT="http"
$env:HOST="127.0.0.1"
$env:PORT="3100"
$env:PPT_INPUT_DIR="$PWD/input"
$env:PPT_ARTIFACT_DIR="$PWD/input/output"
$env:PUBLIC_BASE_URL="http://127.0.0.1:3100"
New-Item -ItemType Directory -Force input | Out-Null
npm start
{ "mcpServers": { "ppt": { "url": "http://127.0.0.1:3100/mcp" } } }

GET /health 返回版本与渲染器。GET /files/<随机id>/<文件名> 下载产物。只有设置 PUBLIC_BASE_URL 才返回 downloadUrl,始终返回 path、bytes、sha256。独立随机目录防止同名稿覆盖。要继续编辑输出文件,将产物目录设在输入根目录下,如上例。

一步生成

调用 create_presentation:

{
  "spec": {
    "title": "季度经营",
    "theme": "business",
    "slides": [
      { "kind": "cover", "title": "季度经营", "subtitle": "增长与利润" },
      {
        "kind": "chart",
        "title": "二季度收入增加15万元",
        "chartType": "bar",
        "categories": ["一季度", "二季度"],
        "series": [{ "name": "收入", "values": [120, 135] }],
        "unit": "万元",
        "source": "用户提供的季度表",
        "notes": "说明统计期间与口径。"
      }
    ]
  }
}

不想拼 JSON 时调用 markdown_to_presentation,传入 markdown 和 theme。# 是封面,## 是页标题;列表、表格、图片、引用、代码自动选版式。混合内容拆为连续页,不丢弃内容。完整输入见 weekly.md。

工具

工具

用途

list_themes

主题、场景、字体、配色和真实 PNG 缩略图

create_presentation

整套成稿,返回分页映射

markdown_to_presentation

Markdown 一步成稿

fill_template

按布局名、占位符或 {{变量}} 填模板

read_presentation

真实页序、文本框 ID、表格、图表数据、抽取图片、备注与布局

outline_presentation

整套标题与字数

patch_presentation

校验原 SHA-256、原文和命中数,定位替换文本

delete_slide / move_slide

删除、调整页序

duplicate_slide / insert_slide

深复制、新增版式页;插页提取原稿主题色

replace_image

保留位置尺寸,等比裁切或完整显示

update_chart_data

同步更新图表缓存与嵌入工作簿

set_notes

设置或新增演讲者备注

export_presentation

PDF / 逐页 PNG;有渲染器才注册

23 种版式和所有字段见 API.md。所有编辑写新文件,原件保留。响应同时有结构化 JSON 和一句文本,失败有错误码、字段与原因。

排版

  • academic 学术组会、business 经营汇报、classroom 教师课件、exam 题答卡、minimal 通用极简。

  • 16:9 母版,固定页码与来源区;常规标题 30 pt、最低 24 pt,正文不低于 16 pt,表格正文 16 pt、表头 18 pt,来源不低于 10 pt。

  • lang 支持 auto(默认)、zh-CN 和 en;自动按可见内容判断,固定标签随语言切换,用户原文不翻译。

  • 封面可传 image,也可传 institution、date、icon;formula 提供居中公式和 variables 变量说明。

  • 表格少行时放大行高并垂直居中,takeaway 增加结论条;流程卡把编号、步骤和说明连成整体。

  • question.vocabulary 提供单词、音标、词性、挖空例句和进度;翻页显示义项、搭配、双语例句与记忆钩子,见 闪卡输入。

  • 字体使用 Microsoft YaHei,回退 PingFang SC、Noto Sans CJK SC。PPT_FONT_PATH 指定字体文件做真实字宽测量,无字体时返回估算警告。

  • 表格超长自动按行分页并重复表头;其他溢出返回 LAYOUT_OVERFLOW,不静默压成小字。

  • notes 写备注,speakerPoints 写 agent 提供的讲稿要点;服务器不生成讲稿内容。

  • 图片支持本地、HTTPS、base64 data URI,以及 cover / contain。

  • bullets、process、stat 可引用 Lucide 图标,如 target、book-open、chart-column、trending-up、layers。授权声明。

导出与平台封装

优先检测 soffice,可用 SOFFICE_PATH 指定。LibreOffice 转 PDF,Poppler pdftoppm 转 PNG,每次独立目录与 profile。没有 LibreOffice 时,Windows 回退 PowerPoint COM;无渲染器则不注册导出工具。缓存含输入哈希、范围、格式、渲染器版本与 PPT_FONT_VERSION,更新字体后修改该变量。

docker build -t ppt-mcp .
docker run --rm -p 3100:3100 -e PUBLIC_BASE_URL=http://localhost:3100 -e PPT_INPUT_DIR=/data -v "${PWD}/input:/data/input:ro" -v "${PWD}/output:/data/output" ppt-mcp

库库平台 agent 负责理解、整理和核对内容。服务配置 MCP_TRANSPORT=http、HOST=0.0.0.0、PORT、输入根目录、产物目录和公网下载地址。平台网关负责 HTTPS、鉴权、下载访问控制和产物保留策略;随机链接不是身份鉴权。本服务不自动删除用户产物。

HTTP 本地输入校验 realpath,必须位于 PPT_INPUT_DIR。远程只收公网 HTTPS,不跟随重定向,20 秒超时、30 MiB 上限,对 429/5xx 最多重试两次。PPTX 解压上限 150 MiB、10,000 parts。默认 HTTP 并发 4,满载返回可重试的 503。 在代理使用 fake-IP DNS 的环境,可配置 PPT_ALLOWED_HTTPS_HOSTS 精确主机白名单代替公网 IP 检查;此时只允许白名单内的 HTTPS 域名,不接受任意主机。

验证

npm test
npm run examples

测试使用真实 SDK Client,逐个调用所有注册工具并读回,覆盖 stdio/HTTP、在线图片、下载哈希、工作簿、备注、修订与模板。有渲染器时导出 PNG/PDF 并重开编辑产物。样稿命令使用 Windows PowerPoint 输出逐页 PNG 至 docs/screenshots/。

局限

  • 只处理未加密标准 PPTX;旧 PPT、宏、SmartArt、OLE、动画与扫描文字不做语义编辑。

  • 文本修订拒绝跨不同格式 run、字段或段内换行;模板图片占位符需有明确尺寸。

  • 图表更新保留系列数,要求带嵌入工作簿的分类图表,不修改外链 Excel,不重新计算其他工作簿公式。

  • 字体替换与渲染器差异会改变换行,更换后应重新导出预览。

  • 论文样稿引用原论文结果,经营数据为虚构示例,学校风格模板是自制教学设计,非官方模板。

Available Tools

4 tools
analyze_presentationC

Analyze PowerPoint presentation structure, content, and provide insights

Inputs: file_path (required), analysis_type, detailed.

create_presentationC

Create a new PowerPoint presentation with specified title and number of slides

Inputs: title (required), output_path, slides, template.

edit_presentationC

Edit an existing PowerPoint presentation by adding slides or modifying content

Inputs: file_path (required), operation (required), content, slide_index.

read_presentationB

Read and extract content from PowerPoint presentations

Inputs: file_path (required), include_notes, output_format, slide_range.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: analyze for insights, create for new presentations, edit for modifications, and read for content extraction. There is no overlap in functionality, making tool selection straightforward for an agent.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern (e.g., analyze_presentation, create_presentation), using snake_case throughout. This predictability enhances readability and usability for agents.

    Tool Count5/5

    With 4 tools, the server is well-scoped for PowerPoint presentation management. Each tool serves a distinct and essential function (create, read, edit, analyze), with no unnecessary or redundant tools, making the count appropriate for the domain.

    Completeness4/5

    The toolset covers core CRUD-like operations (create, read, edit) and analysis, providing a solid foundation for presentation workflows. A minor gap exists in deletion or more advanced editing features, but agents can work effectively with the current tools.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers