使用说明
导演模式助手MCP服务器
以教学为重点的MCP服务器,展示了Director Mode概念:TDD、Auto Cycle和SpecKit
📚 什么是导演模式?
导演模式 是一种开发方法,强调:
- TDD(测试驱动开发):红绿重构周期
- 自动循环:自动化的5步开发工作流程
- 规格套件:规范驱动开发
此MCP服务器用作 教学实例 用于构建生产就绪的MCP服务器,同时演示这些概念。
🎯 学习目标
通过学习这个项目,你会学到:
-
如何从头开始构建MCP服务器
- MCP SDK使用
- 工具开发
- 资源管理
- 最佳实践
-
导演模式方法论
- TDD工作流实施
- 自动循环自动化概念
- SpecKit规范实践
-
生产就绪代码
- TypeScript最佳实践
- 全面测试
- 清晰的文件
- 可扩展架构
🚀 快速开始
安装
# Install dependencies
npm install
# Build the project
npm run build
# Start the server
npm start
添加到Claude MCP配置
添加到您的Claude MCP配置中(~/.claude/settings.json 或项目级别 .claude/settings.json):
{
"mcpServers": {
"director-mode": {
"command": "node",
"args": ["/path/to/mcp-director-mode-server/dist/index.js"]
}
}
}
Claude中的用法
配置后,您可以在Claude中使用这些工具:
# Check TDD status
Use the check_tdd_status tool to see your current TDD cycle state
# Get TDD guidance
Use suggest_tdd_next_step to get guidance for your current phase
# Run Auto-Cycle
Use run_cycle_step to execute Auto-Cycle workflow steps
# Validate specifications
Use validate_spec to check your specification documents
🛠️ 可用工具
TDD工具
| 工具 | 说明 |
|---|---|
check_tdd_status |
检查当前TDD循环状态(红色/绿色/反射器) |
suggest_tdd_next_step |
获取TDD下一步的指导 |
validate_refactor |
验证重构是否保持了测试的完整性 |
自动循环工具
| 工具 | 说明 |
|---|---|
run_cycle_step |
执行特定的自动循环步骤 |
check_cycle_progress |
检查整个自动循环进度 |
generate_cycle_report |
生成全面的周期报告 |
SpecKit工具
| 工具 | 说明 |
|---|---|
validate_spec |
验证规范的完整性 |
generate_tasks |
将规范分解为可执行任务 |
check_compliance |
验证实现是否符合规范 |
📊 资源
| 资源 | 描述 |
|---|---|
director-mode://project/state |
当前项目状态 |
director-mode://project/metrics |
质量指标 |
director-mode://cycle/history |
自动循环历史 |
🏗️ 项目结构
mcp-director-mode-server/
├── src/
│ ├── index.ts # MCP Server entry point
│ ├── types/ # TypeScript type definitions
│ ├── tools/ # MCP Tool implementations
│ │ ├── tdd/ # TDD tools
│ │ ├── cycle/ # Auto-Cycle tools
│ │ └── spec/ # SpecKit tools
│ └── resources/ # Resource providers
├── tests/ # Test files
├── examples/ # Usage examples
├── docs/ # Additional documentation
└── package.json
📖 示例
请参阅 examples/ 详细使用示例目录:
🧪 测试
# Run tests
npm test
# Run with coverage
npm run test:coverage
# Run in watch mode
npm test -- --watch
🤝 贡献
这是一个教学项目。我们欢迎以下捐款:
- 提高代码质量和清晰度
- 添加更好的示例和文档
- 修复错误或问题
- 提升教学价值
请参阅 贡献.md 作为指导方针。
📝 许可证
MIT许可证-请参阅 许可证 了解详情。
🌟 致谢
📚 了解更多
制作❤️ 通过 克劳德世界台湾