@lil2good/nubis-mcp-server 1.0.43 → 1.0.44
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/build/index.js +92 -34
- package/package.json +1 -1
- package/src/index.ts +77 -16
package/build/index.js
CHANGED
|
@@ -21,9 +21,10 @@ const server = new mcp_js_1.McpServer({
|
|
|
21
21
|
tools: {},
|
|
22
22
|
},
|
|
23
23
|
});
|
|
24
|
+
const backendUrl = process.env.BACKEND_URL || 'http://localhost:4000';
|
|
24
25
|
// Helper to get results from middleware
|
|
25
26
|
async function getResultsFromMiddleware({ endpoint, schema }) {
|
|
26
|
-
const response = await fetch('
|
|
27
|
+
const response = await fetch(backendUrl + '/' + endpoint, {
|
|
27
28
|
method: 'POST',
|
|
28
29
|
headers: {
|
|
29
30
|
'Content-Type': 'application/json',
|
|
@@ -116,8 +117,10 @@ server.tool("get_tasks", "Get tasks for a workspace, including subtasks, boltz,
|
|
|
116
117
|
throw new Error(errorMessage);
|
|
117
118
|
}
|
|
118
119
|
});
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
/**
|
|
121
|
+
* Get Task Details -> Get a task by ID
|
|
122
|
+
*/
|
|
123
|
+
server.tool("get_task_details", "Get a task by ID", {
|
|
121
124
|
taskID: zod_1.z.string(),
|
|
122
125
|
}, async ({ taskID }) => {
|
|
123
126
|
const json = await getResultsFromMiddleware({
|
|
@@ -141,6 +144,36 @@ server.tool("get_task", "Get a task by ID", {
|
|
|
141
144
|
],
|
|
142
145
|
};
|
|
143
146
|
});
|
|
147
|
+
//add_context_to_pm_task
|
|
148
|
+
/**
|
|
149
|
+
* Always ADD CONTEXT TO PM TASK
|
|
150
|
+
*/
|
|
151
|
+
server.tool("add_context_to_task", "Add context to a task", {
|
|
152
|
+
taskID: zod_1.z.string(),
|
|
153
|
+
context: zod_1.z.string(),
|
|
154
|
+
}, async ({ taskID, context }) => {
|
|
155
|
+
const json = await getResultsFromMiddleware({
|
|
156
|
+
endpoint: 'add_context_to_task',
|
|
157
|
+
schema: {
|
|
158
|
+
taskID,
|
|
159
|
+
context
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
if (!json.data)
|
|
163
|
+
throw new Error('No data returned from middleware');
|
|
164
|
+
return {
|
|
165
|
+
content: [
|
|
166
|
+
{
|
|
167
|
+
type: "text",
|
|
168
|
+
text: JSON.stringify({ taskID, context }),
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
type: "text",
|
|
172
|
+
text: `Always provide API Usage information separately. Usage: ${JSON.stringify({ taskID, context })}`,
|
|
173
|
+
}
|
|
174
|
+
],
|
|
175
|
+
};
|
|
176
|
+
});
|
|
144
177
|
// Get Task Images -> Get images for a task
|
|
145
178
|
server.tool("get_task_images", "Get/View images for a task", {
|
|
146
179
|
taskID: zod_1.z.string(),
|
|
@@ -187,7 +220,7 @@ server.tool("work_on_task", "Work on a task", {
|
|
|
187
220
|
},
|
|
188
221
|
{
|
|
189
222
|
type: "text",
|
|
190
|
-
text: `
|
|
223
|
+
text: `API Usage: ${JSON.stringify(taskData.api_usage)}`,
|
|
191
224
|
}
|
|
192
225
|
],
|
|
193
226
|
};
|
|
@@ -203,40 +236,51 @@ server.tool("work_on_task", "Work on a task", {
|
|
|
203
236
|
content: [
|
|
204
237
|
{
|
|
205
238
|
type: "text",
|
|
206
|
-
text: `You are assisting with task management in Nubis. Your task is to
|
|
239
|
+
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.`,
|
|
207
240
|
},
|
|
208
241
|
{
|
|
209
242
|
type: "text",
|
|
210
|
-
|
|
243
|
+
user: "NUBIS",
|
|
244
|
+
text: `Prompt user to move this task to 'in-progress' if it is not already in progress.`,
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
type: "text",
|
|
248
|
+
user: "NUBIS",
|
|
249
|
+
text: `API Usage: ${JSON.stringify(json.api_usage)}`,
|
|
211
250
|
}
|
|
212
251
|
],
|
|
213
252
|
};
|
|
214
253
|
});
|
|
215
254
|
// Explain setup and what user needs to do for feature to be implemented
|
|
216
|
-
server.tool(
|
|
217
|
-
|
|
218
|
-
|
|
255
|
+
/* server.tool(
|
|
256
|
+
"explain_setup",
|
|
257
|
+
"Explain setup and what needs to be done for feature to be implemented",
|
|
258
|
+
{
|
|
259
|
+
taskID: z.string(),
|
|
260
|
+
},
|
|
261
|
+
async ({ taskID }) => {
|
|
219
262
|
const json = await getResultsFromMiddleware({
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
263
|
+
endpoint: 'explain_setup',
|
|
264
|
+
schema: {
|
|
265
|
+
taskID
|
|
266
|
+
}
|
|
224
267
|
});
|
|
225
|
-
|
|
226
|
-
|
|
268
|
+
|
|
269
|
+
if (!json.data) throw new Error('No data returned from middleware');
|
|
227
270
|
return {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
271
|
+
content: [
|
|
272
|
+
{
|
|
273
|
+
type: "text",
|
|
274
|
+
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.`,
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
type: "text",
|
|
278
|
+
text: `Always provide API Usage information separately. Usage: ${JSON.stringify(json.api_usage)}`,
|
|
279
|
+
}
|
|
280
|
+
],
|
|
238
281
|
};
|
|
239
|
-
}
|
|
282
|
+
}
|
|
283
|
+
); */
|
|
240
284
|
// Move Task -> Move a task to ['backlog', 'priority', 'in-progress','reviewing', 'completed']
|
|
241
285
|
server.tool("move_task", "Move a task to ['backlog', 'priority', 'in-progress','reviewing', 'completed']", {
|
|
242
286
|
taskID: zod_1.z.string(),
|
|
@@ -259,7 +303,7 @@ server.tool("move_task", "Move a task to ['backlog', 'priority', 'in-progress','
|
|
|
259
303
|
},
|
|
260
304
|
{
|
|
261
305
|
type: "text",
|
|
262
|
-
text: `
|
|
306
|
+
text: `API Usage: ${JSON.stringify(json.api_usage)}`,
|
|
263
307
|
}
|
|
264
308
|
],
|
|
265
309
|
};
|
|
@@ -270,14 +314,22 @@ server.tool("create_task", "Create a new task or subtask (parent_task_id is requ
|
|
|
270
314
|
description: zod_1.z.string().optional(),
|
|
271
315
|
board: zod_1.z.enum(['backlog', 'bugs', 'in-progress', 'priority', 'reviewing', 'completed']).optional().default('backlog'),
|
|
272
316
|
parent_task_id: zod_1.z.string().optional(),
|
|
273
|
-
|
|
317
|
+
github_item_type: zod_1.z.string().optional(), // file or dir
|
|
318
|
+
github_file_path: zod_1.z.string().optional(), // src/components/modal
|
|
319
|
+
github_repo_name: zod_1.z.string().optional(), // Atomlaunch/atom_frontend
|
|
320
|
+
bolt_id: zod_1.z.string().optional()
|
|
321
|
+
}, async ({ title, description, board, parent_task_id, github_item_type, github_file_path, github_repo_name, bolt_id }) => {
|
|
274
322
|
const json = await getResultsFromMiddleware({
|
|
275
323
|
endpoint: 'create_task',
|
|
276
324
|
schema: {
|
|
277
325
|
title,
|
|
278
326
|
description,
|
|
279
327
|
board,
|
|
280
|
-
parent_task_id
|
|
328
|
+
parent_task_id,
|
|
329
|
+
github_item_type,
|
|
330
|
+
github_file_path,
|
|
331
|
+
github_repo_name,
|
|
332
|
+
bolt_id
|
|
281
333
|
}
|
|
282
334
|
});
|
|
283
335
|
if (!json.data)
|
|
@@ -290,7 +342,7 @@ server.tool("create_task", "Create a new task or subtask (parent_task_id is requ
|
|
|
290
342
|
},
|
|
291
343
|
{
|
|
292
344
|
type: "text",
|
|
293
|
-
text: `
|
|
345
|
+
text: `API Usage: ${JSON.stringify(json.api_usage)}`,
|
|
294
346
|
}
|
|
295
347
|
],
|
|
296
348
|
};
|
|
@@ -300,10 +352,13 @@ server.tool("update_task", "Update an existing task (title, description, bolt_id
|
|
|
300
352
|
taskID: zod_1.z.string(),
|
|
301
353
|
title: zod_1.z.string().optional(),
|
|
302
354
|
description: zod_1.z.string().optional(),
|
|
303
|
-
board: zod_1.z.enum(['backlog', 'bugs', 'in-progress', 'priority', 'reviewing', 'completed']),
|
|
355
|
+
board: zod_1.z.enum(['backlog', 'bugs', 'in-progress', 'priority', 'reviewing', 'completed']).optional().default('backlog'),
|
|
304
356
|
bolt_id: zod_1.z.string().optional(),
|
|
305
357
|
parent_task_id: zod_1.z.string().optional(),
|
|
306
|
-
|
|
358
|
+
github_item_type: zod_1.z.string().optional(),
|
|
359
|
+
github_file_path: zod_1.z.string().optional(),
|
|
360
|
+
github_repo_name: zod_1.z.string().optional(),
|
|
361
|
+
}, async ({ taskID, title, description, board, bolt_id, parent_task_id, github_item_type, github_file_path, github_repo_name }) => {
|
|
307
362
|
const json = await getResultsFromMiddleware({
|
|
308
363
|
endpoint: 'update_task',
|
|
309
364
|
schema: {
|
|
@@ -312,7 +367,10 @@ server.tool("update_task", "Update an existing task (title, description, bolt_id
|
|
|
312
367
|
description,
|
|
313
368
|
board,
|
|
314
369
|
bolt_id,
|
|
315
|
-
parent_task_id
|
|
370
|
+
parent_task_id,
|
|
371
|
+
github_item_type,
|
|
372
|
+
github_file_path,
|
|
373
|
+
github_repo_name
|
|
316
374
|
}
|
|
317
375
|
});
|
|
318
376
|
if (!json.data)
|
|
@@ -325,7 +383,7 @@ server.tool("update_task", "Update an existing task (title, description, bolt_id
|
|
|
325
383
|
},
|
|
326
384
|
{
|
|
327
385
|
type: "text",
|
|
328
|
-
text: `
|
|
386
|
+
text: `API Usage: ${JSON.stringify(json.api_usage)}`,
|
|
329
387
|
}
|
|
330
388
|
],
|
|
331
389
|
};
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
4
4
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import dotenv from 'dotenv';
|
|
7
|
+
import { json } from "stream/consumers";
|
|
7
8
|
|
|
8
9
|
dotenv.config();
|
|
9
10
|
|
|
@@ -21,9 +22,11 @@ const server = new McpServer({
|
|
|
21
22
|
},
|
|
22
23
|
});
|
|
23
24
|
|
|
25
|
+
const backendUrl = 'https://mcp-server.nubis.app/';
|
|
26
|
+
|
|
24
27
|
// Helper to get results from middleware
|
|
25
28
|
async function getResultsFromMiddleware({endpoint, schema}: {endpoint: string, schema: any}) {
|
|
26
|
-
const response = await fetch('
|
|
29
|
+
const response = await fetch(backendUrl + '/' + endpoint, {
|
|
27
30
|
method: 'POST',
|
|
28
31
|
headers: {
|
|
29
32
|
'Content-Type': 'application/json',
|
|
@@ -151,9 +154,11 @@ server.tool(
|
|
|
151
154
|
}
|
|
152
155
|
);
|
|
153
156
|
|
|
154
|
-
|
|
157
|
+
/**
|
|
158
|
+
* Get Task Details -> Get a task by ID
|
|
159
|
+
*/
|
|
155
160
|
server.tool(
|
|
156
|
-
"
|
|
161
|
+
"get_task_details",
|
|
157
162
|
"Get a task by ID",
|
|
158
163
|
{
|
|
159
164
|
taskID: z.string(),
|
|
@@ -181,6 +186,41 @@ server.tool(
|
|
|
181
186
|
}
|
|
182
187
|
);
|
|
183
188
|
|
|
189
|
+
//add_context_to_pm_task
|
|
190
|
+
/**
|
|
191
|
+
* Always ADD CONTEXT TO PM TASK
|
|
192
|
+
*/
|
|
193
|
+
server.tool(
|
|
194
|
+
"add_context_to_task",
|
|
195
|
+
"Add context to a task",
|
|
196
|
+
{
|
|
197
|
+
taskID: z.string(),
|
|
198
|
+
context: z.string(),
|
|
199
|
+
},
|
|
200
|
+
async ({ taskID, context }) => {
|
|
201
|
+
const json = await getResultsFromMiddleware({
|
|
202
|
+
endpoint: 'add_context_to_task',
|
|
203
|
+
schema: {
|
|
204
|
+
taskID,
|
|
205
|
+
context
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
if (!json.data) throw new Error('No data returned from middleware');
|
|
209
|
+
return {
|
|
210
|
+
content: [
|
|
211
|
+
{
|
|
212
|
+
type: "text",
|
|
213
|
+
text: JSON.stringify({ taskID, context }),
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
type: "text",
|
|
217
|
+
text: `Always provide API Usage information separately. Usage: ${JSON.stringify({ taskID, context })}`,
|
|
218
|
+
}
|
|
219
|
+
],
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
|
|
184
224
|
// Get Task Images -> Get images for a task
|
|
185
225
|
server.tool(
|
|
186
226
|
"get_task_images",
|
|
@@ -235,7 +275,7 @@ server.tool(
|
|
|
235
275
|
},
|
|
236
276
|
{
|
|
237
277
|
type: "text",
|
|
238
|
-
text: `
|
|
278
|
+
text: `API Usage: ${JSON.stringify(taskData.api_usage)}`,
|
|
239
279
|
}
|
|
240
280
|
],
|
|
241
281
|
};
|
|
@@ -252,11 +292,18 @@ server.tool(
|
|
|
252
292
|
content: [
|
|
253
293
|
{
|
|
254
294
|
type: "text",
|
|
255
|
-
text: `You are assisting with task management in Nubis. Your task is to
|
|
295
|
+
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.`,
|
|
256
296
|
},
|
|
257
297
|
{
|
|
258
298
|
type: "text",
|
|
259
|
-
|
|
299
|
+
user: "NUBIS",
|
|
300
|
+
text: `Prompt user to move this task to 'in-progress' if it is not already in progress.`,
|
|
301
|
+
},
|
|
302
|
+
|
|
303
|
+
{
|
|
304
|
+
type: "text",
|
|
305
|
+
user: "NUBIS",
|
|
306
|
+
text: `API Usage: ${JSON.stringify(json.api_usage)}`,
|
|
260
307
|
}
|
|
261
308
|
],
|
|
262
309
|
};
|
|
@@ -264,7 +311,7 @@ server.tool(
|
|
|
264
311
|
);
|
|
265
312
|
|
|
266
313
|
// Explain setup and what user needs to do for feature to be implemented
|
|
267
|
-
server.tool(
|
|
314
|
+
/* server.tool(
|
|
268
315
|
"explain_setup",
|
|
269
316
|
"Explain setup and what needs to be done for feature to be implemented",
|
|
270
317
|
{
|
|
@@ -292,7 +339,7 @@ server.tool(
|
|
|
292
339
|
],
|
|
293
340
|
};
|
|
294
341
|
}
|
|
295
|
-
);
|
|
342
|
+
); */
|
|
296
343
|
|
|
297
344
|
// Move Task -> Move a task to ['backlog', 'priority', 'in-progress','reviewing', 'completed']
|
|
298
345
|
server.tool(
|
|
@@ -319,7 +366,7 @@ server.tool(
|
|
|
319
366
|
},
|
|
320
367
|
{
|
|
321
368
|
type: "text",
|
|
322
|
-
text: `
|
|
369
|
+
text: `API Usage: ${JSON.stringify(json.api_usage)}`,
|
|
323
370
|
}
|
|
324
371
|
],
|
|
325
372
|
};
|
|
@@ -335,15 +382,23 @@ server.tool(
|
|
|
335
382
|
description: z.string().optional(),
|
|
336
383
|
board: z.enum(['backlog', 'bugs', 'in-progress', 'priority', 'reviewing', 'completed']).optional().default('backlog'),
|
|
337
384
|
parent_task_id: z.string().optional(),
|
|
385
|
+
github_item_type: z.string().optional(), // file or dir
|
|
386
|
+
github_file_path: z.string().optional(), // src/components/modal
|
|
387
|
+
github_repo_name: z.string().optional(), // Atomlaunch/atom_frontend
|
|
388
|
+
bolt_id: z.string().optional()
|
|
338
389
|
},
|
|
339
|
-
async ({ title, description, board, parent_task_id }) => {
|
|
390
|
+
async ({ title, description, board, parent_task_id, github_item_type, github_file_path, github_repo_name, bolt_id }) => {
|
|
340
391
|
const json = await getResultsFromMiddleware({
|
|
341
392
|
endpoint: 'create_task',
|
|
342
393
|
schema: {
|
|
343
394
|
title,
|
|
344
395
|
description,
|
|
345
396
|
board,
|
|
346
|
-
parent_task_id
|
|
397
|
+
parent_task_id,
|
|
398
|
+
github_item_type,
|
|
399
|
+
github_file_path,
|
|
400
|
+
github_repo_name,
|
|
401
|
+
bolt_id
|
|
347
402
|
}
|
|
348
403
|
});
|
|
349
404
|
if (!json.data) throw new Error('No data returned from middleware');
|
|
@@ -355,7 +410,7 @@ server.tool(
|
|
|
355
410
|
},
|
|
356
411
|
{
|
|
357
412
|
type: "text",
|
|
358
|
-
text: `
|
|
413
|
+
text: `API Usage: ${JSON.stringify(json.api_usage)}`,
|
|
359
414
|
}
|
|
360
415
|
],
|
|
361
416
|
};
|
|
@@ -370,11 +425,14 @@ server.tool(
|
|
|
370
425
|
taskID: z.string(),
|
|
371
426
|
title: z.string().optional(),
|
|
372
427
|
description: z.string().optional(),
|
|
373
|
-
board: z.enum(['backlog', 'bugs', 'in-progress', 'priority', 'reviewing', 'completed']),
|
|
428
|
+
board: z.enum(['backlog', 'bugs', 'in-progress', 'priority', 'reviewing', 'completed']).optional(),
|
|
374
429
|
bolt_id: z.string().optional(),
|
|
375
430
|
parent_task_id: z.string().optional(),
|
|
431
|
+
github_item_type: z.string().optional(),
|
|
432
|
+
github_file_path: z.string().optional(),
|
|
433
|
+
github_repo_name: z.string().optional(),
|
|
376
434
|
},
|
|
377
|
-
async ({ taskID, title, description, board, bolt_id, parent_task_id }) => {
|
|
435
|
+
async ({ taskID, title, description, board, bolt_id, parent_task_id, github_item_type, github_file_path, github_repo_name }) => {
|
|
378
436
|
const json = await getResultsFromMiddleware({
|
|
379
437
|
endpoint: 'update_task',
|
|
380
438
|
schema: {
|
|
@@ -383,7 +441,10 @@ server.tool(
|
|
|
383
441
|
description,
|
|
384
442
|
board,
|
|
385
443
|
bolt_id,
|
|
386
|
-
parent_task_id
|
|
444
|
+
parent_task_id,
|
|
445
|
+
github_item_type,
|
|
446
|
+
github_file_path,
|
|
447
|
+
github_repo_name
|
|
387
448
|
}
|
|
388
449
|
});
|
|
389
450
|
if (!json.data) throw new Error('No data returned from middleware');
|
|
@@ -395,7 +456,7 @@ server.tool(
|
|
|
395
456
|
},
|
|
396
457
|
{
|
|
397
458
|
type: "text",
|
|
398
|
-
text: `
|
|
459
|
+
text: `API Usage: ${JSON.stringify(json.api_usage)}`,
|
|
399
460
|
}
|
|
400
461
|
],
|
|
401
462
|
};
|