使用说明
🎯 MCP服务器规格套件
GitHub规范工具包的原生Rust MCP服务器-独立、快速、生产就绪
高性能MCP服务器,为Claude、Cursor、Windsurf和Kiro等AI助手带来规范驱动的开发。内置Rust以提高速度和可靠性。
✨ 特性
🚀 自给自足&快速
- 单个二进制 -没有Python,没有uvx,没有外部依赖
- 速度提高40-60倍 启动速度比Python CLI快(~50ms比2-3秒)
- 内存减少10倍 使用情况(~5-10MB对比50-100MB)
- 本地性能 -使用Rust+Tokio异步运行时构建
🤖 支持18名人工智能助理
- Claude Desktop、Cursor、GitHub Copilot、Windsurf、Kiro
- VS Code、Gemini、Qwen、OpenCode、Codex、Kilocode
- Auggie、CodeBuddy、AMP、Shai、Q、Bob、Qoder
�️ 10个MCP工具
- 设置:
speckit_init,speckit_check - 工作流程:
speckit_constitution,speckit_specify,speckit_plan,speckit_tasks,speckit_implement - 质量:
speckit_clarify,speckit_analyze,speckit_checklist
✅ 生产就绪
- 与Python CLI+其他工作流工具100%功能对等
- 全面的错误处理和有用的消息
- GitHub代币支持和速率限制处理
- 跨平台(Windows、Linux、macOS)
- 全面测试覆盖
📋 先决条件
没有! 这是一个自包含的二进制文件,没有依赖关系。
可选(推荐):
- Git -用于存储库初始化
- GitHub代币 -为避免API费率限制(设置
GH_TOKEN或GITHUB_TOKEN任何人)
🚀 快速开始
1.建造
git clone https://github.com/yourusername/spec-kit-mcp.git
cd spec-kit-mcp
cargo build --release
二进制位置: target/release/spec-kit-mcp.exe (Windows)或 target/release/spec-kit-mcp (Unix)
2.配置您的AI助手
适用于克劳德桌面
添加到 %APPDATA%\Claude\claude_desktop_config.json (Windows)或 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"spec-kit": {
"command": "E:\\path\\to\\spec-kit-mcp\\target\\release\\spec-kit-mcp.exe",
"args": []
}
}
}
对于其他MCP客户端
使用相同的模式-指向带有可选环境变量的编译二进制文件。
3.重新启动您的AI助手
重新启动MCP客户端(例如Claude Desktop)以加载服务器。
4.测试它
问你的AI:
“使用Kiro作为人工智能助手,初始化一个名为我的应用程序的新规范工具包项目”
🛠️ 可用工具
核心工作流程
| 工具 | 用途 | 参数 |
|---|---|---|
| 删除线 | 初始化新项目 | project_name, ai_assistant, script_type, no_git, github_token |
| speckit_check | 验证环境 | 无 |
| 规范构成 | 定义项目原则 | principles, constraints, output_path |
| speckit_specify | 定义要求 | requirements, user_stories, format, output_path |
| speckit_plan | 制定技术方案 | spec_file, tech_stack, output_path |
| speckit任务 | 生成任务列表 | plan_file, breakdown_level, output_path |
| speckit实现 | 执行实施 | task_file, context, output_dir |
质量工具
| 工具 | 用途 | 参数 |
|---|---|---|
| 规范_澄清 | 识别歧义 | spec_file, questions, output_path |
| speck_analyze | 检查一致性 | project_path, check_consistency, check_coverage, output_path |
| speckit_检查表 | 生成验证 | spec_file, include_implementation, include_testing, output_path |
📖 用法示例
完成工作流程
1. User: "Create a todo CLI app"
2. AI uses speckit_init:
{
"project_name": "todo-cli",
"ai_assistant": "kiro",
"script_type": "ps"
}
✅ Project initialized with .kiro folder
3. AI uses speckit_constitution:
{
"principles": "1. Simplicity\n2. CLI-first\n3. No dependencies"
}
✅ Constitution created
4. AI uses speckit_specify:
{
"requirements": "CLI with add, list, complete commands"
}
✅ Requirements defined
5. AI uses speckit_plan:
{
"spec_file": "./speckit.specify",
"tech_stack": "Python + argparse"
}
✅ Technical plan created
6. AI uses speckit_tasks:
{
"plan_file": "./speckit.plan"
}
✅ Task list generated
7. AI uses speckit_implement:
{
"task_file": "./speckit.tasks"
}
✅ Implementation complete!
项目启动后的结构
my-project/
├── .specify/ # Spec-kit directory
│ ├── memory/
│ │ └── constitution.md
│ ├── scripts/
│ │ ├── bash/ # Unix scripts
│ │ └── powershell/ # Windows scripts
│ └── templates/
├── .kiro/ # AI assistant folder (or .claude, .cursor, etc.)
│ └── README.md
├── .git/ # Git repository (optional)
├── speckit.constitution # Project principles
├── speckit.specify # Requirements
├── speckit.plan # Technical plan
├── speckit.tasks # Task list
└── src/ # Your code
🎯 支持的AI助手
服务器会自动创建特定于代理的配置文件夹:
| 助手 | ID | 文件夹 | 安装 |
|---|---|---|---|
| 克劳德桌面 | claude |
.claude |
https://claude.ai/download |
| 光标 | cursor |
.cursor |
https://cursor.sh |
| GitHub副本 | copilot |
.github/copilot |
https://github.com/features/copilot |
| 风帆冲浪 | windsurf |
.windsurf |
https://codeium.com/windsurf |
| Kiro | kiro |
.kiro |
https://kiro.ai |
| VS代码 | vscode |
.vscode |
https://code.visualstudio.com |
| 双子座 | gemini |
.gemini |
https://gemini.google.com |
| Qwen | qwen |
.qwen |
https://qwenlm.github.io |
| OpenCode | opencode |
.opencode |
https://opencode.ai |
| 食品法典委员会 | codex |
.codex |
https://openai.com/codex |
千码。 kilocode |
.kilocode |
https://kilocode.ai | |
| Auggie | auggie |
.auggie |
https://auggie.ai |
| CodeBuddy | codebuddy |
.codebuddy |
https://codebuddy.ai |
| 放大器 | amp |
.amp |
https://amp.dev |
| 谢 | shai |
.shai |
https://shai.ai |
Q q |
.q |
https://q.ai | |
| 鲍勃 | bob |
.bob |
https://bob.ai |
| Qoder | qoder |
.qoder |
https://qoder.ai |
⚙️ 配置
环境变量
GitHub Token(推荐)
通过设置GitHub令牌来避免费率限制:
Windows(PowerShell):
$env:GH_TOKEN = "your_github_token_here"
Windows(CMD):
set GH_TOKEN=your_github_token_here
Unix(Bash):
export GH_TOKEN=your_github_token_here
或者添加到MCP配置中:
{
"mcpServers": {
"spec-kit": {
"command": "...",
"env": {
"GH_TOKEN": "your_github_token_here"
}
}
}
}
调试日志
$env:RUST_LOG = "debug" # or info, warn, error
🧪 测试
运行测试
# All tests
cargo test
# Specific module
cargo test --lib init::tests
cargo test --lib agents::tests
# With output
cargo test -- --nocapture
验证脚本
.\test_mcp_server.ps1
这验证了:
- ✅ 二进制构建成功
- ✅ 配置了18个AI助手
- ✅ 所有模板均已存在
- ✅ 所有命令模板均已存在
- ✅ 10个MCP工具可用
🔍 故障排除
“超出费率限制”
解决方案:设置 GH_TOKEN 环境变量与您的GitHub令牌。
“找不到git命令”
解决方案:安装git或使用 "no_git": true 参数在 speckit_init.
“下载模板失败”
解决方案:检查互联网连接并验证GitHub是否可访问。
“Claude中未显示MCP服务器”
解决方案:
- 验证配置文件路径是否正确
- 检查配置中的二进制路径
- 完全重新启动克劳德桌面
- 检查日志:
%APPDATA%\Claude\logs\(Windows)或~/Library/Logs/Claude/(macOS)
“权限被拒绝”(Unix)
解决方案:脚本是自动运行的,但您可以手动运行:
chmod +x .specify/scripts/**/*.sh
📊 性能比较
| 度量 | Python CLI | Rust MCP | 改进 |
|---|---|---|---|
| 启动时间 | 约2-3秒 | 约50毫秒 | 速度提高40-60倍 |
| 内存使用 | ~50-100MB | ~5-10MB | 减少10倍 |
| 二进制大小 | N/A(需要Python) | ~8MB | 自足 |
| 依赖项 | Python+软件包 | 无 | 零存款 |
| AI助理 | 17 | 18 | 更多支持 |
| 工作流工具 | 0 | 8 | 完整的工作流程 |
🏗️ 建筑
系统概述
┌─────────────────────────────────────────────────────────────┐
│ AI Assistant Layer │
│ (Claude, Cursor, Windsurf, Kiro, etc.) │
└─────────────────────────────────────────────────────────────┘
│
│ MCP Protocol (JSON-RPC 2.0)
▼
┌─────────────────────────────────────────────────────────────┐
│ Spec-Kit MCP Server (Rust) │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Protocol │ │ Tools │ │ Templates │ │
│ │ Handler │ │ Registry │ │ Embedded │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
│ Native Rust Implementation
▼
┌─────────────────────────────────────────────────────────────┐
│ Execution Layer │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ GitHub │ │ File │ │ Git │ │
│ │ Download │ │ System │ │ Init │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────┘
项目结构
spec-kit-mcp/
├── src/
│ ├── main.rs # Binary entry point
│ ├── lib.rs # Library root
│ ├── agents/ # AI assistant configs
│ │ └── mod.rs # 18 agent definitions
│ ├── mcp/ # MCP protocol
│ │ ├── protocol.rs # JSON-RPC handler
│ │ ├── server.rs # MCP server
│ │ ├── transport.rs # stdio transport
│ │ └── types.rs # Protocol types
│ ├── speckit/ # Spec-kit integration
│ │ ├── cli.rs # CLI executor
│ │ └── errors.rs # Error types
│ ├── templates/ # Embedded templates
│ │ └── mod.rs # Template loader
│ ├── tools/ # MCP tools (10 total)
│ │ ├── init.rs # Initialize project
│ │ ├── check.rs # Verify environment
│ │ ├── constitution.rs # Define principles
│ │ ├── specify.rs # Define requirements
│ │ ├── plan.rs # Create plan
│ │ ├── tasks.rs # Generate tasks
│ │ ├── implement.rs # Execute implementation
│ │ ├── clarify.rs # Identify ambiguities
│ │ ├── analyze.rs # Check consistency
│ │ └── checklist.rs # Generate validation
│ └── utils/ # Utilities
│ └── mod.rs # Helper functions
├── templates/ # Template files
│ ├── constitution.md
│ ├── spec-template.md
│ ├── plan-template.md
│ ├── tasks-template.md
│ ├── checklist-template.md
│ └── commands/ # AI command templates
│ ├── constitution.md
│ ├── specify.md
│ ├── plan.md
│ ├── tasks.md
│ ├── implement.md
│ ├── clarify.md
│ ├── analyze.md
│ └── checklist.md
├── Cargo.toml
├── README.md
├── MCP_VERIFICATION.md # Complete usage guide
└── test_mcp_server.ps1 # Verification script
📚 文档
🤝 贡献
欢迎投稿!拜托:
- 克隆该仓库
- 创建要素分支(
git checkout -b feature/amazing-feature) - 进行更改
- 运行测试(
cargo test) - 运行clippy(
cargo clippy) - 格式代码(
cargo fmt) - 提交您的更改(
git commit -m 'Add amazing feature') - 推到分支(
git push origin feature/amazing-feature) - 打开拉取请求
📄 许可证
该项目具有双重许可:
- MIT许可证 -请参阅 许可证-麻省理工学院
- Apache许可证2.0 -请参阅 特许通行证
选择最适合您需求的许可证。
🙏 致谢
- GitHub规范工具包 -官方规范驱动的开发工具包
- 模型上下文协议 -实现AI工具集成
- Rust社区 -卓越的异步工具和生态系统
🔗 链接
- GitHub 仓库: https://github.com/yourusername/spec-kit-mcp
- MCP协议: https://modelcontextprotocol.io/
- GitHub规范工具包: https://github.com/github/spec-kit
- 锈: https://www.rust-lang.org
建于❤️ 使用Rust
专为热爱规范驱动开发和人工智能辅助编码的开发人员而设计
