Skip to main content
Glama

ppt-word-mcp

AI-driven editable PPTX and standardized Word simulation test report generation service
A single lightweight service provides MCP (Model Context Protocol) Server, REST API, and Web Demo on the same port.


🚀 MCP (Model Context Protocol) Service

ppt-word-gen natively implements the standard MCP protocol (supporting both Streamable HTTP and STDIO transport channels), empowering various Agent clients (such as Claude Code, Claude Desktop, Cursor, Cline, OpenWebUI, etc.) to autonomously complete document format extraction, user confirmation, asynchronous queued generation, semantic multi-round revision, and secure file download.

1. Client Integration Configuration (.mcp.json)

The project root already includes .mcp.json. Agent tools can automatically discover and load the service when opening this directory.

Create or edit .mcp.json in the project root:

{
  "mcpServers": {
    "ppt-word-gen": {
      "type": "http",
      "url": "http://127.0.0.1:8000/mcp"
    }
  }
}

If the service has Bearer Token authentication enabled (configured with PPT_WORD_GEN_TOKEN), you can add request headers:

{
  "mcpServers": {
    "ppt-word-gen": {
      "type": "http",
      "url": "http://YOUR_SERVER_IP:8000/mcp",
      "headers": {
        "Authorization": "Bearer ${PPT_WORD_GEN_TOKEN}"
      }
    }
  }
}

Register with one command using the Claude Code CLI:

# 项目级注册(写入当前目录 .mcp.json)
claude mcp add --transport http --scope project ppt-word-gen http://127.0.0.1:8000/mcp

# 用户全局注册
claude mcp add --transport http --scope user ppt-word-gen http://127.0.0.1:8000/mcp

Method B: STDIO Transport Mode (invoke directly on the local machine without starting an HTTP port)

In the client configuration, start directly via a Python process:

{
  "mcpServers": {
    "ppt-word-gen": {
      "command": "python",
      "args": ["-m", "ppt_word_gen.mcp_stdio"]
    }
  }
}

2. MCP Core Collaborative Workflow

[用户输入 / 来源资料 / 模板]
             │
             ▼
[可选:upload_file / create_upload_ticket 暂存来源文件与 Word 模板]
             │
             ▼
[preview_word_report_format 提取模板默认格式(字体、字号、行距、多级标题、编号规范)]
             │
             ▼
[向用户展示预览并获取确认 ➔ 获得绑定格式哈希的 confirmation_token]
             │
             ▼
[generate_presentation / generate_word_report 发起异步生成任务]
             │
             ▼
[wait_generation_task / get_generation_task 轮询进度状态]
             │
             ▼
[get_artifact 获取 24 小时有效的安全签名 ResourceLink 下载链接]
             │
             ▼
[可选:revise_presentation / revise_word_report 进行多轮语义增量修订]

3. Complete MCP Tool Set (15 Tools)

Tool Name

Description

Key Parameters

list_generation_profiles

List document types that can be generated, supported formats, and binary upload conventions

None

preview_word_report_format

Extract the template default format (or built-in template) and apply modifications; return format information and confirmation_token

template_upload_id, custom_format

generate_presentation

Create an editable PPTX asynchronous generation task

prompt, format, source_upload_ids, model, etc.

generate_word_report

Submit a Word report task (must include confirmation_token)

title, report_type, confirmation_token, source_upload_ids

get_generation_task

Query the stage, percentage progress, errors, and artifact status of a PPT or Word async task

task_id, task_type

wait_generation_task

Wait up to 55 seconds; returns immediately when the task completes, or returns the latest status on timeout

task_id, task_type, timeout_seconds

cancel_generation_task

Request cancellation of an async generation task that has not yet finished

task_id, task_type

get_artifact

After task completion, obtain a 24-hour secure signed download direct link with a standard ResourceLink

task_id, task_type

upload_file

Base64 inline upload for small files (no more than 5MB)

filename, content_base64, purpose

create_upload_ticket

Create a one-time PUT upload address for large files (avoid large content occupying Agent context)

filename, purpose, max_bytes

list_business_templates

List built-in and enterprise-customized PPT/Word business specification templates

None

register_business_template

Register enterprise business content and style specification templates

template_id, name, spec

delete_business_template

Delete custom business templates (built-in templates are protected and cannot be deleted)

template_id

revise_presentation

Use an existing PPTX as context and generate a new version according to natural language instructions

parent_task_id, revision_prompt

revise_word_report

After user confirmation of the format, use an existing DOCX as the base to incrementally generate a new version

parent_task_id, confirmation_token, revision_instructions

4. MCP Rules and Asset Resources (4 Resources)

Agents can directly read specification guides and design constraints:

  • ppt-word://rules/workflow: Complete MCP interaction and format confirmation specification

  • ppt-word://rules/presentation: PPT Master design and layout specification

  • ppt-word://rules/word-report: Simulation and engineering Word report layout standards

  • ppt-word://templates/catalog: Business template catalog and specification quick reference


Related MCP server: docforge-mcp

📁 Project Structure

ppt-word-gen/
├── ppt_word_gen/              # Python 核心业务包
│   ├── app.py                 # FastAPI 入口(Demo、REST API、MCP Streamable HTTP)
│   ├── mcp_server.py          # MCP Server 实现(15 工具、4 资源、双向协议)
│   ├── mcp_stdio.py           # MCP STDIO 运行入口
│   ├── tasks.py               # PPT 异步任务队列与状态机
│   ├── report_tasks.py        # Word 异步任务队列与状态机
│   ├── report_agent.py        # Word 报告生成 Agent
│   ├── report_documents.py    # Word 文档排版、格式继承与 GBK 修复引擎
│   ├── word_format.py         # Word 格式解析、修改与防篡改 Token 校验
│   ├── signed_tokens.py       # HMAC-SHA256 签名下载与上传票据
│   ├── pptmaster.py           # PPT Master 脚本适配与执行
│   ├── upload_store.py        # 临时文件上传与生命周期管理
│   ├── task_store.py          # SQLite 持久化任务存储
│   └── config.py              # 全局配置读取
├── assets/word_templates/     # 内置 Word 模板(CID629 电驱系统联合仿真 v1.5)
├── skills/ai-simulation-report/# 仿真报告标准契约与校验规则
├── static/                    # 前端 Web Demo 页面
├── tests/                     # 41 项单元测试与集成测试
├── Dockerfile                 # 容器构建文件(支持联网/离线两种模式)
├── docker-compose.yml         # 生产/测试容器编排配置
├── build-overlay.ps1          # 企业级解密与离线 wheel 构建脚本
├── requirements.txt           # 依赖清单
├── .env.example               # 环境变量参考模板
└── .mcp.json                  # MCP 配置文件

💻 Local Quick Start

1. Install Dependencies and Run Tests

# 安装依赖
python -m pip install -r requirements.txt

# 运行全套 41 项自动化测试
python -m unittest discover -s tests -v

2. Start the Service

# 启动 HTTP + MCP 服务(默认监听 0.0.0.0:8000)
python -m ppt_word_gen
  • Web Demo page: http://127.0.0.1:8000/demo

  • OpenAPI interactive documentation: http://127.0.0.1:8000/docs

  • MCP HTTP endpoint: http://127.0.0.1:8000/mcp

  • Health check: http://127.0.0.1:8000/health


🐳 Docker / WSL Containerized Deployment

1. Standard Deployment

In an Ubuntu / WSL terminal:

cd /path/to/ppt-word-gen
cp .env.example .env.compose

# 按需修改 .env.compose(接入真实模型时设置 MOCK_LLM=0 并填写 API Key)
sudo service docker start
docker compose --env-file .env.compose up -d --build --wait

2. Enterprise Offline Wheel Build

In environments with enterprise data leak prevention (DLP) or intranet isolation, execute in Windows PowerShell:

pwsh ./build-overlay.ps1

This script will automatically copy files securely via file stream and invoke OFFLINE_INSTALL=1 to perform a local offline Wheel build.

3. Service Status Check and Stop

# 查看容器状态与健康指标
docker compose ps
curl http://127.0.0.1:8000/health

# 停止容器(数据保留在 ppt-word-gen-data 卷中)
docker compose stop

⚙️ Environment Variable Reference

Copy .env.example to .env or .env.compose:

Variable Name

Default Value

Description

LLM_BASE_URL

https://dashscope.aliyuncs.com/compatible-mode/v1

OpenAI-compatible API Base URL

LLM_API_KEY

None

Large language model API Key

LLM_MODEL

qwen3.7-plus

Default creation model name

MOCK_LLM

1

1 enables full end-to-end self-test demo without an API Key; set to 0 to connect a real model

PPT_WORD_GEN_TOKEN

empty

Bearer Token authentication; leave empty for no authentication

PUBLIC_BASE_URL

http://127.0.0.1:8000

Base URL for artifact downloads and large file uploads (set to the server's intranet IP for LAN calls)

DOWNLOAD_SIGNING_SECRET

empty (auto-generated)

HMAC signing secret for generating 24-hour temporary download credentials

MAX_CONCURRENT_TASKS

2

Maximum concurrent PPT processing tasks

MAX_CONCURRENT_REPORT_TASKS

1

Maximum concurrent Word processing tasks

MCP_INLINE_UPLOAD_MB

5

MCP Base64 inline upload limit (MB)

MAX_UPLOAD_MB

20

REST / large file Ticket upload limit (MB)


🔌 Core REST API

Request Method

Path

Description

GET

/health

Service health check (includes SQLite storage and task queue status)

GET

/demo

Built-in Web demo page

GET

/api/v1/word-format

Get built-in Word template default format and confirmation Token

POST

/api/v1/word-format

Extract custom template format, apply modifications, and generate a confirmation Token

POST

/api/v1/report-tasks

Submit Word simulation/technical report generation task

GET

/api/v1/report-tasks/{id}

Query Word report task progress and details

GET

/api/v1/report-tasks/{id}/result

Download the generated DOCX report

POST

/api/v1/tasks

Submit PPT presentation generation task

GET

/api/v1/tasks/{id}

Query PPT task progress and details

GET

/api/v1/tasks/{id}/result

Download the generated PPTX file

POST

/api/v1/uploads

Temporarily store binary source files or templates

PUT

/api/v1/upload-tickets/{token}

One-time large file direct upload interface

GET

/api/v1/artifacts/{token}

24-hour HMAC signed secure download interface

POST

/mcp

MCP Streamable HTTP protocol endpoint


📄 Open Source License

This project follows the MIT License.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

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/muli4561/ppt-word-mcp'

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