sdd-mcp-server 1.1.20 → 1.1.22
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 +41 -18
- package/package.json +3 -5
- package/simple-full-server.js +379 -0
- package/debug-mcp-server.js +0 -109
- package/fixed-mcp-server.js +0 -44
- package/mcp-server.js +0 -86
package/README.md
CHANGED
|
@@ -6,17 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
A Model Context Protocol (MCP) server implementing Spec-Driven Development (SDD) workflows for AI-agent CLIs and IDEs like Claude Code, Cursor, and others.
|
|
8
8
|
|
|
9
|
-
> **✅ v1.1.
|
|
9
|
+
> **✅ v1.1.21 Update**: Resolved MCP server connection issues. Use global installation (`npm install -g`) instead of npx for reliable Claude Code integration.
|
|
10
10
|
|
|
11
11
|
## 🚀 Quick Start
|
|
12
12
|
|
|
13
|
-
### Option 1: Install
|
|
13
|
+
### Option 1: Install Globally (Recommended)
|
|
14
14
|
```bash
|
|
15
|
-
#
|
|
16
|
-
|
|
15
|
+
# Install globally for reliable Claude Code integration
|
|
16
|
+
npm install -g sdd-mcp-server@latest
|
|
17
17
|
|
|
18
|
-
#
|
|
19
|
-
npm install -g sdd-mcp-server
|
|
18
|
+
# Start the server
|
|
20
19
|
sdd-mcp-server
|
|
21
20
|
```
|
|
22
21
|
|
|
@@ -58,14 +57,17 @@ docker-compose up -d
|
|
|
58
57
|
### Claude Code
|
|
59
58
|
Add to your MCP settings using the command line:
|
|
60
59
|
```bash
|
|
60
|
+
# First, install globally
|
|
61
|
+
npm install -g sdd-mcp-server@latest
|
|
62
|
+
|
|
61
63
|
# Add to local MCP configuration (recommended)
|
|
62
|
-
claude mcp add sdd "
|
|
64
|
+
claude mcp add sdd "sdd-mcp-server" -s local
|
|
63
65
|
|
|
64
66
|
# Verify connection
|
|
65
67
|
claude mcp list
|
|
66
68
|
# Should show: sdd: ✓ Connected
|
|
67
69
|
|
|
68
|
-
# For faster startup
|
|
70
|
+
# For development (faster startup):
|
|
69
71
|
git clone https://github.com/yi-john-huang/sdd-mcp.git
|
|
70
72
|
cd sdd-mcp
|
|
71
73
|
claude mcp add sdd "$(pwd)/local-mcp-server.js" -s local
|
|
@@ -76,8 +78,8 @@ Manual configuration in `~/.claude.json`:
|
|
|
76
78
|
{
|
|
77
79
|
"mcpServers": {
|
|
78
80
|
"sdd": {
|
|
79
|
-
"command": "
|
|
80
|
-
"args": [
|
|
81
|
+
"command": "sdd-mcp-server",
|
|
82
|
+
"args": [],
|
|
81
83
|
"env": {}
|
|
82
84
|
}
|
|
83
85
|
}
|
|
@@ -168,16 +170,19 @@ export HOOK_TIMEOUT=10000
|
|
|
168
170
|
|
|
169
171
|
### Claude Code Integration Example
|
|
170
172
|
```bash
|
|
173
|
+
# Install globally first
|
|
174
|
+
npm install -g sdd-mcp-server@latest
|
|
175
|
+
|
|
171
176
|
# Add to Claude Code with environment variables
|
|
172
|
-
claude mcp add sdd "
|
|
177
|
+
claude mcp add sdd "sdd-mcp-server"
|
|
173
178
|
|
|
174
179
|
# Manual configuration in ~/.mcp.json:
|
|
175
180
|
{
|
|
176
181
|
"servers": {
|
|
177
182
|
"sdd": {
|
|
178
183
|
"type": "stdio",
|
|
179
|
-
"command": "
|
|
180
|
-
"args": [
|
|
184
|
+
"command": "sdd-mcp-server",
|
|
185
|
+
"args": [],
|
|
181
186
|
"env": {
|
|
182
187
|
"LOG_LEVEL": "info",
|
|
183
188
|
"DEFAULT_LANG": "en"
|
|
@@ -245,20 +250,35 @@ npm cache clean --force
|
|
|
245
250
|
npm install -g sdd-mcp-server
|
|
246
251
|
```
|
|
247
252
|
|
|
253
|
+
**Issue: "Connection fails with npx"**
|
|
254
|
+
|
|
255
|
+
⚠️ **Known Issue**: npx execution may have timing issues with Claude Code health checks.
|
|
256
|
+
|
|
257
|
+
**Solution**: Use global installation instead:
|
|
258
|
+
```bash
|
|
259
|
+
# Don't use: npx -y sdd-mcp-server@latest
|
|
260
|
+
# Instead, install globally:
|
|
261
|
+
npm install -g sdd-mcp-server@latest
|
|
262
|
+
claude mcp add sdd "sdd-mcp-server" -s local
|
|
263
|
+
```
|
|
264
|
+
|
|
248
265
|
**Issue: "MCP server not responding or Failed to connect"**
|
|
249
266
|
|
|
250
|
-
*Fixed in v1.1.
|
|
267
|
+
*Fixed in v1.1.21*: Use global installation instead of npx for reliable connections.
|
|
251
268
|
|
|
252
269
|
```bash
|
|
270
|
+
# Install globally first
|
|
271
|
+
npm install -g sdd-mcp-server@latest
|
|
272
|
+
|
|
253
273
|
# Test server directly
|
|
254
|
-
echo '{"jsonrpc": "2.0", "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "test", "version": "1.0.0"}}, "id": 1}' |
|
|
274
|
+
echo '{"jsonrpc": "2.0", "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "test", "version": "1.0.0"}}, "id": 1}' | sdd-mcp-server
|
|
255
275
|
|
|
256
276
|
# Check Claude MCP status
|
|
257
277
|
claude mcp list
|
|
258
278
|
|
|
259
279
|
# Re-add server to Claude MCP (forces refresh)
|
|
260
280
|
claude mcp remove sdd -s local
|
|
261
|
-
claude mcp add sdd "
|
|
281
|
+
claude mcp add sdd "sdd-mcp-server" -s local
|
|
262
282
|
|
|
263
283
|
# Alternative: Use local development version for faster startup
|
|
264
284
|
git clone https://github.com/yi-john-huang/sdd-mcp.git
|
|
@@ -297,11 +317,14 @@ For detailed documentation on:
|
|
|
297
317
|
|
|
298
318
|
**Ready to get started?**
|
|
299
319
|
```bash
|
|
320
|
+
# Install globally first
|
|
321
|
+
npm install -g sdd-mcp-server@latest
|
|
322
|
+
|
|
300
323
|
# For Claude Code users:
|
|
301
|
-
claude mcp add sdd "
|
|
324
|
+
claude mcp add sdd "sdd-mcp-server"
|
|
302
325
|
|
|
303
326
|
# For direct usage:
|
|
304
|
-
|
|
327
|
+
sdd-mcp-server
|
|
305
328
|
```
|
|
306
329
|
|
|
307
330
|
Built for the AI development community 🤖✨
|
package/package.json
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sdd-mcp-server",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.22",
|
|
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": "simple-full-server.js",
|
|
8
8
|
"sdd-mcp": "dist/index.js"
|
|
9
9
|
},
|
|
10
10
|
"type": "module",
|
|
11
11
|
"files": [
|
|
12
12
|
"dist/**/*",
|
|
13
|
-
"
|
|
14
|
-
"debug-mcp-server.js",
|
|
15
|
-
"fixed-mcp-server.js",
|
|
13
|
+
"simple-full-server.js",
|
|
16
14
|
"README.md",
|
|
17
15
|
"LICENSE",
|
|
18
16
|
"package.json"
|
|
@@ -0,0 +1,379 @@
|
|
|
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
|
+
});
|
package/debug-mcp-server.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// Debug version - logs errors to file to see what's failing in npx
|
|
4
|
-
import fs from 'fs';
|
|
5
|
-
|
|
6
|
-
const logError = (msg, error) => {
|
|
7
|
-
const timestamp = new Date().toISOString();
|
|
8
|
-
const logEntry = `[${timestamp}] ${msg}: ${error?.message || error}\n${error?.stack || ''}\n\n`;
|
|
9
|
-
fs.appendFileSync('/tmp/sdd-mcp-debug.log', logEntry);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
// Still silence normal output but capture errors
|
|
13
|
-
console.log = () => {};
|
|
14
|
-
console.info = () => {};
|
|
15
|
-
console.warn = () => {};
|
|
16
|
-
console.debug = () => {};
|
|
17
|
-
console.error = (msg, ...args) => logError('CONSOLE_ERROR', msg + ' ' + args.join(' '));
|
|
18
|
-
|
|
19
|
-
try {
|
|
20
|
-
logError('DEBUG_START', 'Starting MCP server');
|
|
21
|
-
|
|
22
|
-
const { Server } = await import('@modelcontextprotocol/sdk/server/index.js');
|
|
23
|
-
const { StdioServerTransport } = await import('@modelcontextprotocol/sdk/server/stdio.js');
|
|
24
|
-
const {
|
|
25
|
-
ListToolsRequestSchema,
|
|
26
|
-
CallToolRequestSchema,
|
|
27
|
-
InitializedNotificationSchema
|
|
28
|
-
} = await import('@modelcontextprotocol/sdk/types.js');
|
|
29
|
-
|
|
30
|
-
logError('DEBUG_IMPORTS', 'All imports successful');
|
|
31
|
-
|
|
32
|
-
const server = new Server({
|
|
33
|
-
name: 'sdd-mcp-server',
|
|
34
|
-
version: '1.1.19'
|
|
35
|
-
}, {
|
|
36
|
-
capabilities: {
|
|
37
|
-
tools: {}
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
logError('DEBUG_SERVER', 'Server created');
|
|
42
|
-
|
|
43
|
-
// Add basic SDD tools
|
|
44
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
45
|
-
return {
|
|
46
|
-
tools: [
|
|
47
|
-
{
|
|
48
|
-
name: 'sdd-init',
|
|
49
|
-
description: 'Initialize a new SDD project',
|
|
50
|
-
inputSchema: {
|
|
51
|
-
type: 'object',
|
|
52
|
-
properties: {
|
|
53
|
-
projectName: { type: 'string' },
|
|
54
|
-
description: { type: 'string' }
|
|
55
|
-
},
|
|
56
|
-
required: ['projectName']
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
name: 'sdd-status',
|
|
61
|
-
description: 'Get current SDD project status',
|
|
62
|
-
inputSchema: {
|
|
63
|
-
type: 'object',
|
|
64
|
-
properties: {}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
};
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
72
|
-
const { name, arguments: args } = request.params;
|
|
73
|
-
|
|
74
|
-
switch (name) {
|
|
75
|
-
case 'sdd-init':
|
|
76
|
-
return {
|
|
77
|
-
content: [{
|
|
78
|
-
type: 'text',
|
|
79
|
-
text: `SDD project "${args?.projectName}" initialization would begin here. (Debug mode)`
|
|
80
|
-
}]
|
|
81
|
-
};
|
|
82
|
-
case 'sdd-status':
|
|
83
|
-
return {
|
|
84
|
-
content: [{
|
|
85
|
-
type: 'text',
|
|
86
|
-
text: 'SDD project status: No active project found. Use sdd-init to create a new project.'
|
|
87
|
-
}]
|
|
88
|
-
};
|
|
89
|
-
default:
|
|
90
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
server.setNotificationHandler(InitializedNotificationSchema, async () => {
|
|
95
|
-
logError('DEBUG_INITIALIZED', 'Server initialized');
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
logError('DEBUG_TRANSPORT', 'Creating transport');
|
|
99
|
-
const transport = new StdioServerTransport();
|
|
100
|
-
|
|
101
|
-
logError('DEBUG_CONNECT', 'Connecting server');
|
|
102
|
-
await server.connect(transport);
|
|
103
|
-
|
|
104
|
-
logError('DEBUG_SUCCESS', 'Server connected successfully');
|
|
105
|
-
|
|
106
|
-
} catch (error) {
|
|
107
|
-
logError('DEBUG_ERROR', error);
|
|
108
|
-
process.exit(1);
|
|
109
|
-
}
|
package/fixed-mcp-server.js
DELETED
|
@@ -1,44 +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
|
-
import { z } from "zod";
|
|
5
|
-
|
|
6
|
-
const server = new McpServer({
|
|
7
|
-
name: 'sdd-mcp-server',
|
|
8
|
-
version: '1.1.20'
|
|
9
|
-
}, {
|
|
10
|
-
instructions: 'Use this server for spec-driven development workflows'
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
// Register SDD tools
|
|
14
|
-
server.registerTool("sdd-init", {
|
|
15
|
-
title: "Initialize SDD Project",
|
|
16
|
-
description: "Initialize a new SDD project",
|
|
17
|
-
inputSchema: {
|
|
18
|
-
projectName: z.string().describe('The name of the project to initialize'),
|
|
19
|
-
description: z.string().optional().describe('Optional project description')
|
|
20
|
-
},
|
|
21
|
-
}, async ({ projectName, description }) => {
|
|
22
|
-
return {
|
|
23
|
-
content: [{
|
|
24
|
-
type: 'text',
|
|
25
|
-
text: `SDD project "${projectName}" initialization would begin here.${description ? ` Description: ${description}` : ''}`
|
|
26
|
-
}]
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
server.registerTool("sdd-status", {
|
|
31
|
-
title: "Get SDD Project Status",
|
|
32
|
-
description: "Get current SDD project status",
|
|
33
|
-
inputSchema: {},
|
|
34
|
-
}, async () => {
|
|
35
|
-
return {
|
|
36
|
-
content: [{
|
|
37
|
-
type: 'text',
|
|
38
|
-
text: 'SDD project status: No active project found. Use sdd-init to create a new project.'
|
|
39
|
-
}]
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
const transport = new StdioServerTransport();
|
|
44
|
-
await server.connect(transport);
|
package/mcp-server.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// Fast startup MCP server - optimized for Claude Code health checks
|
|
4
|
-
|
|
5
|
-
// Silence console output immediately
|
|
6
|
-
console.log = () => {};
|
|
7
|
-
console.info = () => {};
|
|
8
|
-
console.warn = () => {};
|
|
9
|
-
console.debug = () => {};
|
|
10
|
-
console.error = () => {};
|
|
11
|
-
|
|
12
|
-
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
13
|
-
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
14
|
-
import {
|
|
15
|
-
ListToolsRequestSchema,
|
|
16
|
-
CallToolRequestSchema,
|
|
17
|
-
InitializedNotificationSchema
|
|
18
|
-
} from '@modelcontextprotocol/sdk/types.js';
|
|
19
|
-
|
|
20
|
-
const server = new Server({
|
|
21
|
-
name: 'sdd-mcp-server',
|
|
22
|
-
version: '1.1.18'
|
|
23
|
-
}, {
|
|
24
|
-
capabilities: {
|
|
25
|
-
tools: {}
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
// Add basic SDD tools
|
|
30
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
31
|
-
return {
|
|
32
|
-
tools: [
|
|
33
|
-
{
|
|
34
|
-
name: 'sdd-init',
|
|
35
|
-
description: 'Initialize a new SDD project',
|
|
36
|
-
inputSchema: {
|
|
37
|
-
type: 'object',
|
|
38
|
-
properties: {
|
|
39
|
-
projectName: { type: 'string' },
|
|
40
|
-
description: { type: 'string' }
|
|
41
|
-
},
|
|
42
|
-
required: ['projectName']
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
name: 'sdd-status',
|
|
47
|
-
description: 'Get current SDD project status',
|
|
48
|
-
inputSchema: {
|
|
49
|
-
type: 'object',
|
|
50
|
-
properties: {}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
};
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
58
|
-
const { name, arguments: args } = request.params;
|
|
59
|
-
|
|
60
|
-
switch (name) {
|
|
61
|
-
case 'sdd-init':
|
|
62
|
-
return {
|
|
63
|
-
content: [{
|
|
64
|
-
type: 'text',
|
|
65
|
-
text: `SDD project "${args?.projectName}" initialization would begin here. (Simplified MCP mode)`
|
|
66
|
-
}]
|
|
67
|
-
};
|
|
68
|
-
case 'sdd-status':
|
|
69
|
-
return {
|
|
70
|
-
content: [{
|
|
71
|
-
type: 'text',
|
|
72
|
-
text: 'SDD project status: No active project found. Use sdd-init to create a new project.'
|
|
73
|
-
}]
|
|
74
|
-
};
|
|
75
|
-
default:
|
|
76
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
// Handle initialized notification
|
|
81
|
-
server.setNotificationHandler(InitializedNotificationSchema, async () => {
|
|
82
|
-
// Client has completed initialization - server is ready
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
const transport = new StdioServerTransport();
|
|
86
|
-
await server.connect(transport);
|