@sudocode-ai/mcp 0.1.18-dev.0 → 0.1.18
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/dist/api-client.d.ts +296 -0
- package/dist/api-client.d.ts.map +1 -0
- package/dist/api-client.js +304 -0
- package/dist/api-client.js.map +1 -0
- package/dist/index.js +103 -0
- package/dist/index.js.map +1 -1
- package/dist/scopes.d.ts +126 -0
- package/dist/scopes.d.ts.map +1 -0
- package/dist/scopes.js +282 -0
- package/dist/scopes.js.map +1 -0
- package/dist/server.d.ts +13 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +177 -319
- package/dist/server.js.map +1 -1
- package/dist/tool-registry.d.ts +49 -0
- package/dist/tool-registry.d.ts.map +1 -0
- package/dist/tool-registry.js +720 -0
- package/dist/tool-registry.js.map +1 -0
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +3 -3
package/dist/server.js
CHANGED
|
@@ -14,13 +14,34 @@ import * as feedbackTools from "./tools/feedback.js";
|
|
|
14
14
|
import * as referenceTools from "./tools/references.js";
|
|
15
15
|
import { existsSync } from "fs";
|
|
16
16
|
import { join } from "path";
|
|
17
|
+
import { resolveScopes, getUsableScopes, hasExtendedScopes, } from "./scopes.js";
|
|
18
|
+
import { SudocodeAPIClient } from "./api-client.js";
|
|
19
|
+
import { getToolsForScopes as getToolDefsForScopes, getToolByName, getHandlerType, } from "./tool-registry.js";
|
|
17
20
|
export class SudocodeMCPServer {
|
|
18
21
|
server;
|
|
19
22
|
client;
|
|
23
|
+
apiClient = null;
|
|
20
24
|
config;
|
|
25
|
+
scopeConfig;
|
|
26
|
+
usableScopes;
|
|
21
27
|
isInitialized = false;
|
|
22
28
|
constructor(config) {
|
|
23
29
|
this.config = config || {};
|
|
30
|
+
// Resolve scopes from config
|
|
31
|
+
const scopeArg = this.config.scope || "default";
|
|
32
|
+
this.scopeConfig = resolveScopes(scopeArg, this.config.serverUrl, this.config.projectId);
|
|
33
|
+
// Determine which scopes are actually usable (have prerequisites met)
|
|
34
|
+
this.usableScopes = getUsableScopes(this.scopeConfig.enabledScopes, this.config.serverUrl);
|
|
35
|
+
// Create API client if server URL is configured and extended scopes are enabled
|
|
36
|
+
if (this.config.serverUrl && hasExtendedScopes(this.usableScopes)) {
|
|
37
|
+
if (process.env.DEBUG_MCP) {
|
|
38
|
+
console.error(`[SudocodeMCPServer] Creating API client with projectId=${this.config.projectId}`);
|
|
39
|
+
}
|
|
40
|
+
this.apiClient = new SudocodeAPIClient({
|
|
41
|
+
serverUrl: this.config.serverUrl,
|
|
42
|
+
projectId: this.config.projectId,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
24
45
|
this.server = new Server({
|
|
25
46
|
name: "sudocode",
|
|
26
47
|
version: "0.1.1",
|
|
@@ -34,298 +55,48 @@ export class SudocodeMCPServer {
|
|
|
34
55
|
this.setupHandlers();
|
|
35
56
|
}
|
|
36
57
|
setupHandlers() {
|
|
37
|
-
// List available tools
|
|
58
|
+
// List available tools - filtered by usable scopes
|
|
38
59
|
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
60
|
+
const availableTools = getToolDefsForScopes(this.usableScopes);
|
|
39
61
|
return {
|
|
40
|
-
tools:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
type: "object",
|
|
46
|
-
properties: {},
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
name: "list_issues",
|
|
51
|
-
description: "Search and filter issues. Use this when you need to find specific issues by status, priority, keyword, or when exploring what work exists in the project.",
|
|
52
|
-
inputSchema: {
|
|
53
|
-
type: "object",
|
|
54
|
-
properties: {
|
|
55
|
-
status: {
|
|
56
|
-
type: "string",
|
|
57
|
-
enum: ["open", "in_progress", "blocked", "closed"],
|
|
58
|
-
description: "Filter by workflow status: 'open' (not started), 'in_progress' (currently working), 'blocked' (waiting on dependencies), 'closed' (completed)",
|
|
59
|
-
},
|
|
60
|
-
priority: {
|
|
61
|
-
type: "number",
|
|
62
|
-
description: "Filter by priority level where 0=highest priority and 4=lowest priority",
|
|
63
|
-
},
|
|
64
|
-
archived: {
|
|
65
|
-
type: "boolean",
|
|
66
|
-
description: "Include archived issues. Defaults to false (excludes archived issues from results)",
|
|
67
|
-
},
|
|
68
|
-
limit: {
|
|
69
|
-
type: "number",
|
|
70
|
-
description: "Maximum number of results to return. Defaults to 50.",
|
|
71
|
-
default: 50,
|
|
72
|
-
},
|
|
73
|
-
search: {
|
|
74
|
-
type: "string",
|
|
75
|
-
description: "Search text - matches against issue titles and descriptions (case-insensitive)",
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
name: "show_issue",
|
|
82
|
-
description: "Get full details about a specific issue. Use this to understand what the issue implements (which specs), what blocks it (dependencies), its current status, and related work. Essential for understanding context before starting implementation.",
|
|
83
|
-
inputSchema: {
|
|
84
|
-
type: "object",
|
|
85
|
-
properties: {
|
|
86
|
-
issue_id: {
|
|
87
|
-
type: "string",
|
|
88
|
-
description: 'Issue ID with format "i-xxxx" (e.g., "i-x7k9")',
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
required: ["issue_id"],
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
name: "upsert_issue",
|
|
96
|
-
description: "Create or update an issue (agent's actionable work item). **Issues implement specs** - use 'link' with type='implements' to connect issue to spec. **Before closing:** provide feedback on the spec using 'add_feedback' if this issue implements a spec. If issue_id is provided, updates the issue; otherwise creates a new one. To close an issue, set status='closed'. To archive an issue, set archived=true.",
|
|
97
|
-
inputSchema: {
|
|
98
|
-
type: "object",
|
|
99
|
-
properties: {
|
|
100
|
-
issue_id: {
|
|
101
|
-
type: "string",
|
|
102
|
-
description: 'Issue ID in format "i-xxxx". Omit to create new issue (auto-generates ID). Provide to update existing issue.',
|
|
103
|
-
},
|
|
104
|
-
title: {
|
|
105
|
-
type: "string",
|
|
106
|
-
description: "Concise issue title describing the work (e.g., 'Implement OAuth login flow'). Required when creating, optional when updating.",
|
|
107
|
-
},
|
|
108
|
-
description: {
|
|
109
|
-
type: "string",
|
|
110
|
-
description: "Detailed description of the work to be done. Supports markdown and inline references using [[id]] syntax (e.g., 'Implement [[s-abc123]] requirements' or 'Blocked by [[i-xyz789]]').",
|
|
111
|
-
},
|
|
112
|
-
priority: {
|
|
113
|
-
type: "number",
|
|
114
|
-
description: "Priority level: 0 (highest/urgent) to 4 (lowest/nice-to-have). Use 0-1 for critical work, 2 for normal, 3-4 for backlog.",
|
|
115
|
-
},
|
|
116
|
-
parent: {
|
|
117
|
-
type: "string",
|
|
118
|
-
description: "Parent issue ID for hierarchical organization (e.g., 'i-abc123'). Use to break epics into subtasks or organize related work.",
|
|
119
|
-
},
|
|
120
|
-
tags: {
|
|
121
|
-
type: "array",
|
|
122
|
-
items: { type: "string" },
|
|
123
|
-
description: "Array of tag strings for categorization (e.g., ['backend', 'authentication', 'security']). Useful for filtering and organization.",
|
|
124
|
-
},
|
|
125
|
-
status: {
|
|
126
|
-
type: "string",
|
|
127
|
-
enum: ["open", "in_progress", "blocked", "closed"],
|
|
128
|
-
description: "Workflow status: 'open' (ready but not started), 'in_progress' (actively working), 'blocked' (waiting on dependencies), 'closed' (completed). **Before closing spec-implementing issues, use add_feedback.**",
|
|
129
|
-
},
|
|
130
|
-
archived: {
|
|
131
|
-
type: "boolean",
|
|
132
|
-
description: "Set to true to archive completed/obsolete issues. Archived issues are hidden from default queries but preserved for history.",
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
name: "list_specs",
|
|
139
|
-
description: "Search and browse all specs in the project. Use this to find existing specifications by keyword, or to see what specs are available before creating new ones.",
|
|
140
|
-
inputSchema: {
|
|
141
|
-
type: "object",
|
|
142
|
-
properties: {
|
|
143
|
-
limit: {
|
|
144
|
-
type: "number",
|
|
145
|
-
description: "Maximum number of results to return. Defaults to 50.",
|
|
146
|
-
default: 50,
|
|
147
|
-
},
|
|
148
|
-
search: {
|
|
149
|
-
type: "string",
|
|
150
|
-
description: "Search text - matches against spec titles and descriptions (case-insensitive). Use keywords to find relevant specs.",
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
name: "show_spec",
|
|
157
|
-
description: "Get full details about a specific spec including its content, relationships, and all anchored feedback. Use this to understand requirements before implementing. Shows what issues implement this spec and feedback from previous implementations.",
|
|
158
|
-
inputSchema: {
|
|
159
|
-
type: "object",
|
|
160
|
-
properties: {
|
|
161
|
-
spec_id: {
|
|
162
|
-
type: "string",
|
|
163
|
-
description: 'Spec ID with format "s-xxxx" (e.g., "s-14sh"). Get IDs from list_specs, ready, or show_issue results.',
|
|
164
|
-
},
|
|
165
|
-
},
|
|
166
|
-
required: ["spec_id"],
|
|
167
|
-
},
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
name: "upsert_spec",
|
|
171
|
-
description: "Create or update a spec (user's requirements/intent/context document). Create spec to document design requirements, architecture, API design, etc with user guidance. If spec_id is provided, updates the spec; otherwise creates a new one with a hash-based ID (e.g., s-14sh). If editing the content of an existing spec, you can also edit the content of the corresponding spec markdown file directly (`spec.file_path` you can get with show_spec).",
|
|
172
|
-
inputSchema: {
|
|
173
|
-
type: "object",
|
|
174
|
-
properties: {
|
|
175
|
-
spec_id: {
|
|
176
|
-
type: "string",
|
|
177
|
-
description: 'Spec ID in format "s-xxxx". Omit to create new spec (auto-generates hash-based ID). Provide to update existing spec.',
|
|
178
|
-
},
|
|
179
|
-
title: {
|
|
180
|
-
type: "string",
|
|
181
|
-
description: "Descriptive spec title (e.g., 'OAuth Authentication System Design'). Required when creating, optional when updating.",
|
|
182
|
-
},
|
|
183
|
-
priority: {
|
|
184
|
-
type: "number",
|
|
185
|
-
description: "Priority level: 0 (highest/urgent) to 4 (lowest/nice-to-have). Helps prioritize which specs to implement first.",
|
|
186
|
-
},
|
|
187
|
-
description: {
|
|
188
|
-
type: "string",
|
|
189
|
-
description: "Full specification content in markdown format. Include requirements, architecture, API designs, user flows, technical decisions. Supports Obsidian-style [[entityId]] mention syntax for referencing other specs/issues.",
|
|
190
|
-
},
|
|
191
|
-
parent: {
|
|
192
|
-
type: "string",
|
|
193
|
-
description: "Parent spec ID for hierarchical organization (e.g., 's-abc123'). Use to break large specs into sub-specs or organize by system/feature area.",
|
|
194
|
-
},
|
|
195
|
-
tags: {
|
|
196
|
-
type: "array",
|
|
197
|
-
items: { type: "string" },
|
|
198
|
-
description: "Array of tag strings for categorization (e.g., ['architecture', 'api', 'security']). Useful for filtering and finding related specs.",
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
name: "link",
|
|
205
|
-
description: "Create a relationship between specs and/or issues. Use this to establish the dependency graph and connect work to requirements. Most common: 'implements' (issue → spec) and 'blocks' (dependency ordering).",
|
|
206
|
-
inputSchema: {
|
|
207
|
-
type: "object",
|
|
208
|
-
properties: {
|
|
209
|
-
from_id: {
|
|
210
|
-
type: "string",
|
|
211
|
-
description: "Source entity ID (format 'i-xxxx' for issue or 's-xxxx' for spec). This is the entity creating the relationship.",
|
|
212
|
-
},
|
|
213
|
-
to_id: {
|
|
214
|
-
type: "string",
|
|
215
|
-
description: "Target entity ID (format 'i-xxxx' for issue or 's-xxxx' for spec). This is the entity being related to.",
|
|
216
|
-
},
|
|
217
|
-
type: {
|
|
218
|
-
type: "string",
|
|
219
|
-
enum: [
|
|
220
|
-
"blocks",
|
|
221
|
-
"implements",
|
|
222
|
-
"references",
|
|
223
|
-
"depends-on",
|
|
224
|
-
"discovered-from",
|
|
225
|
-
"related",
|
|
226
|
-
],
|
|
227
|
-
description: "Relationship type:\n• 'implements' - issue implements a spec (core workflow, e.g., i-abc implements s-xyz)\n• 'blocks' - from_id must complete before to_id can start (execution ordering, affects 'ready' command)\n• 'depends-on' - dependency relationship where to_id must complete before from_id can start (execution ordering, affects 'ready' command)\n• 'discovered-from' - new issue found during work on another issue (provenance tracking)\n• 'references' - soft reference for context\n• 'related' - general relationship",
|
|
228
|
-
},
|
|
229
|
-
},
|
|
230
|
-
required: ["from_id", "to_id"],
|
|
231
|
-
},
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
name: "add_reference",
|
|
235
|
-
description: "Insert an Obsidian-style [[ID]] reference into spec or issue markdown content. Alternative to directly editing markdown - programmatically adds cross-references at specific locations.",
|
|
236
|
-
inputSchema: {
|
|
237
|
-
type: "object",
|
|
238
|
-
properties: {
|
|
239
|
-
entity_id: {
|
|
240
|
-
type: "string",
|
|
241
|
-
description: "Entity ID where the reference will be inserted (format 'i-xxxx' or 's-xxxx'). This is the document being edited.",
|
|
242
|
-
},
|
|
243
|
-
reference_id: {
|
|
244
|
-
type: "string",
|
|
245
|
-
description: "Entity ID being referenced (format 'i-xxxx' or 's-xxxx'). This creates a [[reference_id]] or [[reference_id|display_text]] link in the markdown.",
|
|
246
|
-
},
|
|
247
|
-
display_text: {
|
|
248
|
-
type: "string",
|
|
249
|
-
description: "Optional display text for the reference. If provided, creates [[reference_id|display_text]] instead of [[reference_id]].",
|
|
250
|
-
},
|
|
251
|
-
relationship_type: {
|
|
252
|
-
type: "string",
|
|
253
|
-
enum: [
|
|
254
|
-
"blocks",
|
|
255
|
-
"implements",
|
|
256
|
-
"references",
|
|
257
|
-
"depends-on",
|
|
258
|
-
"discovered-from",
|
|
259
|
-
"related",
|
|
260
|
-
],
|
|
261
|
-
description: "Optional relationship type to declare using { } syntax. Creates [[reference_id]]{ relationship_type } in markdown. Use 'implements', 'blocks', 'depends-on', etc.",
|
|
262
|
-
},
|
|
263
|
-
line: {
|
|
264
|
-
type: "number",
|
|
265
|
-
description: "Line number where reference should be inserted. Use either 'line' OR 'text', not both. Line numbers start at 1.",
|
|
266
|
-
},
|
|
267
|
-
text: {
|
|
268
|
-
type: "string",
|
|
269
|
-
description: "Text substring to search for as insertion point. Use either 'line' OR 'text', not both. Reference will be inserted at/near this text.",
|
|
270
|
-
},
|
|
271
|
-
format: {
|
|
272
|
-
type: "string",
|
|
273
|
-
enum: ["inline", "newline"],
|
|
274
|
-
description: "How to insert: 'inline' adds reference on same line as insertion point, 'newline' adds reference on a new line. Defaults to 'inline'.",
|
|
275
|
-
default: "inline",
|
|
276
|
-
},
|
|
277
|
-
// TODO: Add position handling later if needed.
|
|
278
|
-
},
|
|
279
|
-
required: ["entity_id", "reference_id"],
|
|
280
|
-
},
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
name: "add_feedback",
|
|
284
|
-
description: "**REQUIRED when closing issues that implement specs.** Document implementation results by providing feedback on a spec or issue. Entity type is automatically inferred from ID prefix (s-xxxx = spec, i-xxxx = issue). Supports:\n• **Issue→Spec**: Document implementation results when completing a spec (most common)\n• **Issue→Issue**: Leave notes for downstream issues, document unforeseen circumstances, or coordinate between related issues\n\nInclude what was accomplished, design decisions made, challenges encountered, and evidence of completion. When possible, anchor feedback to specific locations.",
|
|
285
|
-
inputSchema: {
|
|
286
|
-
type: "object",
|
|
287
|
-
properties: {
|
|
288
|
-
issue_id: {
|
|
289
|
-
type: "string",
|
|
290
|
-
description: "Issue ID that's providing the feedback (format 'i-xxxx'). This is the issue documenting results or leaving notes. Optional for anonymous feedback.",
|
|
291
|
-
},
|
|
292
|
-
to_id: {
|
|
293
|
-
type: "string",
|
|
294
|
-
description: "Target ID receiving the feedback (format 's-xxxx' for spec or 'i-xxxx' for issue). Entity type is automatically inferred from the ID prefix.",
|
|
295
|
-
},
|
|
296
|
-
content: {
|
|
297
|
-
type: "string",
|
|
298
|
-
description: "Feedback content in markdown. For specs: (1) Requirements met, (2) Design decisions, (3) Challenges and resolutions, (4) Evidence of completion. For issues: Document discoveries, blockers, coordination notes, or information for downstream work.",
|
|
299
|
-
},
|
|
300
|
-
type: {
|
|
301
|
-
type: "string",
|
|
302
|
-
enum: ["comment", "suggestion", "request"],
|
|
303
|
-
description: "Feedback type:\n• 'comment' - informational feedback about implementation (most common for completed work)\n• 'suggestion' - spec needs updating based on implementation learnings\n• 'request' - need clarification or spec is unclear/incomplete",
|
|
304
|
-
},
|
|
305
|
-
line: {
|
|
306
|
-
type: "number",
|
|
307
|
-
description: "Optional: Line number in target markdown to anchor feedback. Use either 'line' OR 'text', not both. Anchoring connects feedback to specific sections.",
|
|
308
|
-
},
|
|
309
|
-
text: {
|
|
310
|
-
type: "string",
|
|
311
|
-
description: "Optional: Exact text substring from target to anchor feedback. Use either 'line' OR 'text', not both. Must match EXACTLY (case-sensitive, whitespace-sensitive). Use show_spec/show_issue first to copy exact text.",
|
|
312
|
-
},
|
|
313
|
-
// TODO: Re-enable when the agent data structure is more developed.
|
|
314
|
-
// agent: {
|
|
315
|
-
// type: "string",
|
|
316
|
-
// description: "Agent providing feedback",
|
|
317
|
-
// },
|
|
318
|
-
},
|
|
319
|
-
required: ["to_id"],
|
|
320
|
-
},
|
|
321
|
-
},
|
|
322
|
-
],
|
|
62
|
+
tools: availableTools.map((tool) => ({
|
|
63
|
+
name: tool.name,
|
|
64
|
+
description: tool.description,
|
|
65
|
+
inputSchema: tool.inputSchema,
|
|
66
|
+
})),
|
|
323
67
|
};
|
|
324
68
|
});
|
|
325
|
-
// Handle tool calls
|
|
69
|
+
// Handle tool calls - route to CLI or API based on tool scope
|
|
326
70
|
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
327
71
|
const { name, arguments: args } = request.params;
|
|
328
|
-
|
|
72
|
+
// Get tool definition
|
|
73
|
+
const tool = getToolByName(name);
|
|
74
|
+
if (!tool) {
|
|
75
|
+
return {
|
|
76
|
+
content: [
|
|
77
|
+
{
|
|
78
|
+
type: "text",
|
|
79
|
+
text: `Unknown tool: ${name}`,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
isError: true,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
// Check if tool is in enabled scopes
|
|
86
|
+
if (!this.usableScopes.has(tool.scope)) {
|
|
87
|
+
return {
|
|
88
|
+
content: [
|
|
89
|
+
{
|
|
90
|
+
type: "text",
|
|
91
|
+
text: `Tool '${name}' is not available. Scope '${tool.scope}' is not enabled or missing prerequisites (--server-url).`,
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
isError: true,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
// Check initialization for CLI tools
|
|
98
|
+
const handlerType = getHandlerType(tool);
|
|
99
|
+
if (handlerType === "cli" && !this.isInitialized) {
|
|
329
100
|
const workingDir = this.client["workingDir"] || process.cwd();
|
|
330
101
|
return {
|
|
331
102
|
content: [
|
|
@@ -339,39 +110,13 @@ export class SudocodeMCPServer {
|
|
|
339
110
|
}
|
|
340
111
|
try {
|
|
341
112
|
let result;
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
case "show_issue":
|
|
350
|
-
result = await issueTools.showIssue(this.client, args);
|
|
351
|
-
break;
|
|
352
|
-
case "upsert_issue":
|
|
353
|
-
result = await issueTools.upsertIssue(this.client, args);
|
|
354
|
-
break;
|
|
355
|
-
case "list_specs":
|
|
356
|
-
result = await specTools.listSpecs(this.client, args);
|
|
357
|
-
break;
|
|
358
|
-
case "show_spec":
|
|
359
|
-
result = await specTools.showSpec(this.client, args);
|
|
360
|
-
break;
|
|
361
|
-
case "upsert_spec":
|
|
362
|
-
result = await specTools.upsertSpec(this.client, args);
|
|
363
|
-
break;
|
|
364
|
-
case "link":
|
|
365
|
-
result = await relationshipTools.link(this.client, args);
|
|
366
|
-
break;
|
|
367
|
-
case "add_reference":
|
|
368
|
-
result = await referenceTools.addReference(this.client, args);
|
|
369
|
-
break;
|
|
370
|
-
case "add_feedback":
|
|
371
|
-
result = await feedbackTools.addFeedback(this.client, args);
|
|
372
|
-
break;
|
|
373
|
-
default:
|
|
374
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
113
|
+
if (handlerType === "cli") {
|
|
114
|
+
// Route to CLI handlers (default scope)
|
|
115
|
+
result = await this.handleCliTool(name, args);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
// Route to API handlers (extended scopes)
|
|
119
|
+
result = await this.handleApiTool(name, args);
|
|
375
120
|
}
|
|
376
121
|
return {
|
|
377
122
|
content: [
|
|
@@ -467,6 +212,90 @@ sudocode is a git-native spec and issue management system designed for AI-assist
|
|
|
467
212
|
throw new Error(`Unknown resource: ${uri}`);
|
|
468
213
|
});
|
|
469
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* Handle CLI-based tools (default scope).
|
|
217
|
+
*/
|
|
218
|
+
async handleCliTool(name, args) {
|
|
219
|
+
switch (name) {
|
|
220
|
+
case "ready":
|
|
221
|
+
return issueTools.ready(this.client, args);
|
|
222
|
+
case "list_issues":
|
|
223
|
+
return issueTools.listIssues(this.client, args);
|
|
224
|
+
case "show_issue":
|
|
225
|
+
return issueTools.showIssue(this.client, args);
|
|
226
|
+
case "upsert_issue":
|
|
227
|
+
return issueTools.upsertIssue(this.client, args);
|
|
228
|
+
case "list_specs":
|
|
229
|
+
return specTools.listSpecs(this.client, args);
|
|
230
|
+
case "show_spec":
|
|
231
|
+
return specTools.showSpec(this.client, args);
|
|
232
|
+
case "upsert_spec":
|
|
233
|
+
return specTools.upsertSpec(this.client, args);
|
|
234
|
+
case "link":
|
|
235
|
+
return relationshipTools.link(this.client, args);
|
|
236
|
+
case "add_reference":
|
|
237
|
+
return referenceTools.addReference(this.client, args);
|
|
238
|
+
case "add_feedback":
|
|
239
|
+
return feedbackTools.addFeedback(this.client, args);
|
|
240
|
+
default:
|
|
241
|
+
throw new Error(`Unknown CLI tool: ${name}`);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Handle API-based tools (extended scopes).
|
|
246
|
+
*/
|
|
247
|
+
async handleApiTool(name, args) {
|
|
248
|
+
if (!this.apiClient) {
|
|
249
|
+
throw new Error(`Tool '${name}' requires --server-url to be configured.`);
|
|
250
|
+
}
|
|
251
|
+
switch (name) {
|
|
252
|
+
// Overview
|
|
253
|
+
case "project_status":
|
|
254
|
+
return this.apiClient.getProjectStatus();
|
|
255
|
+
// Executions
|
|
256
|
+
case "list_executions":
|
|
257
|
+
return this.apiClient.listExecutions(args);
|
|
258
|
+
case "show_execution":
|
|
259
|
+
return this.apiClient.showExecution(args);
|
|
260
|
+
case "start_execution":
|
|
261
|
+
return this.apiClient.startExecution(args);
|
|
262
|
+
case "start_adhoc_execution":
|
|
263
|
+
return this.apiClient.startAdhocExecution(args);
|
|
264
|
+
case "create_follow_up":
|
|
265
|
+
return this.apiClient.createFollowUp(args);
|
|
266
|
+
case "cancel_execution":
|
|
267
|
+
return this.apiClient.cancelExecution(args);
|
|
268
|
+
// Inspection
|
|
269
|
+
// TODO: execution_trajectory - not yet implemented (see tool-registry.ts)
|
|
270
|
+
case "execution_changes":
|
|
271
|
+
return this.apiClient.getExecutionChanges(args);
|
|
272
|
+
case "execution_chain":
|
|
273
|
+
return this.apiClient.getExecutionChain(args);
|
|
274
|
+
// Workflows
|
|
275
|
+
case "list_workflows":
|
|
276
|
+
return this.apiClient.listWorkflows(args);
|
|
277
|
+
case "show_workflow":
|
|
278
|
+
return this.apiClient.showWorkflow(args);
|
|
279
|
+
case "workflow_status":
|
|
280
|
+
return this.apiClient.getWorkflowStatus(args);
|
|
281
|
+
case "create_workflow":
|
|
282
|
+
return this.apiClient.createWorkflow(args);
|
|
283
|
+
case "start_workflow":
|
|
284
|
+
return this.apiClient.startWorkflow(args);
|
|
285
|
+
case "pause_workflow":
|
|
286
|
+
return this.apiClient.pauseWorkflow(args);
|
|
287
|
+
case "cancel_workflow":
|
|
288
|
+
return this.apiClient.cancelWorkflow(args);
|
|
289
|
+
case "resume_workflow":
|
|
290
|
+
return this.apiClient.resumeWorkflow(args);
|
|
291
|
+
// Voice - speak is a no-op on the MCP side; actual narration
|
|
292
|
+
// happens server-side when parsing the agent's output stream
|
|
293
|
+
case "speak":
|
|
294
|
+
return { success: true, message: "Narration queued" };
|
|
295
|
+
default:
|
|
296
|
+
throw new Error(`Unknown API tool: ${name}`);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
470
299
|
/**
|
|
471
300
|
* Check for .sudocode directory and required files
|
|
472
301
|
* Returns initialization status and handles auto-import if needed
|
|
@@ -569,6 +398,35 @@ sudocode is a git-native spec and issue management system designed for AI-assist
|
|
|
569
398
|
async run() {
|
|
570
399
|
// Check if sudocode is initialized (non-blocking warning)
|
|
571
400
|
await this.checkInitialization();
|
|
401
|
+
// Log scope configuration
|
|
402
|
+
const enabledScopesList = Array.from(this.usableScopes).join(", ");
|
|
403
|
+
const availableTools = getToolDefsForScopes(this.usableScopes);
|
|
404
|
+
console.error(`✓ Enabled scopes: ${enabledScopesList}`);
|
|
405
|
+
console.error(`✓ Available tools: ${availableTools.length}`);
|
|
406
|
+
if (this.config.serverUrl) {
|
|
407
|
+
console.error(`✓ Server URL: ${this.config.serverUrl}`);
|
|
408
|
+
}
|
|
409
|
+
// Auto-open project on server if we have an API client and working directory
|
|
410
|
+
if (this.apiClient && this.config.workingDir) {
|
|
411
|
+
try {
|
|
412
|
+
const workingDir = this.config.workingDir;
|
|
413
|
+
const absolutePath = workingDir.startsWith("/")
|
|
414
|
+
? workingDir
|
|
415
|
+
: join(process.cwd(), workingDir);
|
|
416
|
+
console.error(`[mcp] Opening project at ${absolutePath}...`);
|
|
417
|
+
const result = await this.apiClient.openProject(absolutePath);
|
|
418
|
+
console.error(`✓ Project opened: ${result.id}`);
|
|
419
|
+
// Update projectId if it was auto-discovered differently
|
|
420
|
+
if (result.id !== this.config.projectId) {
|
|
421
|
+
console.error(`[mcp] Note: Server returned project ID ${result.id} (was: ${this.config.projectId})`);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
catch (error) {
|
|
425
|
+
// Log but don't fail - project might already be open or server might not be running
|
|
426
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
427
|
+
console.error(`[mcp] Warning: Could not open project on server: ${message}`);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
572
430
|
const transport = new StdioServerTransport();
|
|
573
431
|
await this.server.connect(transport);
|
|
574
432
|
console.error("sudocode MCP server running on stdio");
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,OAAO,iBAAiB;IACpB,MAAM,CAAS;IACf,MAAM,CAAiB;IACvB,MAAM,CAAuB;IAC7B,aAAa,GAAY,KAAK,CAAC;IAEvC,YAAY,MAA6B;QACvC,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CACtB;YACE,IAAI,EAAE,UAAU;YAChB,OAAO,EAA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AAC,EAAE,EAAE,CAAC,CAAC;gBAEhD,yDAAyD;gBACzD,IAAI,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;oBACxC,OAAO,CAAC,KAAK,CAAC,0CAA0C,MAAM,CAAC,EAAE,UAAU,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC;gBACvG,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,oFAAoF;gBACpF,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACvE,OAAO,CAAC,KAAK,CAAC,oDAAoD,OAAO,EAAE,CAAC,CAAC;YAC/E,CAAC;QACH,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC7C,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACrC,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;IACxD,CAAC;CACF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Registry for sudocode MCP Server
|
|
3
|
+
*
|
|
4
|
+
* Centralized registry of all MCP tools with their scopes and schemas.
|
|
5
|
+
* Supports filtering by scope and routing to appropriate handlers.
|
|
6
|
+
*/
|
|
7
|
+
import type { Scope } from "./scopes.js";
|
|
8
|
+
/**
|
|
9
|
+
* MCP tool input schema.
|
|
10
|
+
*/
|
|
11
|
+
export interface ToolInputSchema {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: Record<string, unknown>;
|
|
14
|
+
required?: string[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Tool definition with scope information.
|
|
18
|
+
*/
|
|
19
|
+
export interface ToolDefinition {
|
|
20
|
+
name: string;
|
|
21
|
+
description: string;
|
|
22
|
+
scope: Scope;
|
|
23
|
+
inputSchema: ToolInputSchema;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Handler types for tool routing.
|
|
27
|
+
*/
|
|
28
|
+
export type ToolHandlerType = "cli" | "api";
|
|
29
|
+
/**
|
|
30
|
+
* All tool definitions.
|
|
31
|
+
*/
|
|
32
|
+
export declare const ALL_TOOLS: ToolDefinition[];
|
|
33
|
+
/**
|
|
34
|
+
* Get all tools for the given scopes.
|
|
35
|
+
*/
|
|
36
|
+
export declare function getToolsForScopes(scopes: Set<Scope>): ToolDefinition[];
|
|
37
|
+
/**
|
|
38
|
+
* Get a tool definition by name.
|
|
39
|
+
*/
|
|
40
|
+
export declare function getToolByName(name: string): ToolDefinition | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Determine the handler type for a tool.
|
|
43
|
+
*/
|
|
44
|
+
export declare function getHandlerType(tool: ToolDefinition): ToolHandlerType;
|
|
45
|
+
/**
|
|
46
|
+
* Check if a tool requires the API client.
|
|
47
|
+
*/
|
|
48
|
+
export declare function requiresApiClient(tool: ToolDefinition): boolean;
|
|
49
|
+
//# sourceMappingURL=tool-registry.d.ts.map
|