@intangle/mcp-server 1.0.4 → 1.0.6

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/dist/index.js +37 -21
  2. package/index.ts +40 -21
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -20,6 +20,36 @@ if (!MCP_API_KEY) {
20
20
  process.exit(1);
21
21
  }
22
22
  console.log("Intangle MCP Server starting - connecting to", API_BASE_URL);
23
+ // Version checking
24
+ // IMPORTANT: Update BOTH package.json version AND this constant when bumping version
25
+ const CURRENT_VERSION = "1.0.6";
26
+ let latestVersion = null;
27
+ let versionCheckDone = false;
28
+ async function checkVersion() {
29
+ if (versionCheckDone)
30
+ return;
31
+ try {
32
+ const response = await fetch("https://registry.npmjs.org/@intangle/mcp-server/latest");
33
+ const data = await response.json();
34
+ latestVersion = data.version;
35
+ versionCheckDone = true;
36
+ if (latestVersion && latestVersion !== CURRENT_VERSION) {
37
+ console.warn("\n⚠️ UPDATE AVAILABLE ⚠️");
38
+ console.warn(`Current version: ${CURRENT_VERSION}`);
39
+ console.warn(`Latest version: ${latestVersion}`);
40
+ console.warn("Update with: npx @intangle/mcp-server@latest\n");
41
+ }
42
+ else {
43
+ console.log(`✓ Running latest version (${CURRENT_VERSION})`);
44
+ }
45
+ }
46
+ catch (error) {
47
+ // Silently fail version check - don't block startup
48
+ versionCheckDone = true;
49
+ }
50
+ }
51
+ // Check version on startup (non-blocking)
52
+ checkVersion();
23
53
  async function makeApiCall(endpoint, data) {
24
54
  const response = await fetch(`${API_BASE_URL}/api/mcp/${endpoint}`, {
25
55
  method: "POST",
@@ -324,20 +354,6 @@ const TOOLS = [
324
354
  required: ["task_id"],
325
355
  },
326
356
  },
327
- {
328
- name: "list_subtasks",
329
- description: "Get all subtasks of a parent task",
330
- inputSchema: {
331
- type: "object",
332
- properties: {
333
- parent_id: {
334
- type: "string",
335
- description: "Parent task ID",
336
- },
337
- },
338
- required: ["parent_id"],
339
- },
340
- },
341
357
  ];
342
358
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
343
359
  tools: TOOLS,
@@ -416,9 +432,6 @@ async function handleListTasks(args) {
416
432
  async function handleDeleteTask(args) {
417
433
  return makeApiCall("delete-task", args);
418
434
  }
419
- async function handleListSubtasks(args) {
420
- return makeApiCall("list-subtasks", args);
421
- }
422
435
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
423
436
  const { name, arguments: args } = request.params;
424
437
  try {
@@ -466,14 +479,17 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
466
479
  case "delete_task":
467
480
  result = await handleDeleteTask(args);
468
481
  break;
469
- case "list_subtasks":
470
- result = await handleListSubtasks(args);
471
- break;
472
482
  default:
473
483
  throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
474
484
  }
485
+ // Add version warning to response if outdated
486
+ let responseText = JSON.stringify(result, null, 2);
487
+ if (latestVersion && latestVersion !== CURRENT_VERSION) {
488
+ const warning = `\n\n⚠️ UPDATE AVAILABLE: MCP Server v${latestVersion} is available (you're on v${CURRENT_VERSION}). Update with: npx @intangle/mcp-server@latest`;
489
+ responseText += warning;
490
+ }
475
491
  return {
476
- content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
492
+ content: [{ type: "text", text: responseText }],
477
493
  };
478
494
  }
479
495
  catch (error) {
package/index.ts CHANGED
@@ -33,6 +33,38 @@ if (!MCP_API_KEY) {
33
33
 
34
34
  console.log("Intangle MCP Server starting - connecting to", API_BASE_URL);
35
35
 
36
+ // Version checking
37
+ // IMPORTANT: Update BOTH package.json version AND this constant when bumping version
38
+ const CURRENT_VERSION = "1.0.6";
39
+ let latestVersion: string | null = null;
40
+ let versionCheckDone = false;
41
+
42
+ async function checkVersion() {
43
+ if (versionCheckDone) return;
44
+
45
+ try {
46
+ const response = await fetch("https://registry.npmjs.org/@intangle/mcp-server/latest");
47
+ const data = await response.json() as { version: string };
48
+ latestVersion = data.version;
49
+ versionCheckDone = true;
50
+
51
+ if (latestVersion && latestVersion !== CURRENT_VERSION) {
52
+ console.warn("\n⚠️ UPDATE AVAILABLE ⚠️");
53
+ console.warn(`Current version: ${CURRENT_VERSION}`);
54
+ console.warn(`Latest version: ${latestVersion}`);
55
+ console.warn("Update with: npx @intangle/mcp-server@latest\n");
56
+ } else {
57
+ console.log(`✓ Running latest version (${CURRENT_VERSION})`);
58
+ }
59
+ } catch (error) {
60
+ // Silently fail version check - don't block startup
61
+ versionCheckDone = true;
62
+ }
63
+ }
64
+
65
+ // Check version on startup (non-blocking)
66
+ checkVersion();
67
+
36
68
  async function makeApiCall(endpoint: string, data: any) {
37
69
  const response = await fetch(`${API_BASE_URL}/api/mcp/${endpoint}`, {
38
70
  method: "POST",
@@ -360,20 +392,6 @@ const TOOLS = [
360
392
  required: ["task_id"],
361
393
  },
362
394
  },
363
- {
364
- name: "list_subtasks",
365
- description: "Get all subtasks of a parent task",
366
- inputSchema: {
367
- type: "object",
368
- properties: {
369
- parent_id: {
370
- type: "string",
371
- description: "Parent task ID",
372
- },
373
- },
374
- required: ["parent_id"],
375
- },
376
- },
377
395
  ];
378
396
 
379
397
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
@@ -503,9 +521,6 @@ async function handleDeleteTask(args: any) {
503
521
  return makeApiCall("delete-task", args);
504
522
  }
505
523
 
506
- async function handleListSubtasks(args: any) {
507
- return makeApiCall("list-subtasks", args);
508
- }
509
524
 
510
525
  server.setRequestHandler(CallToolRequestSchema, async (request: any) => {
511
526
  const { name, arguments: args } = request.params;
@@ -556,15 +571,19 @@ server.setRequestHandler(CallToolRequestSchema, async (request: any) => {
556
571
  case "delete_task":
557
572
  result = await handleDeleteTask(args);
558
573
  break;
559
- case "list_subtasks":
560
- result = await handleListSubtasks(args);
561
- break;
562
574
  default:
563
575
  throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
564
576
  }
565
577
 
578
+ // Add version warning to response if outdated
579
+ let responseText = JSON.stringify(result, null, 2);
580
+ if (latestVersion && latestVersion !== CURRENT_VERSION) {
581
+ const warning = `\n\n⚠️ UPDATE AVAILABLE: MCP Server v${latestVersion} is available (you're on v${CURRENT_VERSION}). Update with: npx @intangle/mcp-server@latest`;
582
+ responseText += warning;
583
+ }
584
+
566
585
  return {
567
- content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
586
+ content: [{ type: "text", text: responseText }],
568
587
  };
569
588
  } catch (error) {
570
589
  throw new McpError(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intangle/mcp-server",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Model Context Protocol server for Intangle - AI memory that persists across conversations",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",