@lil2good/nubis-mcp-server 1.0.52 → 1.0.53

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.
Files changed (3) hide show
  1. package/build/index.js +567 -274
  2. package/package.json +1 -1
  3. package/src/index.ts +778 -294
package/build/index.js CHANGED
@@ -21,7 +21,98 @@ const server = new mcp_js_1.McpServer({
21
21
  tools: {},
22
22
  },
23
23
  });
24
- // Helper to get results from middleware
24
+ // ============================================================================
25
+ // Formatting Helpers
26
+ // ============================================================================
27
+ const BOARD_LABELS = {
28
+ 'backlog': '📋 Backlog',
29
+ 'bugs': '🐛 Bugs',
30
+ 'priority': '⚡ Priority',
31
+ 'in-progress': '🔄 In Progress',
32
+ 'reviewing': '👀 Reviewing',
33
+ 'completed': '✅ Completed'
34
+ };
35
+ function formatBoard(board) {
36
+ return BOARD_LABELS[board] || board;
37
+ }
38
+ function formatApiUsage(usage) {
39
+ return `📊 **API Usage:** ${usage.remaining_calls}/${usage.total_limit} calls remaining`;
40
+ }
41
+ function formatTask(task, options = {}) {
42
+ const lines = [
43
+ `## ${task.title}`,
44
+ '',
45
+ `| Property | Value |`,
46
+ `|----------|-------|`,
47
+ `| **ID** | \`${task.id}\` |`,
48
+ `| **Number** | #${task.task_number} |`,
49
+ `| **Board** | ${formatBoard(task.board)} |`,
50
+ `| **Bolt** | ${task.bolt?.name || '_Unassigned_'} |`,
51
+ ];
52
+ if (task.parent_task_id) {
53
+ lines.push(`| **Parent Task** | \`${task.parent_task_id}\` |`);
54
+ }
55
+ // Description
56
+ lines.push('', '### Description', task.description || '_No description provided_');
57
+ // GitHub info
58
+ if (task.github_file_path || task.github_repo_name) {
59
+ lines.push('', '### GitHub', `- **Repo:** ${task.github_repo_name || '_Not set_'}`, `- **Path:** \`${task.github_file_path || '_Not set_'}\``, `- **Type:** ${task.github_item_type || '_Not set_'}`);
60
+ }
61
+ // Blockers
62
+ if (task.pm_task_blockers && task.pm_task_blockers.length > 0) {
63
+ lines.push('', '### ⚠️ Blockers', ...task.pm_task_blockers.map(b => `- \`${b.blocker_task_id}\``));
64
+ }
65
+ // Detailed view includes subtasks and comments
66
+ if (options.detailed) {
67
+ if (task.subtasks && task.subtasks.length > 0) {
68
+ const flatSubtasks = Array.isArray(task.subtasks[0]) ? task.subtasks[0] : task.subtasks;
69
+ if (flatSubtasks.length > 0) {
70
+ lines.push('', '### Subtasks');
71
+ flatSubtasks.forEach((sub) => {
72
+ lines.push(`- [${sub.board === 'completed' ? 'x' : ' '}] **${sub.title}** (\`${sub.id}\`) - ${formatBoard(sub.board)}`);
73
+ });
74
+ }
75
+ }
76
+ if (task.comments && task.comments.length > 0) {
77
+ const flatComments = Array.isArray(task.comments[0]) ? task.comments[0] : task.comments;
78
+ if (flatComments.length > 0) {
79
+ lines.push('', '### Comments');
80
+ flatComments.forEach((c) => {
81
+ lines.push(`- ${c.content}`);
82
+ });
83
+ }
84
+ }
85
+ if (task.context) {
86
+ lines.push('', '### Context', task.context);
87
+ }
88
+ }
89
+ // Images
90
+ if (task.images && task.images.length > 0) {
91
+ lines.push('', '### Images');
92
+ task.images.forEach((img, i) => {
93
+ lines.push(`${i + 1}. ${img.url}`);
94
+ });
95
+ }
96
+ return lines.join('\n');
97
+ }
98
+ function formatTaskCompact(task) {
99
+ const blockerNote = task.pm_task_blockers && task.pm_task_blockers.length > 0
100
+ ? ` ⚠️ ${task.pm_task_blockers.length} blocker(s)`
101
+ : '';
102
+ return [
103
+ `### #${task.task_number}: ${task.title}${blockerNote}`,
104
+ `**ID:** \`${task.id}\` | **Board:** ${formatBoard(task.board)} | **Bolt:** ${task.bolt?.name || '_None_'}`,
105
+ task.description ? `> ${task.description.substring(0, 150)}${task.description.length > 150 ? '...' : ''}` : '',
106
+ task.github_file_path ? `📁 \`${task.github_file_path}\`` : '',
107
+ '---'
108
+ ].filter(Boolean).join('\n');
109
+ }
110
+ function formatBolt(bolt) {
111
+ return `- **${bolt.name}** (\`${bolt.id}\`)${bolt.description ? `: ${bolt.description}` : ''}`;
112
+ }
113
+ // ============================================================================
114
+ // Middleware Helper
115
+ // ============================================================================
25
116
  async function getResultsFromMiddleware({ endpoint, schema }) {
26
117
  const response = await fetch('https://mcp-server.nubis.app/' + endpoint, {
27
118
  method: 'POST',
@@ -36,314 +127,269 @@ async function getResultsFromMiddleware({ endpoint, schema }) {
36
127
  });
37
128
  if (!response.ok) {
38
129
  const errorData = await response.json();
39
- throw new Error(errorData.error || 'Failed to fetch tasks from middleware');
130
+ throw new Error(errorData.error || 'Failed to fetch from middleware');
40
131
  }
41
- // Return the full JSON response (including api_usage, user, etc.)
42
132
  const json = await response.json();
43
133
  if (!json.data)
44
134
  throw new Error('No data returned from middleware');
45
135
  return json;
46
136
  }
47
- // Get Boltz -> to save IDs for use in tasks later
48
- server.tool("get_boltz", "Fetch all boltz for a workspace", async () => {
137
+ // ============================================================================
138
+ // Tools
139
+ // ============================================================================
140
+ /**
141
+ * Get Boltz
142
+ */
143
+ server.tool("get_boltz", "Fetch all boltz (project branches) for the workspace. Use this to get bolt IDs for filtering tasks or assigning tasks to specific boltz.", async () => {
49
144
  const json = await getResultsFromMiddleware({
50
145
  endpoint: 'get_boltz',
51
146
  schema: {}
52
147
  });
53
- if (!json.data)
54
- throw new Error('No data returned from middleware');
148
+ const boltz = json.data;
149
+ const formatted = [
150
+ `# Boltz (${boltz.length} total)`,
151
+ '',
152
+ ...boltz.map(formatBolt),
153
+ '',
154
+ '---',
155
+ formatApiUsage(json.api_usage)
156
+ ].join('\n');
55
157
  return {
56
- content: [
57
- {
58
- type: "text",
59
- text: JSON.stringify(json.data),
60
- },
61
- {
62
- type: "text",
63
- text: `Always provide API Usage information separately. Usage: ${JSON.stringify(json.api_usage)}`,
64
- }
65
- ],
158
+ content: [{ type: "text", text: formatted }],
66
159
  };
67
160
  });
68
- // Get Tasks -> Get tasks for a workspace
69
- server.tool("get_tasks", "Get tasks for a workspace, including subtasks, boltz, and github details/file paths", {
70
- limit: zod_1.z.number().optional().default(5),
71
- board: zod_1.z.enum(['bugs', 'backlog', 'priority', 'in-progress', 'reviewing', 'completed']).optional(),
72
- bolt_id: zod_1.z.string().optional(),
161
+ /**
162
+ * Get Tasks
163
+ */
164
+ server.tool("get_tasks", "List tasks from the workspace with optional filtering. Returns task summaries including title, status, bolt assignment, blockers, and GitHub integration details. Use get_task_details for full information on a specific task.", {
165
+ limit: zod_1.z.number().optional().default(5).describe("Maximum number of tasks to return (default: 5)"),
166
+ board: zod_1.z.enum(['bugs', 'backlog', 'priority', 'in-progress', 'reviewing', 'completed']).optional().describe("Filter by board/status"),
167
+ bolt_id: zod_1.z.string().optional().describe("Filter by bolt ID (use get_boltz to find bolt IDs)"),
73
168
  }, async ({ limit, board, bolt_id }) => {
74
- try {
75
- const json = await getResultsFromMiddleware({
76
- endpoint: 'get_tasks',
77
- schema: {
78
- board,
79
- bolt_id,
80
- limit
81
- }
82
- });
83
- if (!json.data)
84
- throw new Error('No data returned from middleware');
85
- const taskContent = json.data.map((task) => ({
86
- type: "text",
87
- text: [
88
- `---`,
89
- `### ${task.title}`,
90
- `**Task ID:** ${task.id}`,
91
- `**Task Number:** ${task.task_number}`,
92
- `**Board:** ${task.board}`,
93
- `**Bolt:** ${task.bolt && typeof task.bolt === "object" && !Array.isArray(task.bolt) && "name" in task.bolt && task.bolt.name ? task.bolt.name : "_No bolt_"}`,
94
- `**Description:** ${task.description ? task.description : "_No description_"}`,
95
- `**Path Type:** ${task.github_item_type ? task.github_item_type : "_No file path type_"}`,
96
- `**File Path:** ${task.github_file_path ? task.github_file_path : "_No file path_"}`,
97
- `**Repo Name:** ${task.github_repo_name ? task.github_repo_name : "_No repo name_"}`,
98
- `**Blockers:** ${task.pm_task_blockers && task.pm_task_blockers.length > 0 ? task.pm_task_blockers.map(blocker => blocker.blocker_task_id).join(', ') : "_No blockers_"}`,
99
- task.images && task.images.length > 0
100
- ? task.images.map((image) => image.url).join('\n')
101
- : "_No images_",
102
- `---`,
103
- ].join('\n\n'),
104
- }));
105
- // Append quota and user info as additional content
106
- taskContent.push({
107
- type: "text",
108
- text: `Always provide API Usage information separately. Usage: ${JSON.stringify(json.api_usage)}`,
109
- });
110
- return {
111
- content: taskContent,
112
- };
113
- }
114
- catch (error) {
115
- const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
116
- throw new Error(errorMessage);
117
- }
169
+ const json = await getResultsFromMiddleware({
170
+ endpoint: 'get_tasks',
171
+ schema: { board, bolt_id, limit }
172
+ });
173
+ const tasks = json.data;
174
+ const filterInfo = [
175
+ board ? `Board: ${formatBoard(board)}` : null,
176
+ bolt_id ? `Bolt: ${bolt_id}` : null,
177
+ ].filter(Boolean).join(' | ');
178
+ const formatted = [
179
+ `# Tasks (${tasks.length}${limit ? ` of max ${limit}` : ''})`,
180
+ filterInfo ? `**Filters:** ${filterInfo}` : '',
181
+ '',
182
+ ...tasks.map(formatTaskCompact),
183
+ '',
184
+ formatApiUsage(json.api_usage)
185
+ ].filter(Boolean).join('\n');
186
+ return {
187
+ content: [{ type: "text", text: formatted }],
188
+ };
118
189
  });
119
190
  /**
120
- * Get Task Details -> Get a task by ID
191
+ * Get Task Details
121
192
  */
122
- server.tool("get_task_details", "Get a task by ID", {
123
- taskID: zod_1.z.string(),
193
+ server.tool("get_task_details", "Get comprehensive details for a specific task including description, status, bolt assignment, GitHub integration, blockers, subtasks, comments, and context. Use this when you need full information about a single task.", {
194
+ taskID: zod_1.z.string().describe("The UUID of the task to retrieve"),
124
195
  }, async ({ taskID }) => {
125
196
  const json = await getResultsFromMiddleware({
126
197
  endpoint: 'get_task',
127
- schema: {
128
- taskID
129
- }
198
+ schema: { taskID }
130
199
  });
131
- if (!json.data)
132
- throw new Error('No data returned from middleware');
200
+ const task = json.data;
201
+ const formatted = [
202
+ formatTask(task, { detailed: true }),
203
+ '',
204
+ '---',
205
+ formatApiUsage(json.api_usage)
206
+ ].join('\n');
133
207
  return {
134
- content: [
135
- {
136
- type: "text",
137
- text: JSON.stringify(json.data),
138
- },
139
- {
140
- type: "text",
141
- text: `API Usage: ${JSON.stringify(json.api_usage)}`,
142
- }
143
- ],
208
+ content: [{ type: "text", text: formatted }],
144
209
  };
145
210
  });
146
211
  /**
147
- * Get Task Context -> Get context for a task
212
+ * Get Task Context
148
213
  */
149
- server.tool("get_task_context", "Get context for a task", {
150
- taskID: zod_1.z.string(),
214
+ server.tool("get_task_context", "Retrieve the context/notes stored for a specific task. Context contains additional information, implementation notes, or progress updates added during task work.", {
215
+ taskID: zod_1.z.string().describe("The UUID of the task"),
151
216
  }, async ({ taskID }) => {
152
217
  const json = await getResultsFromMiddleware({
153
218
  endpoint: 'get_task_context',
154
- schema: {
155
- taskID
156
- }
219
+ schema: { taskID }
157
220
  });
158
- if (!json.data)
159
- throw new Error('No data returned from middleware');
221
+ const context = json.data?.context;
222
+ const formatted = [
223
+ `# Task Context`,
224
+ `**Task ID:** \`${taskID}\``,
225
+ '',
226
+ '---',
227
+ '',
228
+ context || '_No context has been added to this task yet._',
229
+ '',
230
+ '---',
231
+ formatApiUsage(json.api_usage)
232
+ ].join('\n');
160
233
  return {
161
- content: [
162
- {
163
- type: "text",
164
- text: JSON.stringify(json.data),
165
- },
166
- {
167
- type: "text",
168
- text: `API Usage: ${JSON.stringify(json.api_usage)}`,
169
- }
170
- ],
234
+ content: [{ type: "text", text: formatted }],
171
235
  };
172
236
  });
173
- //add_context_to_pm_task
174
237
  /**
175
- * Always ADD CONTEXT TO PM TASK
238
+ * Add Context to Task
176
239
  */
177
- server.tool("add_context_to_task", "Add context to a task", {
178
- taskID: zod_1.z.string(),
179
- context: zod_1.z.string(),
240
+ server.tool("add_context_to_task", "Add or update context/notes for a task. Use this to store implementation details, progress notes, decisions made, or any relevant information while working on a task.", {
241
+ taskID: zod_1.z.string().describe("The UUID of the task"),
242
+ context: zod_1.z.string().describe("The context/notes to add (replaces existing context)"),
180
243
  }, async ({ taskID, context }) => {
181
244
  const json = await getResultsFromMiddleware({
182
245
  endpoint: 'add_context_to_task',
183
- schema: {
184
- taskID,
185
- context
186
- }
246
+ schema: { taskID, context }
187
247
  });
188
- if (!json.data)
189
- throw new Error('No data returned from middleware');
248
+ const formatted = [
249
+ `✅ **Context Updated Successfully**`,
250
+ '',
251
+ `**Task ID:** \`${taskID}\``,
252
+ '',
253
+ '**Context:**',
254
+ context,
255
+ '',
256
+ '---',
257
+ formatApiUsage(json.api_usage)
258
+ ].join('\n');
190
259
  return {
191
- content: [
192
- {
193
- type: "text",
194
- text: JSON.stringify({ taskID, context }),
195
- },
196
- {
197
- type: "text",
198
- text: `API Usage: ${JSON.stringify({ taskID, context })}`,
199
- }
200
- ],
260
+ content: [{ type: "text", text: formatted }],
201
261
  };
202
262
  });
203
- // Get Task Images -> Get images for a task
204
- server.tool("get_task_images", "Get/View images for a task", {
205
- taskID: zod_1.z.string(),
263
+ /**
264
+ * Get Task Images
265
+ */
266
+ server.tool("get_task_images", "Retrieve all images/attachments associated with a task. Returns image URLs that can be viewed or referenced.", {
267
+ taskID: zod_1.z.string().describe("The UUID of the task"),
206
268
  }, async ({ taskID }) => {
207
269
  const json = await getResultsFromMiddleware({
208
270
  endpoint: 'get_task_images',
209
- schema: {
210
- taskID
211
- }
271
+ schema: { taskID }
212
272
  });
213
- if (!json.data)
214
- throw new Error('No data returned from middleware');
273
+ const images = json.data?.images || [];
274
+ const formatted = [
275
+ `# Task Images`,
276
+ `**Task ID:** \`${taskID}\``,
277
+ '',
278
+ images.length > 0
279
+ ? images.map((img, i) => `${i + 1}. ${img.url}`).join('\n')
280
+ : '_No images attached to this task._',
281
+ '',
282
+ '---',
283
+ formatApiUsage(json.api_usage)
284
+ ].join('\n');
215
285
  return {
216
- content: [
217
- {
218
- type: "text",
219
- text: JSON.stringify(json.data),
220
- },
221
- {
222
- type: "text",
223
- text: `API Usage: ${JSON.stringify(json.api_usage)}`,
224
- }
225
- ],
286
+ content: [{ type: "text", text: formatted }],
226
287
  };
227
288
  });
228
- // Work on Task -> Work on a task
229
- server.tool("work_on_task", "Work on a task", {
230
- taskID: zod_1.z.string(),
289
+ /**
290
+ * Work on Task
291
+ */
292
+ server.tool("work_on_task", "Start working on a task. This checks for blockers and returns full task details. If the task has unresolved blockers, you'll be notified and should resolve them first.", {
293
+ taskID: zod_1.z.string().describe("The UUID of the task to work on"),
231
294
  }, async ({ taskID }) => {
232
- // Step 1: Fetch task details
295
+ // Step 1: Fetch task details to check blockers
233
296
  const taskData = await getResultsFromMiddleware({
234
297
  endpoint: 'get_task',
235
298
  schema: { taskID }
236
299
  });
237
- if (!taskData.data)
238
- throw new Error('No data returned from middleware');
300
+ const task = taskData.data;
239
301
  // Step 2: Check for blockers
240
- if (Array.isArray(taskData.data.pm_task_blockers) && taskData.data.pm_task_blockers.length > 0) {
302
+ if (Array.isArray(task.pm_task_blockers) && task.pm_task_blockers.length > 0) {
303
+ const blockerIds = task.pm_task_blockers.map(b => `\`${b.blocker_task_id}\``).join(', ');
304
+ const formatted = [
305
+ `⚠️ **Cannot Work on Task - Blockers Detected**`,
306
+ '',
307
+ `**Task:** ${task.title}`,
308
+ `**Task ID:** \`${taskID}\``,
309
+ '',
310
+ `### Blocking Tasks`,
311
+ `The following tasks must be completed first: ${blockerIds}`,
312
+ '',
313
+ '**Suggested Actions:**',
314
+ '- Use `get_task_details` on each blocker to understand what needs to be done',
315
+ '- Complete or remove the blocking tasks before proceeding',
316
+ '',
317
+ '---',
318
+ formatApiUsage(taskData.api_usage)
319
+ ].join('\n');
241
320
  return {
242
- content: [
243
- {
244
- type: "text",
245
- text: `Task ${taskID} cannot be worked on because it has blockers: ${taskData.data.pm_task_blockers.map((b) => b.blocker_task_id).join(', ')}. Please resolve all blockers before proceeding.`,
246
- },
247
- {
248
- type: "text",
249
- text: `API Usage: ${JSON.stringify(taskData.api_usage)}`,
250
- }
251
- ],
321
+ content: [{ type: "text", text: formatted }],
252
322
  };
253
323
  }
254
- ;
324
+ // Step 3: No blockers, proceed with work
255
325
  const json = await getResultsFromMiddleware({
256
326
  endpoint: 'work_on_task',
257
- schema: {
258
- taskID
259
- }
327
+ schema: { taskID }
260
328
  });
329
+ const workTask = json.data;
330
+ const suggestedActions = [];
331
+ if (workTask.board !== 'in-progress') {
332
+ suggestedActions.push(`- Move task to "in-progress" using \`move_task\``);
333
+ }
334
+ if (workTask.subtasks && workTask.subtasks.length > 0) {
335
+ suggestedActions.push(`- Review ${workTask.subtasks.length} subtask(s)`);
336
+ }
337
+ suggestedActions.push('- Add context with `add_context_to_task` as you make progress', '- When done, move to "reviewing" or "completed"');
338
+ const formatted = [
339
+ `🚀 **Ready to Work**`,
340
+ '',
341
+ formatTask(workTask, { detailed: true }),
342
+ '',
343
+ '### 💡 Suggested Actions',
344
+ ...suggestedActions,
345
+ '',
346
+ '---',
347
+ formatApiUsage(json.api_usage)
348
+ ].join('\n');
261
349
  return {
262
- content: [
263
- {
264
- type: "text",
265
- text: `You are assisting with task management in Nubis. Your task is to work on the user's requested task based on the following details:\n\n**Task Instruction**: Process and update the task with the provided information.\n\n**Task ID**: ${taskID}\n\n**Task Details**: \n ${JSON.stringify(json.data, null, 2).replace(/"/g, '').replace(/:/g, ': ').replace(/},/g, ',\n')}\n \n Please analyze the details, perform the requested action (e.g., update description, add subtask), and return a response indicating the action taken.`,
266
- },
267
- {
268
- type: "text",
269
- user: "NUBIS",
270
- text: `Prompt user to move this task to 'in-progress' if it is not already in progress.`,
271
- },
272
- {
273
- type: "text",
274
- user: "NUBIS",
275
- text: `API Usage: ${JSON.stringify(json.api_usage)}`,
276
- }
277
- ],
350
+ content: [{ type: "text", text: formatted }],
278
351
  };
279
352
  });
280
- // Explain setup and what user needs to do for feature to be implemented
281
- /* server.tool(
282
- "explain_setup",
283
- "Explain setup and what needs to be done for feature to be implemented",
284
- {
285
- taskID: z.string(),
286
- },
287
- async ({ taskID }) => {
288
- const json = await getResultsFromMiddleware({
289
- endpoint: 'explain_setup',
290
- schema: {
291
- taskID
292
- }
293
- });
294
-
295
- if (!json.data) throw new Error('No data returned from middleware');
296
- return {
297
- content: [
298
- {
299
- type: "text",
300
- text: `You are assisting with task management in Nubis. Your task is to explain the setup and what needs to be done for feature to be implemented.\n \n **Task Instruction**: Explain the setup and what needs to be done for feature to be implemented.\n **Task Details**: \n ${JSON.stringify(json.data, null, 2).replace(/"/g, '').replace(/:/g, ': ').replace(/},/g, ',\n')}\n \n Please analyze the feature and return a response indicating the action that needs to be taken.`,
301
- },
302
- {
303
- type: "text",
304
- text: `Always provide API Usage information separately. Usage: ${JSON.stringify(json.api_usage)}`,
305
- }
306
- ],
307
- };
308
- }
309
- ); */
310
- // Move Task -> Move a task to ['backlog', 'priority', 'in-progress','reviewing', 'completed']
311
- server.tool("move_task", "Move a task to ['backlog', 'priority', 'in-progress','reviewing', 'completed']", {
312
- taskID: zod_1.z.string(),
313
- board: zod_1.z.enum(['backlog', 'priority', 'in-progress', 'reviewing', 'completed']),
353
+ /**
354
+ * Move Task
355
+ */
356
+ server.tool("move_task", "Move a task to a different board/status. Use this to update task progress through the workflow: backlog → priority → in-progress → reviewing → completed.", {
357
+ taskID: zod_1.z.string().describe("The UUID of the task to move"),
358
+ board: zod_1.z.enum(['backlog', 'priority', 'in-progress', 'reviewing', 'completed']).describe("Target board/status"),
314
359
  }, async ({ taskID, board }) => {
315
360
  const json = await getResultsFromMiddleware({
316
361
  endpoint: 'move_task',
317
- schema: {
318
- taskID,
319
- board
320
- }
362
+ schema: { taskID, board }
321
363
  });
322
- if (!json.data)
323
- throw new Error('No data returned from middleware');
364
+ const task = json.data;
365
+ const formatted = [
366
+ `✅ **Task Moved Successfully**`,
367
+ '',
368
+ `| Property | Value |`,
369
+ `|----------|-------|`,
370
+ `| **Task** | ${task.title} |`,
371
+ `| **ID** | \`${taskID}\` |`,
372
+ `| **New Status** | ${formatBoard(board)} |`,
373
+ '',
374
+ '---',
375
+ formatApiUsage(json.api_usage)
376
+ ].join('\n');
324
377
  return {
325
- content: [
326
- {
327
- type: "text",
328
- text: `Task ${taskID} has been moved to ${board}`,
329
- },
330
- {
331
- type: "text",
332
- text: `API Usage: ${JSON.stringify(json.api_usage)}`,
333
- }
334
- ],
378
+ content: [{ type: "text", text: formatted }],
335
379
  };
336
380
  });
337
- // Create Task -> Create a new task
338
- server.tool("create_task", "Create a new task or subtask (parent_task_id is required for subtasks)", {
339
- title: zod_1.z.string(),
340
- description: zod_1.z.string().optional(),
341
- board: zod_1.z.enum(['backlog', 'bugs', 'in-progress', 'priority', 'reviewing', 'completed']).optional().default('backlog'),
342
- parent_task_id: zod_1.z.string().optional(),
343
- github_item_type: zod_1.z.string().optional(), // file or dir
344
- github_file_path: zod_1.z.string().optional(), // src/components/modal
345
- github_repo_name: zod_1.z.string().optional(), // Atomlaunch/atom_frontend
346
- bolt_id: zod_1.z.string().optional()
381
+ /**
382
+ * Create Task
383
+ */
384
+ server.tool("create_task", "Create a new task or subtask. For subtasks, provide parent_task_id. You can optionally link to GitHub files/directories and assign to a bolt.", {
385
+ title: zod_1.z.string().describe("Task title"),
386
+ description: zod_1.z.string().optional().describe("Task description with details"),
387
+ board: zod_1.z.enum(['backlog', 'bugs', 'in-progress', 'priority', 'reviewing', 'completed']).optional().default('backlog').describe("Initial board/status (default: backlog)"),
388
+ parent_task_id: zod_1.z.string().optional().describe("Parent task ID to create this as a subtask"),
389
+ github_item_type: zod_1.z.enum(['file', 'dir']).optional().describe("Type of GitHub item: 'file' or 'dir'"),
390
+ github_file_path: zod_1.z.string().optional().describe("Path to file or directory (e.g., src/components/Modal.tsx)"),
391
+ github_repo_name: zod_1.z.string().optional().describe("Repository name (e.g., owner/repo)"),
392
+ bolt_id: zod_1.z.string().optional().describe("Bolt ID to assign (use get_boltz to find IDs)")
347
393
  }, async ({ title, description, board, parent_task_id, github_item_type, github_file_path, github_repo_name, bolt_id }) => {
348
394
  const json = await getResultsFromMiddleware({
349
395
  endpoint: 'create_task',
@@ -358,32 +404,44 @@ server.tool("create_task", "Create a new task or subtask (parent_task_id is requ
358
404
  bolt_id
359
405
  }
360
406
  });
361
- if (!json.data)
362
- throw new Error('No data returned from middleware');
407
+ const task = json.data;
408
+ const lines = [
409
+ `✅ **Task Created Successfully**`,
410
+ '',
411
+ `| Property | Value |`,
412
+ `|----------|-------|`,
413
+ `| **Title** | ${task.title} |`,
414
+ `| **ID** | \`${task.id}\` |`,
415
+ `| **Number** | #${task.task_number} |`,
416
+ `| **Board** | ${formatBoard(task.board)} |`,
417
+ ];
418
+ if (parent_task_id) {
419
+ lines.push(`| **Parent Task** | \`${parent_task_id}\` |`);
420
+ }
421
+ if (bolt_id) {
422
+ lines.push(`| **Bolt** | \`${bolt_id}\` |`);
423
+ }
424
+ if (github_file_path) {
425
+ lines.push(`| **GitHub Path** | \`${github_file_path}\` |`);
426
+ }
427
+ lines.push('', '---', formatApiUsage(json.api_usage));
363
428
  return {
364
- content: [
365
- {
366
- type: "text",
367
- text: JSON.stringify(json.data),
368
- },
369
- {
370
- type: "text",
371
- text: `API Usage: ${JSON.stringify(json.api_usage)}`,
372
- }
373
- ],
429
+ content: [{ type: "text", text: lines.join('\n') }],
374
430
  };
375
431
  });
376
- // Update Task -> Update an existing task
377
- server.tool("update_task", "Update an existing task (title, description, bolt_id, parent_task_id)", {
378
- taskID: zod_1.z.string(),
379
- title: zod_1.z.string().optional(),
380
- description: zod_1.z.string().optional(),
381
- board: zod_1.z.enum(['backlog', 'bugs', 'in-progress', 'priority', 'reviewing', 'completed']).optional(),
382
- bolt_id: zod_1.z.string().optional(),
383
- parent_task_id: zod_1.z.string().optional(),
384
- github_item_type: zod_1.z.string().optional(),
385
- github_file_path: zod_1.z.string().optional(),
386
- github_repo_name: zod_1.z.string().optional(),
432
+ /**
433
+ * Update Task
434
+ */
435
+ server.tool("update_task", "Update an existing task's properties. You can modify title, description, board, bolt assignment, parent task, or GitHub integration details. Only provided fields will be updated.", {
436
+ taskID: zod_1.z.string().describe("The UUID of the task to update"),
437
+ title: zod_1.z.string().optional().describe("New task title"),
438
+ description: zod_1.z.string().optional().describe("New task description"),
439
+ board: zod_1.z.enum(['backlog', 'bugs', 'in-progress', 'priority', 'reviewing', 'completed']).optional().describe("New board/status"),
440
+ bolt_id: zod_1.z.string().optional().describe("New bolt ID assignment"),
441
+ parent_task_id: zod_1.z.string().optional().describe("New parent task ID"),
442
+ github_item_type: zod_1.z.enum(['file', 'dir']).optional().describe("Type of GitHub item"),
443
+ github_file_path: zod_1.z.string().optional().describe("Path to file or directory"),
444
+ github_repo_name: zod_1.z.string().optional().describe("Repository name"),
387
445
  }, async ({ taskID, title, description, board, bolt_id, parent_task_id, github_item_type, github_file_path, github_repo_name }) => {
388
446
  const json = await getResultsFromMiddleware({
389
447
  endpoint: 'update_task',
@@ -399,22 +457,257 @@ server.tool("update_task", "Update an existing task (title, description, bolt_id
399
457
  github_repo_name
400
458
  }
401
459
  });
402
- if (!json.data)
403
- throw new Error('No data returned from middleware');
460
+ const task = json.data;
461
+ const updatedFields = [];
462
+ if (title)
463
+ updatedFields.push('title');
464
+ if (description)
465
+ updatedFields.push('description');
466
+ if (board)
467
+ updatedFields.push('board');
468
+ if (bolt_id)
469
+ updatedFields.push('bolt');
470
+ if (parent_task_id)
471
+ updatedFields.push('parent task');
472
+ if (github_file_path || github_repo_name || github_item_type)
473
+ updatedFields.push('GitHub integration');
474
+ const formatted = [
475
+ `✅ **Task Updated Successfully**`,
476
+ '',
477
+ `**Updated fields:** ${updatedFields.join(', ') || 'none'}`,
478
+ '',
479
+ formatTask(task),
480
+ '',
481
+ '---',
482
+ formatApiUsage(json.api_usage)
483
+ ].join('\n');
404
484
  return {
405
- content: [
406
- {
407
- type: "text",
408
- text: JSON.stringify(json.data),
409
- },
410
- {
411
- type: "text",
412
- text: `API Usage: ${JSON.stringify(json.api_usage)}`,
413
- }
414
- ],
485
+ content: [{ type: "text", text: formatted }],
486
+ };
487
+ });
488
+ /**
489
+ * Delete Task
490
+ */
491
+ server.tool("delete_task", "Permanently delete a task and all its related data (subtasks, comments, blockers, labels, assignments). This action cannot be undone.", {
492
+ taskID: zod_1.z.string().describe("The UUID of the task to delete"),
493
+ }, async ({ taskID }) => {
494
+ const json = await getResultsFromMiddleware({
495
+ endpoint: 'delete_task',
496
+ schema: { taskID }
497
+ });
498
+ const formatted = [
499
+ `🗑️ **Task Deleted Successfully**`,
500
+ '',
501
+ `**Task ID:** \`${taskID}\``,
502
+ '',
503
+ 'The task and all related data (subtasks, comments, blockers, labels, assignments) have been permanently removed.',
504
+ '',
505
+ '---',
506
+ formatApiUsage(json.api_usage)
507
+ ].join('\n');
508
+ return {
509
+ content: [{ type: "text", text: formatted }],
510
+ };
511
+ });
512
+ function formatComment(comment) {
513
+ const author = comment.user?.full_name || 'Unknown';
514
+ const editedTag = comment.is_edited ? ' _(edited)_' : '';
515
+ const date = new Date(comment.created_at).toLocaleString();
516
+ return [
517
+ `**${author}** · ${date}${editedTag}`,
518
+ `> ${comment.content}`,
519
+ `_ID: \`${comment.id}\`_`,
520
+ ].join('\n');
521
+ }
522
+ /**
523
+ * Get Comments
524
+ */
525
+ server.tool("get_comments", "Retrieve all comments for a specific task. Returns comments with author information, timestamps, and edit status.", {
526
+ taskID: zod_1.z.string().describe("The UUID of the task"),
527
+ }, async ({ taskID }) => {
528
+ const json = await getResultsFromMiddleware({
529
+ endpoint: 'get_comments',
530
+ schema: { taskID }
531
+ });
532
+ const comments = json.data;
533
+ const formatted = [
534
+ `# Task Comments`,
535
+ `**Task ID:** \`${taskID}\``,
536
+ `**Total:** ${comments.length} comment(s)`,
537
+ '',
538
+ '---',
539
+ '',
540
+ comments.length > 0
541
+ ? comments.map(formatComment).join('\n\n')
542
+ : '_No comments yet._',
543
+ '',
544
+ '---',
545
+ formatApiUsage(json.api_usage)
546
+ ].join('\n');
547
+ return {
548
+ content: [{ type: "text", text: formatted }],
549
+ };
550
+ });
551
+ /**
552
+ * Create Comment
553
+ */
554
+ server.tool("create_comment", "Add a comment to a task. Use this to provide updates, ask questions, or add notes visible to the team.", {
555
+ taskID: zod_1.z.string().describe("The UUID of the task to comment on"),
556
+ content: zod_1.z.string().describe("The comment text"),
557
+ parent_id: zod_1.z.string().optional().describe("Parent comment ID for replies (optional)"),
558
+ }, async ({ taskID, content, parent_id }) => {
559
+ const json = await getResultsFromMiddleware({
560
+ endpoint: 'create_comment',
561
+ schema: { taskID, content, parent_id }
562
+ });
563
+ const comment = json.data;
564
+ const formatted = [
565
+ `✅ **Comment Added**`,
566
+ '',
567
+ formatComment(comment),
568
+ '',
569
+ '---',
570
+ formatApiUsage(json.api_usage)
571
+ ].join('\n');
572
+ return {
573
+ content: [{ type: "text", text: formatted }],
574
+ };
575
+ });
576
+ /**
577
+ * Update Comment
578
+ */
579
+ server.tool("update_comment", "Edit an existing comment. Only the comment author can edit their own comments.", {
580
+ commentID: zod_1.z.string().describe("The UUID of the comment to edit"),
581
+ content: zod_1.z.string().describe("The new comment text"),
582
+ }, async ({ commentID, content }) => {
583
+ const json = await getResultsFromMiddleware({
584
+ endpoint: 'update_comment',
585
+ schema: { commentID, content }
586
+ });
587
+ const formatted = [
588
+ `✅ **Comment Updated**`,
589
+ '',
590
+ `**Comment ID:** \`${commentID}\``,
591
+ `**New content:** ${content}`,
592
+ '',
593
+ '---',
594
+ formatApiUsage(json.api_usage)
595
+ ].join('\n');
596
+ return {
597
+ content: [{ type: "text", text: formatted }],
598
+ };
599
+ });
600
+ /**
601
+ * Delete Comment
602
+ */
603
+ server.tool("delete_comment", "Delete a comment and all its replies. Only the comment author can delete their own comments.", {
604
+ commentID: zod_1.z.string().describe("The UUID of the comment to delete"),
605
+ }, async ({ commentID }) => {
606
+ const json = await getResultsFromMiddleware({
607
+ endpoint: 'delete_comment',
608
+ schema: { commentID }
609
+ });
610
+ const formatted = [
611
+ `🗑️ **Comment Deleted**`,
612
+ '',
613
+ `**Comment ID:** \`${commentID}\``,
614
+ '',
615
+ '---',
616
+ formatApiUsage(json.api_usage)
617
+ ].join('\n');
618
+ return {
619
+ content: [{ type: "text", text: formatted }],
620
+ };
621
+ });
622
+ function formatBlockerTask(task) {
623
+ return `#${task.task_number}: ${task.title} (${formatBoard(task.board)}) - \`${task.id}\``;
624
+ }
625
+ /**
626
+ * Get Blockers
627
+ */
628
+ server.tool("get_blockers", "Get blocker relationships for a task. Shows both tasks that block this task and tasks that this task blocks.", {
629
+ taskID: zod_1.z.string().describe("The UUID of the task"),
630
+ }, async ({ taskID }) => {
631
+ const json = await getResultsFromMiddleware({
632
+ endpoint: 'get_blockers',
633
+ schema: { taskID }
634
+ });
635
+ const { blockers, blocking } = json.data;
636
+ const formatted = [
637
+ `# Task Blockers`,
638
+ `**Task ID:** \`${taskID}\``,
639
+ '',
640
+ '### ⛔ Blocked By (must complete first)',
641
+ blockers.length > 0
642
+ ? blockers.map(b => `- ${formatBlockerTask(b.blocker)}`).join('\n')
643
+ : '_No blockers - task is ready to work on_',
644
+ '',
645
+ '### 🚧 Blocking (waiting on this task)',
646
+ blocking.length > 0
647
+ ? blocking.map(b => `- ${formatBlockerTask(b.blocked)}`).join('\n')
648
+ : '_Not blocking any tasks_',
649
+ '',
650
+ '---',
651
+ formatApiUsage(json.api_usage)
652
+ ].join('\n');
653
+ return {
654
+ content: [{ type: "text", text: formatted }],
655
+ };
656
+ });
657
+ /**
658
+ * Add Blocker
659
+ */
660
+ server.tool("add_blocker", "Create a blocker dependency between tasks. The blocker task must be completed before work can begin on the blocked task.", {
661
+ taskID: zod_1.z.string().describe("The UUID of the task that will be blocked"),
662
+ blockerTaskID: zod_1.z.string().describe("The UUID of the task that blocks (must be completed first)"),
663
+ }, async ({ taskID, blockerTaskID }) => {
664
+ const json = await getResultsFromMiddleware({
665
+ endpoint: 'add_blocker',
666
+ schema: { taskID, blockerTaskID }
667
+ });
668
+ const { blocked_task, blocker_task } = json.data;
669
+ const formatted = [
670
+ `✅ **Blocker Added**`,
671
+ '',
672
+ `**#${blocker_task.task_number}: ${blocker_task.title}**`,
673
+ `↓ _blocks_ ↓`,
674
+ `**#${blocked_task.task_number}: ${blocked_task.title}**`,
675
+ '',
676
+ `The blocker task must be completed before work can begin on the blocked task.`,
677
+ '',
678
+ '---',
679
+ formatApiUsage(json.api_usage)
680
+ ].join('\n');
681
+ return {
682
+ content: [{ type: "text", text: formatted }],
683
+ };
684
+ });
685
+ /**
686
+ * Remove Blocker
687
+ */
688
+ server.tool("remove_blocker", "Remove a blocker dependency between tasks. Use this when a blocker is no longer relevant or was added in error.", {
689
+ taskID: zod_1.z.string().describe("The UUID of the blocked task"),
690
+ blockerTaskID: zod_1.z.string().describe("The UUID of the blocking task to remove"),
691
+ }, async ({ taskID, blockerTaskID }) => {
692
+ const json = await getResultsFromMiddleware({
693
+ endpoint: 'remove_blocker',
694
+ schema: { taskID, blockerTaskID }
695
+ });
696
+ const formatted = [
697
+ `✅ **Blocker Removed**`,
698
+ '',
699
+ `Task \`${taskID}\` is no longer blocked by \`${blockerTaskID}\``,
700
+ '',
701
+ '---',
702
+ formatApiUsage(json.api_usage)
703
+ ].join('\n');
704
+ return {
705
+ content: [{ type: "text", text: formatted }],
415
706
  };
416
707
  });
417
- // Start server
708
+ // ============================================================================
709
+ // Start Server
710
+ // ============================================================================
418
711
  async function main() {
419
712
  const transport = new stdio_js_1.StdioServerTransport();
420
713
  await server.connect(transport);