dt ppt构建器
可重复使用的Dynatrace品牌PPTX发电机——可作为 命令行界面, Python库,以及 MCP工具服务器 GitHub Copilot/VS Code/Claude Desktop。
插入客户配置+需求JSON→ 拿出一个擦亮的滑梯。
______________________________________________________________________
快速启动(CLI)
# 1. Install dependencies
pip install -r requirements.txt
# 2. Build a deck
py build_deck.py --config configs/example/config.yaml
# 3. Optional: override output path on the fly
py build_deck.py --config configs/example/config.yaml --output C:\temp\test.pptx______________________________________________________________________
MCP服务器(GitHub副本/VS代码/Claude桌面)
MCP服务器将PPT生成器作为任何兼容MCP的AI客户端的工具公开 可以打电话。您的同事可以在Copilot Chat和该工具中键入自然语言 自动生成品牌牌组。
设置
1.安装依赖项:
cd dt-ppt-builder
pip install -r requirements.txt2.在VS代码中配置 --添加到 .vscode/mcp.json (工作区)或用户设置:
{
"servers": {
"dt-ppt-builder": {
"command": "py",
"args": ["c:\\repos\\dt-ppt-builder\\mcp_server.py"],
"env": {}
}
}
}3.在Claude Desktop中配置 --添加到 claude_desktop_config.json:
{
"mcpServers": {
"dt-ppt-builder": {
"command": "py",
"args": ["c:\\repos\\dt-ppt-builder\\mcp_server.py"]
}
}
}可用的MCP工具
| 工具 | 说明 | 示例提示 |
|---|---|---|
list_customers | 显示所有可用的客户配置 | *“哪些客户有PPT配置?”* |
build_deck | 根据客户配置生成PPTX | *“构建Acme Corp AI可观察性平台”* |
parse_excel | 将requirements.xlsx转换为JSON | *“将C:\\data\\Acme_Metrics.xlx解析为需求JSON”* |
create_customer | 构建一个新的客户配置目录 | *“为Acme Corp创建新的客户配置”* |
get_requirements | 显示需求摘要和覆盖率统计数据 | *“给我看看Acme Corp的需求覆盖范围”* |
Copilot聊天对话示例
You: "Build the Acme Corp deck"
Copilot: → calls build_deck(customer="example")
✅ Deck built: configs/example/example_deck.pptx (8.2 MB, 14 slides)You: "Parse C:\data\NewCo_Metrics.xlsx and save as requirements JSON"
Copilot: → calls parse_excel(excel_path="C:\data\NewCo_Metrics.xlsx",
output_json_path="configs/newco/requirements.json")
✅ Parsed: 6 domains, 112 requirementsYou: "Set up a new customer called 'acme' using the Corporate 2026 template"
Copilot: → calls create_customer(customer="acme",
template_path="C:\templates\Corporate_2026.potx")
✅ Scaffolded: configs/acme/config.yaml + requirements.json______________________________________________________________________
存储库布局
dt-ppt-builder/
├── mcp_server.py — MCP tool server (stdio transport)
├── build_deck.py — CLI entry point
├── requirements.txt
├── README.md
├── dt_ppt_builder/
│ ├── __init__.py — package exports
│ ├── brand.py — Dynatrace RGB colors + status_color()
│ ├── helpers.py — low-level drawing: txb, req_table, status_bar …
│ ├── slide_builder.py — slide factories: title, coverage, domain …
│ ├── builder.py — orchestrator: config → deck → save / bytes
│ └── excel_parser.py — Excel → requirements JSON converter
├── configs/
│ └── example/
│ ├── config.yaml — paths, metadata, layout indices
│ └── requirements.json — 134 requirements across 6 domains______________________________________________________________________
添加新客户
选项A:通过MCP(推荐)
- 询问副驾驶: *“为Acme Corp创建新的客户配置”*
- 询问副驾驶: *“解析C:\\data\\Acme_Metrics.xlx并保存到configs/Acme/requiries.json”*
- 编辑
configs/acme/config.yaml设置布局索引、屏幕截图等。 - 询问副驾驶: *“建造Acme甲板”*
选项B:手动
- 创建
configs//目录。 - 复制
configs/example/config.yaml并编辑:
- customer, deck_title, deck_subtitle, contact - template (PPTX模板路径) - output (在哪里保存) - screenshots_dir + images 钥匙 - screenshot_slides 列表
- 创建
configs//requirements.json--结构与示例相同:
[
{
"name": "Domain 1 of N · ",
"description": "",
"reqs": [
{ "requirement": "...", "description": "...", "status": "✅ Now", "signal": "TRACE" },
...
]
}
]- 运行:
py build_deck.py --config configs//config.yaml
______________________________________________________________________
状态值
| 价值 | 徽章颜色 | 含义 |
|---|---|---|
✅ Now | 绿色 | 在当前Dynatrace版本中可用 |
⚡ Partial | 橙色 | 部分覆盖;需要额外的配置/扩展 |
🗺 Roadmap | 灰色 | 在产品路线图上;尚未GA |
______________________________________________________________________
布局索引参考(执行2026模板)
| 键 | 默认idx | 布局名称(近似值) |
|---|---|---|
title_center | 11 | 仅标题+眉毛,居中 |
title_content | 2 | 标题+眉毛+内容,居中 |
two_img | 19 | 2张图片+字幕 |
覆盖 config.yaml 在...之下 layout_indices: 如果使用不同的模板。
______________________________________________________________________
关键设计决策
- 无模板内容重用 --每张滑梯都是从头开始建造的;该模板仅提供品牌背景、字体和调色板。
- 腐败安全滑梯清理 —
prs.part.drop_rel(rId)被调用之前sldIdLst.remove(sId)以避免强制PowerPoint修复的重复zip条目。 - 配置驱动 --YAML控制所有路径和元数据;客户数据以JSON格式存在;代码与客户无关。
- MCP优先 --设计用于人工智能代理调用;所有工具都返回结构化文本响应。
______________________________________________________________________
依赖项
| 包装 | 用途 |
|---|---|
python-pptx | PPTX一代 |
Pillow | 图像嵌入 |
PyYAML | 配置文件解析 |
mcp | MCP服务器SDK(stdio传输) |
openpyxl | Excel需求解析器 |
lxml | 用于模板处理的XML操作 |
