sdd-mcp-server 1.1.22 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -13
- package/dist/adapters/cli/SDDToolAdapter.d.ts +22 -1
- package/dist/adapters/cli/SDDToolAdapter.js +399 -17
- package/dist/adapters/cli/SDDToolAdapter.js.map +1 -1
- package/dist/application/services/TemplateService.d.ts +17 -0
- package/dist/application/services/TemplateService.js +367 -24
- package/dist/application/services/TemplateService.js.map +1 -1
- package/dist/index.js +1210 -13
- package/dist/index.js.map +1 -1
- package/mcp-server.js +1501 -0
- package/package.json +3 -3
- package/simple-full-server.js +0 -379
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sdd-mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "MCP server for spec-driven development workflows across AI-agent CLIs and IDEs",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"sdd-mcp-server": "
|
|
7
|
+
"sdd-mcp-server": "mcp-server.js",
|
|
8
8
|
"sdd-mcp": "dist/index.js"
|
|
9
9
|
},
|
|
10
10
|
"type": "module",
|
|
11
11
|
"files": [
|
|
12
12
|
"dist/**/*",
|
|
13
|
-
"
|
|
13
|
+
"mcp-server.js",
|
|
14
14
|
"README.md",
|
|
15
15
|
"LICENSE",
|
|
16
16
|
"package.json"
|
package/simple-full-server.js
DELETED
|
@@ -1,379 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
-
|
|
5
|
-
// Define all SDD tools directly (copied from SDDToolAdapter.ts)
|
|
6
|
-
const SDD_TOOLS = [
|
|
7
|
-
{
|
|
8
|
-
name: 'sdd-init',
|
|
9
|
-
tool: {
|
|
10
|
-
name: 'sdd-init',
|
|
11
|
-
description: 'Initialize a new SDD project with directory structure and spec files',
|
|
12
|
-
inputSchema: {
|
|
13
|
-
type: 'object',
|
|
14
|
-
properties: {
|
|
15
|
-
name: { type: 'string', description: 'Project name' },
|
|
16
|
-
path: { type: 'string', description: 'Project path' },
|
|
17
|
-
language: { type: 'string', enum: ['en', 'ja', 'zh-TW'], default: 'en' }
|
|
18
|
-
},
|
|
19
|
-
required: ['name', 'path']
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
handler: async ({ name, path, language = 'en' }) => {
|
|
23
|
-
return `SDD project "${name}" would be initialized at "${path}" with language "${language}".
|
|
24
|
-
|
|
25
|
-
This would create:
|
|
26
|
-
- .kiro/specs/ directory
|
|
27
|
-
- .kiro/steering/ directory
|
|
28
|
-
- Initial project configuration
|
|
29
|
-
- Language-specific templates`;
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: 'sdd-status',
|
|
34
|
-
tool: {
|
|
35
|
-
name: 'sdd-status',
|
|
36
|
-
description: 'Get current project status and workflow phase information',
|
|
37
|
-
inputSchema: {
|
|
38
|
-
type: 'object',
|
|
39
|
-
properties: {
|
|
40
|
-
projectId: { type: 'string', description: 'Project ID' },
|
|
41
|
-
projectPath: { type: 'string', description: 'Project path (alternative to ID)' }
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
handler: async ({ projectId, projectPath }) => {
|
|
46
|
-
return `SDD project status:
|
|
47
|
-
|
|
48
|
-
Project: ${projectId || projectPath || 'Current directory'}
|
|
49
|
-
Phase: INIT (No active project found)
|
|
50
|
-
Status: Ready to initialize
|
|
51
|
-
|
|
52
|
-
Use sdd-init to create a new SDD project.`;
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: 'sdd-requirements',
|
|
57
|
-
tool: {
|
|
58
|
-
name: 'sdd-requirements',
|
|
59
|
-
description: 'Generate requirements document template',
|
|
60
|
-
inputSchema: {
|
|
61
|
-
type: 'object',
|
|
62
|
-
properties: {
|
|
63
|
-
projectId: { type: 'string', description: 'Project ID' }
|
|
64
|
-
},
|
|
65
|
-
required: ['projectId']
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
handler: async ({ projectId }) => {
|
|
69
|
-
return `Requirements document template generated for project: ${projectId}
|
|
70
|
-
|
|
71
|
-
# Requirements Document
|
|
72
|
-
|
|
73
|
-
## 1. Functional Requirements
|
|
74
|
-
- [Requirement 1]
|
|
75
|
-
- [Requirement 2]
|
|
76
|
-
- [Requirement 3]
|
|
77
|
-
|
|
78
|
-
## 2. Non-Functional Requirements
|
|
79
|
-
- Performance requirements
|
|
80
|
-
- Security requirements
|
|
81
|
-
- Scalability requirements
|
|
82
|
-
|
|
83
|
-
## 3. User Stories
|
|
84
|
-
- As a user, I want...
|
|
85
|
-
- As a developer, I need...
|
|
86
|
-
|
|
87
|
-
## 4. Acceptance Criteria
|
|
88
|
-
- Criteria 1
|
|
89
|
-
- Criteria 2
|
|
90
|
-
|
|
91
|
-
This would be saved to .kiro/specs/requirements.md`;
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
name: 'sdd-design',
|
|
96
|
-
tool: {
|
|
97
|
-
name: 'sdd-design',
|
|
98
|
-
description: 'Generate design document template',
|
|
99
|
-
inputSchema: {
|
|
100
|
-
type: 'object',
|
|
101
|
-
properties: {
|
|
102
|
-
projectId: { type: 'string', description: 'Project ID' }
|
|
103
|
-
},
|
|
104
|
-
required: ['projectId']
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
handler: async ({ projectId }) => {
|
|
108
|
-
return `Design document template generated for project: ${projectId}
|
|
109
|
-
|
|
110
|
-
# Technical Design Document
|
|
111
|
-
|
|
112
|
-
## 1. Architecture Overview
|
|
113
|
-
- System architecture
|
|
114
|
-
- Component diagram
|
|
115
|
-
- Data flow
|
|
116
|
-
|
|
117
|
-
## 2. Technology Stack
|
|
118
|
-
- Frontend: [Technology]
|
|
119
|
-
- Backend: [Technology]
|
|
120
|
-
- Database: [Technology]
|
|
121
|
-
- Infrastructure: [Technology]
|
|
122
|
-
|
|
123
|
-
## 3. API Design
|
|
124
|
-
- Endpoint specifications
|
|
125
|
-
- Request/Response formats
|
|
126
|
-
- Authentication
|
|
127
|
-
|
|
128
|
-
## 4. Database Design
|
|
129
|
-
- Entity relationship diagram
|
|
130
|
-
- Schema definitions
|
|
131
|
-
|
|
132
|
-
This would be saved to .kiro/specs/design.md`;
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
name: 'sdd-tasks',
|
|
137
|
-
tool: {
|
|
138
|
-
name: 'sdd-tasks',
|
|
139
|
-
description: 'Generate implementation tasks document',
|
|
140
|
-
inputSchema: {
|
|
141
|
-
type: 'object',
|
|
142
|
-
properties: {
|
|
143
|
-
projectId: { type: 'string', description: 'Project ID' }
|
|
144
|
-
},
|
|
145
|
-
required: ['projectId']
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
handler: async ({ projectId }) => {
|
|
149
|
-
return `Implementation tasks generated for project: ${projectId}
|
|
150
|
-
|
|
151
|
-
# Implementation Tasks
|
|
152
|
-
|
|
153
|
-
## Phase 1: Foundation
|
|
154
|
-
- [ ] Set up development environment
|
|
155
|
-
- [ ] Configure build system
|
|
156
|
-
- [ ] Set up testing framework
|
|
157
|
-
|
|
158
|
-
## Phase 2: Core Features
|
|
159
|
-
- [ ] Implement core functionality
|
|
160
|
-
- [ ] Add data persistence
|
|
161
|
-
- [ ] Create user interface
|
|
162
|
-
|
|
163
|
-
## Phase 3: Integration
|
|
164
|
-
- [ ] API integration
|
|
165
|
-
- [ ] Third-party services
|
|
166
|
-
- [ ] Error handling
|
|
167
|
-
|
|
168
|
-
## Phase 4: Testing & Deployment
|
|
169
|
-
- [ ] Unit tests
|
|
170
|
-
- [ ] Integration tests
|
|
171
|
-
- [ ] Deployment configuration
|
|
172
|
-
|
|
173
|
-
This would be saved to .kiro/specs/tasks.md`;
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
name: 'sdd-quality-check',
|
|
178
|
-
tool: {
|
|
179
|
-
name: 'sdd-quality-check',
|
|
180
|
-
description: 'Perform code quality analysis with Linus-style review',
|
|
181
|
-
inputSchema: {
|
|
182
|
-
type: 'object',
|
|
183
|
-
properties: {
|
|
184
|
-
filePath: { type: 'string', description: 'File path to analyze' },
|
|
185
|
-
codeSnippet: { type: 'string', description: 'Code snippet to analyze' }
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
handler: async ({ filePath, codeSnippet }) => {
|
|
190
|
-
return `Code quality analysis ${filePath ? `for ${filePath}` : 'for provided code'}:
|
|
191
|
-
|
|
192
|
-
# Linus-Style Code Review
|
|
193
|
-
|
|
194
|
-
## Layer 1: Syntax & Style
|
|
195
|
-
✅ Code formatting looks acceptable
|
|
196
|
-
✅ Naming conventions followed
|
|
197
|
-
|
|
198
|
-
## Layer 2: Logic & Structure
|
|
199
|
-
✅ Code structure is reasonable
|
|
200
|
-
✅ Logic flow is clear
|
|
201
|
-
|
|
202
|
-
## Layer 3: Performance
|
|
203
|
-
✅ No obvious performance issues
|
|
204
|
-
✅ Efficient algorithms used
|
|
205
|
-
|
|
206
|
-
## Layer 4: Security
|
|
207
|
-
✅ No obvious security vulnerabilities
|
|
208
|
-
✅ Input validation present
|
|
209
|
-
|
|
210
|
-
## Layer 5: Maintainability
|
|
211
|
-
✅ Code is readable and maintainable
|
|
212
|
-
✅ Documentation is adequate
|
|
213
|
-
|
|
214
|
-
## Overall Assessment
|
|
215
|
-
Code quality: GOOD
|
|
216
|
-
Recommended action: APPROVE
|
|
217
|
-
|
|
218
|
-
${codeSnippet ? `\nAnalyzed code:\n\`\`\`\n${codeSnippet.slice(0, 200)}...\n\`\`\`` : ''}`;
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
name: 'sdd-implement',
|
|
223
|
-
tool: {
|
|
224
|
-
name: 'sdd-implement',
|
|
225
|
-
description: 'Get implementation guidance and best practices',
|
|
226
|
-
inputSchema: {
|
|
227
|
-
type: 'object',
|
|
228
|
-
properties: {
|
|
229
|
-
component: { type: 'string', description: 'Component or feature to implement' },
|
|
230
|
-
technology: { type: 'string', description: 'Technology stack being used' }
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
},
|
|
234
|
-
handler: async ({ component, technology }) => {
|
|
235
|
-
return `Implementation guidance for ${component || 'your component'}:
|
|
236
|
-
|
|
237
|
-
# Implementation Guidelines
|
|
238
|
-
|
|
239
|
-
## Best Practices
|
|
240
|
-
- Follow SOLID principles
|
|
241
|
-
- Write tests first (TDD)
|
|
242
|
-
- Use consistent naming conventions
|
|
243
|
-
- Document public APIs
|
|
244
|
-
|
|
245
|
-
## ${technology || 'Technology'}-Specific Guidelines
|
|
246
|
-
- Use framework best practices
|
|
247
|
-
- Follow security guidelines
|
|
248
|
-
- Optimize for performance
|
|
249
|
-
- Handle errors gracefully
|
|
250
|
-
|
|
251
|
-
## Code Structure
|
|
252
|
-
- Separate concerns properly
|
|
253
|
-
- Use dependency injection
|
|
254
|
-
- Implement proper logging
|
|
255
|
-
- Add monitoring hooks
|
|
256
|
-
|
|
257
|
-
## Testing Strategy
|
|
258
|
-
- Unit tests for business logic
|
|
259
|
-
- Integration tests for workflows
|
|
260
|
-
- End-to-end tests for user journeys
|
|
261
|
-
|
|
262
|
-
Implementation steering provided based on SDD methodology.`;
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
name: 'sdd-approve',
|
|
267
|
-
tool: {
|
|
268
|
-
name: 'sdd-approve',
|
|
269
|
-
description: 'Approve workflow phases to progress through SDD stages',
|
|
270
|
-
inputSchema: {
|
|
271
|
-
type: 'object',
|
|
272
|
-
properties: {
|
|
273
|
-
phase: {
|
|
274
|
-
type: 'string',
|
|
275
|
-
enum: ['REQUIREMENTS', 'DESIGN', 'TASKS', 'IMPLEMENTATION'],
|
|
276
|
-
description: 'Phase to approve'
|
|
277
|
-
},
|
|
278
|
-
projectId: { type: 'string', description: 'Project ID' }
|
|
279
|
-
},
|
|
280
|
-
required: ['phase']
|
|
281
|
-
}
|
|
282
|
-
},
|
|
283
|
-
handler: async ({ phase, projectId }) => {
|
|
284
|
-
return `Phase approval for ${projectId || 'current project'}:
|
|
285
|
-
|
|
286
|
-
# Phase Approval: ${phase}
|
|
287
|
-
|
|
288
|
-
✅ **${phase} APPROVED**
|
|
289
|
-
|
|
290
|
-
Requirements met:
|
|
291
|
-
- Documentation complete
|
|
292
|
-
- Review criteria satisfied
|
|
293
|
-
- Quality gates passed
|
|
294
|
-
- Stakeholder approval received
|
|
295
|
-
|
|
296
|
-
**Status**: Ready to proceed to next phase
|
|
297
|
-
**Next Steps**: Continue with SDD workflow
|
|
298
|
-
|
|
299
|
-
Phase transition logged in project history.`;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
];
|
|
303
|
-
|
|
304
|
-
async function createFullServerInstance() {
|
|
305
|
-
// Create the McpServer for Claude Code compatibility
|
|
306
|
-
const server = new McpServer({
|
|
307
|
-
name: "sdd-mcp-server",
|
|
308
|
-
version: "1.1.22",
|
|
309
|
-
}, {
|
|
310
|
-
instructions: `Complete SDD (Spec-Driven Development) MCP server with ${SDD_TOOLS.length} tools:
|
|
311
|
-
|
|
312
|
-
${SDD_TOOLS.map(tool => `• ${tool.name}: ${tool.tool.description}`).join('\n')}
|
|
313
|
-
|
|
314
|
-
Use these tools to implement the full 5-phase SDD workflow: INIT → REQUIREMENTS → DESIGN → TASKS → IMPLEMENTATION`,
|
|
315
|
-
});
|
|
316
|
-
|
|
317
|
-
// Register all SDD tools with the McpServer
|
|
318
|
-
for (const toolDef of SDD_TOOLS) {
|
|
319
|
-
server.registerTool(toolDef.name, {
|
|
320
|
-
title: toolDef.tool.name,
|
|
321
|
-
description: toolDef.tool.description,
|
|
322
|
-
inputSchema: toolDef.tool.inputSchema,
|
|
323
|
-
}, async (args) => {
|
|
324
|
-
try {
|
|
325
|
-
const result = await toolDef.handler(args);
|
|
326
|
-
return {
|
|
327
|
-
content: [
|
|
328
|
-
{
|
|
329
|
-
type: "text",
|
|
330
|
-
text: result
|
|
331
|
-
},
|
|
332
|
-
],
|
|
333
|
-
};
|
|
334
|
-
} catch (error) {
|
|
335
|
-
return {
|
|
336
|
-
content: [
|
|
337
|
-
{
|
|
338
|
-
type: "text",
|
|
339
|
-
text: `Error executing ${toolDef.name}: ${error.message}`
|
|
340
|
-
},
|
|
341
|
-
],
|
|
342
|
-
};
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
console.error(`SDD MCP Server ready with ${SDD_TOOLS.length} tools: ${SDD_TOOLS.map(t => t.name).join(', ')}`);
|
|
348
|
-
|
|
349
|
-
return server;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
async function main() {
|
|
353
|
-
try {
|
|
354
|
-
const server = await createFullServerInstance();
|
|
355
|
-
const transport = new StdioServerTransport();
|
|
356
|
-
await server.connect(transport);
|
|
357
|
-
console.error("SDD MCP Server running on stdio");
|
|
358
|
-
|
|
359
|
-
// Handle graceful shutdown
|
|
360
|
-
process.on('SIGINT', async () => {
|
|
361
|
-
console.error('Shutting down SDD MCP Server...');
|
|
362
|
-
process.exit(0);
|
|
363
|
-
});
|
|
364
|
-
|
|
365
|
-
process.on('SIGTERM', async () => {
|
|
366
|
-
console.error('Shutting down SDD MCP Server...');
|
|
367
|
-
process.exit(0);
|
|
368
|
-
});
|
|
369
|
-
|
|
370
|
-
} catch (error) {
|
|
371
|
-
console.error("Failed to start SDD MCP Server:", error);
|
|
372
|
-
process.exit(1);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
main().catch((error) => {
|
|
377
|
-
console.error("SDD MCP Server failed to start:", error);
|
|
378
|
-
process.exit(1);
|
|
379
|
-
});
|