演示助手MCP服务器
  
用于与GitHub Copilot协调演示脚本执行的MCP服务器。使演示者能够通过确认和变量替换逐步完成演示提示。
快速安装
*单击上面的徽章进行一键安装,或按照下面的手动安装进行操作。*
特性
- 顺序执行:逐一完成提示并确认
- 变量替换:动态值,如
[PR_ID]或[BRANCH_NAME] - 状态管理:跟踪进度、重置、查询状态
- 错误处理:可操作的错误和建议,通过 可操作的错误
- 格式验证:严格解析,并显示有用的错误消息
演示脚本格式
创建带有标记提示的markdown文件:
### 💬 COPILOT CHAT PROMPT:What Azure DevOps repository am I working in?
### 💬 COPILOT CHAT PROMPT:Analyze PR [PR_ID] and show me the comments
变量在 [BRACKETS] 被检测到,可以在执行时替换。
用法
在Copilot聊天中:
You: Load my demo script at /path/to/demo.md
Copilot: [Loads and parses, shows first prompt]
You: confirm
Copilot: [Executes prompt, shows next one]
You: Execute with PR ID 12345
Copilot: [Substitutes variable and executes]MCP工具
| 工具 | 说明 |
|---|---|
load_demo_script | 加载并解析演示markdown文件 |
next_demo_step | 展示下一个提示以供审查 |
execute_demo_step | 执行当前/修改后的提示 |
reset_demo | 重置为开始 |
get_demo_state | 查询当前进度 |
安装
快速安装(推荐)
点击顶部的徽章之一,自动安装到VS Code中!
手动安装
cd demo-assistant-mcp
uv sync --all-extrasVS代码/副驾驶配置
添加到您的VS代码设置或 .vscode/mcp.json:
{
"mcp.servers": {
"demo-assistant": {
"command": "uv",
"args": ["run", "demo-assistant-mcp"],
"cwd": "/path/to/demo-assistant-mcp",
"description": "Orchestrate demo script execution"
}
}
}看 docs/CONFIGURATION.md 有关包括Windows/WSL在内的详细设置说明。
发展
uv run task check # lint + type + test (all-in-one)
uv run task test # Run tests (25 BDD specs)
uv run task cov # Run tests with coverage
uv run task lint # Lint (with auto-fix)
uv run task format # Format code
uv run task type # Type check注: uv run 当通过direnv激活venv时,它是可选的。项目结构
src/demo_assistant_mcp/
├── server.py # FastMCP server entry point
├── tools/
│ └── demo_tools.py # Tool implementations
└── common/
├── demo_parser.py # Markdown parsing
├── demo_state.py # State management
├── error_handling.py # DemoError (extends ActionableError)
└── logging.py # Logging configuration测试
7个需求类别的25个BDD规格 --按消费者需求组织,而不是代码结构。
| 需求类别 | 规格 | 覆盖范围 |
|---|---|---|
| TestLoadingDemoScripts | 4 | 文件加载,找不到,为空,格式错误 |
| 测试变量处理 | 3 | 检测、替换、传递 |
| TestSequentialExecution | 4 | 呈现、执行、完成、完成后 |
| TestDemoStateManagement | 4 | 重置,进度,无负载执行,下一步无负载 |
| TestErrorRecovery | 2 | 建议、格式示例 |
| TestMCP集成 | 3 | 函数签名和可发现性 |
| TestConversational编排 | 5 | 使用真实夹具的完整确认工作流程 |
文档
相关
许可证
该项目根据 MIT许可证.
