@intangle/mcp-server 1.0.5 → 1.0.7
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/index.js +116 -1
- package/index.ts +124 -1
- 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.7";
|
|
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",
|
|
@@ -154,6 +184,21 @@ const TOOLS = [
|
|
|
154
184
|
required: ["memory_id"],
|
|
155
185
|
},
|
|
156
186
|
},
|
|
187
|
+
{
|
|
188
|
+
name: "batch_delete_memories",
|
|
189
|
+
description: "Delete multiple memories in a single transaction. All-or-nothing operation.",
|
|
190
|
+
inputSchema: {
|
|
191
|
+
type: "object",
|
|
192
|
+
properties: {
|
|
193
|
+
memory_ids: {
|
|
194
|
+
type: "array",
|
|
195
|
+
items: { type: "string" },
|
|
196
|
+
description: "Array of memory IDs to delete",
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
required: ["memory_ids"],
|
|
200
|
+
},
|
|
201
|
+
},
|
|
157
202
|
{
|
|
158
203
|
name: "debug_memory_structure",
|
|
159
204
|
description: "Debug tool to inspect the current memory structure in the database",
|
|
@@ -170,6 +215,37 @@ const TOOLS = [
|
|
|
170
215
|
properties: {},
|
|
171
216
|
},
|
|
172
217
|
},
|
|
218
|
+
{
|
|
219
|
+
name: "create_space",
|
|
220
|
+
description: "Create a new space with optional startup configuration. The 'start' tool loads this configuration when beginning work in this space. Checks user's plan limits and returns upgrade link if limit reached.",
|
|
221
|
+
inputSchema: {
|
|
222
|
+
type: "object",
|
|
223
|
+
properties: {
|
|
224
|
+
name: {
|
|
225
|
+
type: "string",
|
|
226
|
+
description: "Name for the space (e.g., 'Work', 'Personal', 'Project X')",
|
|
227
|
+
},
|
|
228
|
+
description: {
|
|
229
|
+
type: "string",
|
|
230
|
+
description: "Brief description of what this space is for (e.g., 'Work-related memories and tasks')",
|
|
231
|
+
},
|
|
232
|
+
startup_context: {
|
|
233
|
+
type: "string",
|
|
234
|
+
description: "Context and keywords provided to AI when starting this space. Include role, preferences, common tasks, and relevant search terms. This helps the AI understand what information to prioritize from memory.",
|
|
235
|
+
},
|
|
236
|
+
startup_preferences: {
|
|
237
|
+
type: "string",
|
|
238
|
+
description: "AI behavior preferences for this space. Guides how the AI should interact and respond when working in this context (e.g., 'Be concise and technical', 'Focus on creative solutions').",
|
|
239
|
+
},
|
|
240
|
+
include_tasks: {
|
|
241
|
+
type: "boolean",
|
|
242
|
+
description: "Whether to automatically retrieve pending/in-progress tasks when running the 'start' tool for this space",
|
|
243
|
+
default: false,
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
required: ["name"],
|
|
247
|
+
},
|
|
248
|
+
},
|
|
173
249
|
{
|
|
174
250
|
name: "get_space_info",
|
|
175
251
|
description: "Get detailed information about a specific space",
|
|
@@ -324,6 +400,21 @@ const TOOLS = [
|
|
|
324
400
|
required: ["task_id"],
|
|
325
401
|
},
|
|
326
402
|
},
|
|
403
|
+
{
|
|
404
|
+
name: "batch_delete_tasks",
|
|
405
|
+
description: "Delete multiple tasks in a single transaction. All-or-nothing operation.",
|
|
406
|
+
inputSchema: {
|
|
407
|
+
type: "object",
|
|
408
|
+
properties: {
|
|
409
|
+
task_ids: {
|
|
410
|
+
type: "array",
|
|
411
|
+
items: { type: "string" },
|
|
412
|
+
description: "Array of task IDs to delete",
|
|
413
|
+
},
|
|
414
|
+
},
|
|
415
|
+
required: ["task_ids"],
|
|
416
|
+
},
|
|
417
|
+
},
|
|
327
418
|
];
|
|
328
419
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
329
420
|
tools: TOOLS,
|
|
@@ -379,6 +470,9 @@ async function handleDebugStructure() {
|
|
|
379
470
|
async function handleListSpaces() {
|
|
380
471
|
return makeApiCall("list-spaces", {});
|
|
381
472
|
}
|
|
473
|
+
async function handleCreateSpace(args) {
|
|
474
|
+
return makeApiCall("create-space", args);
|
|
475
|
+
}
|
|
382
476
|
async function handleGetSpaceInfo(args) {
|
|
383
477
|
const { space_id } = args;
|
|
384
478
|
return makeApiCall("get-space-info", { space_id });
|
|
@@ -402,6 +496,12 @@ async function handleListTasks(args) {
|
|
|
402
496
|
async function handleDeleteTask(args) {
|
|
403
497
|
return makeApiCall("delete-task", args);
|
|
404
498
|
}
|
|
499
|
+
async function handleBatchDeleteMemories(args) {
|
|
500
|
+
return makeApiCall("batch-delete-memories", args);
|
|
501
|
+
}
|
|
502
|
+
async function handleBatchDeleteTasks(args) {
|
|
503
|
+
return makeApiCall("batch-delete-tasks", args);
|
|
504
|
+
}
|
|
405
505
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
406
506
|
const { name, arguments: args } = request.params;
|
|
407
507
|
try {
|
|
@@ -428,6 +528,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
428
528
|
case "list_spaces":
|
|
429
529
|
result = await handleListSpaces();
|
|
430
530
|
break;
|
|
531
|
+
case "create_space":
|
|
532
|
+
result = await handleCreateSpace(args);
|
|
533
|
+
break;
|
|
431
534
|
case "get_space_info":
|
|
432
535
|
result = await handleGetSpaceInfo(args);
|
|
433
536
|
break;
|
|
@@ -449,11 +552,23 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
449
552
|
case "delete_task":
|
|
450
553
|
result = await handleDeleteTask(args);
|
|
451
554
|
break;
|
|
555
|
+
case "batch_delete_memories":
|
|
556
|
+
result = await handleBatchDeleteMemories(args);
|
|
557
|
+
break;
|
|
558
|
+
case "batch_delete_tasks":
|
|
559
|
+
result = await handleBatchDeleteTasks(args);
|
|
560
|
+
break;
|
|
452
561
|
default:
|
|
453
562
|
throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
|
|
454
563
|
}
|
|
564
|
+
// Add version warning to response if outdated
|
|
565
|
+
let responseText = JSON.stringify(result, null, 2);
|
|
566
|
+
if (latestVersion && latestVersion !== CURRENT_VERSION) {
|
|
567
|
+
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`;
|
|
568
|
+
responseText += warning;
|
|
569
|
+
}
|
|
455
570
|
return {
|
|
456
|
-
content: [{ type: "text", text:
|
|
571
|
+
content: [{ type: "text", text: responseText }],
|
|
457
572
|
};
|
|
458
573
|
}
|
|
459
574
|
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.7";
|
|
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",
|
|
@@ -185,6 +217,22 @@ const TOOLS = [
|
|
|
185
217
|
required: ["memory_id"],
|
|
186
218
|
},
|
|
187
219
|
},
|
|
220
|
+
{
|
|
221
|
+
name: "batch_delete_memories",
|
|
222
|
+
description:
|
|
223
|
+
"Delete multiple memories in a single transaction. All-or-nothing operation.",
|
|
224
|
+
inputSchema: {
|
|
225
|
+
type: "object",
|
|
226
|
+
properties: {
|
|
227
|
+
memory_ids: {
|
|
228
|
+
type: "array",
|
|
229
|
+
items: { type: "string" },
|
|
230
|
+
description: "Array of memory IDs to delete",
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
required: ["memory_ids"],
|
|
234
|
+
},
|
|
235
|
+
},
|
|
188
236
|
{
|
|
189
237
|
name: "debug_memory_structure",
|
|
190
238
|
description:
|
|
@@ -203,6 +251,38 @@ const TOOLS = [
|
|
|
203
251
|
properties: {},
|
|
204
252
|
},
|
|
205
253
|
},
|
|
254
|
+
{
|
|
255
|
+
name: "create_space",
|
|
256
|
+
description:
|
|
257
|
+
"Create a new space with optional startup configuration. The 'start' tool loads this configuration when beginning work in this space. Checks user's plan limits and returns upgrade link if limit reached.",
|
|
258
|
+
inputSchema: {
|
|
259
|
+
type: "object",
|
|
260
|
+
properties: {
|
|
261
|
+
name: {
|
|
262
|
+
type: "string",
|
|
263
|
+
description: "Name for the space (e.g., 'Work', 'Personal', 'Project X')",
|
|
264
|
+
},
|
|
265
|
+
description: {
|
|
266
|
+
type: "string",
|
|
267
|
+
description: "Brief description of what this space is for (e.g., 'Work-related memories and tasks')",
|
|
268
|
+
},
|
|
269
|
+
startup_context: {
|
|
270
|
+
type: "string",
|
|
271
|
+
description: "Context and keywords provided to AI when starting this space. Include role, preferences, common tasks, and relevant search terms. This helps the AI understand what information to prioritize from memory.",
|
|
272
|
+
},
|
|
273
|
+
startup_preferences: {
|
|
274
|
+
type: "string",
|
|
275
|
+
description: "AI behavior preferences for this space. Guides how the AI should interact and respond when working in this context (e.g., 'Be concise and technical', 'Focus on creative solutions').",
|
|
276
|
+
},
|
|
277
|
+
include_tasks: {
|
|
278
|
+
type: "boolean",
|
|
279
|
+
description: "Whether to automatically retrieve pending/in-progress tasks when running the 'start' tool for this space",
|
|
280
|
+
default: false,
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
required: ["name"],
|
|
284
|
+
},
|
|
285
|
+
},
|
|
206
286
|
{
|
|
207
287
|
name: "get_space_info",
|
|
208
288
|
description: "Get detailed information about a specific space",
|
|
@@ -360,6 +440,22 @@ const TOOLS = [
|
|
|
360
440
|
required: ["task_id"],
|
|
361
441
|
},
|
|
362
442
|
},
|
|
443
|
+
{
|
|
444
|
+
name: "batch_delete_tasks",
|
|
445
|
+
description:
|
|
446
|
+
"Delete multiple tasks in a single transaction. All-or-nothing operation.",
|
|
447
|
+
inputSchema: {
|
|
448
|
+
type: "object",
|
|
449
|
+
properties: {
|
|
450
|
+
task_ids: {
|
|
451
|
+
type: "array",
|
|
452
|
+
items: { type: "string" },
|
|
453
|
+
description: "Array of task IDs to delete",
|
|
454
|
+
},
|
|
455
|
+
},
|
|
456
|
+
required: ["task_ids"],
|
|
457
|
+
},
|
|
458
|
+
},
|
|
363
459
|
];
|
|
364
460
|
|
|
365
461
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
@@ -459,6 +555,10 @@ async function handleListSpaces() {
|
|
|
459
555
|
return makeApiCall("list-spaces", {});
|
|
460
556
|
}
|
|
461
557
|
|
|
558
|
+
async function handleCreateSpace(args: any) {
|
|
559
|
+
return makeApiCall("create-space", args);
|
|
560
|
+
}
|
|
561
|
+
|
|
462
562
|
async function handleGetSpaceInfo(args: any) {
|
|
463
563
|
const { space_id } = args as { space_id: string };
|
|
464
564
|
return makeApiCall("get-space-info", { space_id });
|
|
@@ -489,6 +589,13 @@ async function handleDeleteTask(args: any) {
|
|
|
489
589
|
return makeApiCall("delete-task", args);
|
|
490
590
|
}
|
|
491
591
|
|
|
592
|
+
async function handleBatchDeleteMemories(args: any) {
|
|
593
|
+
return makeApiCall("batch-delete-memories", args);
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
async function handleBatchDeleteTasks(args: any) {
|
|
597
|
+
return makeApiCall("batch-delete-tasks", args);
|
|
598
|
+
}
|
|
492
599
|
|
|
493
600
|
server.setRequestHandler(CallToolRequestSchema, async (request: any) => {
|
|
494
601
|
const { name, arguments: args } = request.params;
|
|
@@ -518,6 +625,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request: any) => {
|
|
|
518
625
|
case "list_spaces":
|
|
519
626
|
result = await handleListSpaces();
|
|
520
627
|
break;
|
|
628
|
+
case "create_space":
|
|
629
|
+
result = await handleCreateSpace(args);
|
|
630
|
+
break;
|
|
521
631
|
case "get_space_info":
|
|
522
632
|
result = await handleGetSpaceInfo(args);
|
|
523
633
|
break;
|
|
@@ -539,12 +649,25 @@ server.setRequestHandler(CallToolRequestSchema, async (request: any) => {
|
|
|
539
649
|
case "delete_task":
|
|
540
650
|
result = await handleDeleteTask(args);
|
|
541
651
|
break;
|
|
652
|
+
case "batch_delete_memories":
|
|
653
|
+
result = await handleBatchDeleteMemories(args);
|
|
654
|
+
break;
|
|
655
|
+
case "batch_delete_tasks":
|
|
656
|
+
result = await handleBatchDeleteTasks(args);
|
|
657
|
+
break;
|
|
542
658
|
default:
|
|
543
659
|
throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
|
|
544
660
|
}
|
|
545
661
|
|
|
662
|
+
// Add version warning to response if outdated
|
|
663
|
+
let responseText = JSON.stringify(result, null, 2);
|
|
664
|
+
if (latestVersion && latestVersion !== CURRENT_VERSION) {
|
|
665
|
+
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`;
|
|
666
|
+
responseText += warning;
|
|
667
|
+
}
|
|
668
|
+
|
|
546
669
|
return {
|
|
547
|
-
content: [{ type: "text", text:
|
|
670
|
+
content: [{ type: "text", text: responseText }],
|
|
548
671
|
};
|
|
549
672
|
} catch (error) {
|
|
550
673
|
throw new McpError(
|