SDD MCP服务器
MCP(模型上下文协议)服务器,实现接缝驱动开发(SDD)方法,使领域专家能够通过人工智能辅助开发构建企业级应用程序。
🚀 在几分钟内将简单的英语要求转化为可用的软件架构!
SDD是什么?
软件定义开发将组件通信路径(接缝)视为一流的架构公民。通过在实施之前定义明确的合同,SDD消除了集成问题,并实现了可靠的人工智能辅助开发。
关键原则
- 接缝第一,实施第二 -在构建组件之前定义组件的通信方式
- 合同结果模式 -所有跨组件调用都返回标准化结果
- 快速验证失败 -捕捉组件边界处的错误
- 蓝图驱动开发 -每个存根中都有详细的实施指南
先决条件
- Node.js 18+
- OpenAI API密钥(使用gpt-4o-mini模型)
- Claude桌面或Claude CLI
安装
来自npm(即将推出)
npm install -g sdd-mcp-server来源
git clone https://github.com/Phazzie/SeamsLikeIt.git
cd SeamsLikeIt
npm install
npm run build配置
创建一个 .env 项目根目录中的文件:
OPENAI_API_KEY=your-openai-api-key
AI_MODEL=gpt-4o-mini-2024-07-18用法
使用克劳德桌面
添加到您的Claude Desktop配置中:
{
"mcpServers": {
"sdd": {
"command": "sdd-mcp-server"
}
}
}可用工具
1. sdd_analyze_requirements
将简单的英文要求转换为符合SDD的组件和接缝定义。
// Example usage in Claude:
Use sdd_analyze_requirements with:
- requirements: "Build an online bookstore with inventory management"
- domain: "ecommerce"2. sdd_generate_contracts
将seam定义转换为具有ContractResult模式的TypeScript接口。
// Takes the project output from analyze_requirements
Use sdd_generate_contracts with the project object3. sdd_create_stubs
生成包含详细蓝图的实施文件,供AI或开发人员遵循。
// Takes the project with contracts
Use sdd_create_stubs with the project object4. sdd_validate_integration
测试组件是否可以通过其定义的接缝正确通信。
// Validates the complete project
Use sdd_validate_integration with the project object5. sdd_orchestrate_simple
运行从需求到准备实施项目的完整SDD工作流程。
// One-step project generation
Use sdd_orchestrate_simple with:
- requirements: "Your project description"
- domain: "healthcare|ecommerce|fintech" (optional)
- outputPath: "/path/to/save/project" (optional)6. sdd_analyze_for_regeneration 🆕
确定应该重新生成而不是调试的组件(SDD重构)。
Use sdd_analyze_for_regeneration with:
- project:
- issues: ["Integration failing", "Performance degraded"]
- codeSmells: ["Complex callbacks", "Unclear errors"]7. sdd_regenerate_component 🆕
从其合约中重新生成组件-SDD重构方式!
Use sdd_regenerate_component with:
- project:
- componentId: "user-service"
- reason: "Complex integration issues"
- improvements: ["Add retry logic", "Simplify error handling"]领域特定智能
服务器包括以下专用模式:
医疗保健
- HIPAA合规模式
- 患者数据安全
- 临床工作流程模板
- 审计跟踪要求
电子商务
- 支付处理模式
- 库存管理
- 购物车工作流程
- PCI合规性
金融科技
- 金融精度(货币的bigint)
- 交易模式
- KYC/AML合规
- 监管报告
工作流示例
1.从需求开始
I need a patient appointment scheduling system that integrates with our EHR2.分析需求
该工具识别:
- 组件:患者服务、预约服务、EHR集成
- 接缝:预约、检查可用性、更新病历
3.生成合同
创建TypeScript接口:
export interface BookAppointmentInput {
patientId: PatientId;
providerId: ProviderId;
requestedTime: Date;
visitType: 'routine' | 'urgent' | 'followup';
}
export interface BookAppointmentContract {
bookAppointment(input: BookAppointmentInput): Promise>;
}4.制造树桩
生成实施蓝图:
async bookAppointment(input: BookAppointmentInput): Promise> {
// BLUEPRINT: Book patient appointment with provider
//
// STEP 1: Validate patient and provider exist
// STEP 2: Check provider availability at requested time
// STEP 3: Verify patient insurance coverage
// STEP 4: Create appointment record
// STEP 5: Send confirmation to patient
// STEP 6: Update provider calendar
//
// ERROR SCENARIOS:
// - Provider not available: Return SCHEDULING_CONFLICT
// - Insurance not verified: Return INSURANCE_PENDING
throw new NotImplementedError('Follow blueprint above');
}5.用AI实现
将存根交给AI:“严格按照蓝图实施”
发展
建筑
npm run build测试
npm test在本地运行
npm run dev建筑
src/
├── index.ts # MCP server setup
├── tools/ # Tool implementations
│ ├── analyze-requirements.ts
│ ├── generate-contracts.ts
│ ├── create-stubs.ts
│ ├── validate-integration.ts
│ └── orchestrate-simple.ts
├── types/ # TypeScript type definitions
├── prompts/ # AI prompting templates
├── domain-modules/ # Domain-specific patterns
└── utils/ # Shared utilities成本信息
使用OpenAI的gpt-4o-mini模型,每次操作的典型成本:
- 分析需求:~0.0006美元
- 生成合同:~0.0005美元
- 创建存根:约0.0008美元
- 完整工作流程:约0.0025美元
特性
- 🎯 领域情报:医疗保健、电子商务、金融科技、SaaS的内置模式
- 🔍 多通道分析:95%以上焊缝检测准确率
- 🛡️ 类型安全:带有ContractResult模式的完整TypeScript
- 📊 成本跟踪:监控每次操作的人工智能使用成本
- 🔄 再生理念:破碎?从蓝图重新生成,而不是调试
- 🚀 SDD重构:分析和重新生成组件,而不是传统的调试
- 🧠 高级AI提示:推理痕迹、自我验证、心智模型
贡献
- 分叉存储库
- 创建要素分支
- 添加新功能的测试
- 提交拉取请求
许可证
MIT许可证-有关详细信息,请参阅许可证文件
支持
- 问题:
- 讨论:
______________________________________________________________________
内置于❤️ 使用Seam驱动开发原则
