@intangle/mcp-server 1.0.10 → 1.1.1

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 +105 -6
  2. package/index.ts +108 -6
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7,6 +7,9 @@ import fetch from "node-fetch";
7
7
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
8
8
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
9
9
  import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError, } from "@modelcontextprotocol/sdk/types.js";
10
+ import { readFileSync } from 'fs';
11
+ import { fileURLToPath } from 'url';
12
+ import { dirname, join } from 'path';
10
13
  // Load environment variables from .env and .env.local
11
14
  config({ quiet: true });
12
15
  config({ path: ".env.local", quiet: true });
@@ -20,9 +23,10 @@ if (!MCP_API_KEY) {
20
23
  process.exit(1);
21
24
  }
22
25
  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.10";
26
+ // Version checking - automatically read from package.json
27
+ const __dirname = dirname(fileURLToPath(import.meta.url));
28
+ const packageJson = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf-8'));
29
+ const CURRENT_VERSION = packageJson.version;
26
30
  let latestVersion = null;
27
31
  let versionCheckDone = false;
28
32
  async function checkVersion() {
@@ -185,6 +189,24 @@ const TOOLS = [
185
189
  required: ["space_id"],
186
190
  },
187
191
  },
192
+ {
193
+ name: "fetch",
194
+ description: "Fetch complete items (context or tasks) by ID. Accepts single ID or array of IDs. Returns BOTH context (Memory nodes) and tasks (Task nodes) with full content, topics, and metadata. Always returns full content (never summaries). Use this after getting summaries from search/list/start to retrieve full details for specific items.",
195
+ inputSchema: {
196
+ type: "object",
197
+ properties: {
198
+ id: {
199
+ type: "string",
200
+ description: "Single ID to fetch (context or task ID like 'mem_123' or 'task_456')",
201
+ },
202
+ ids: {
203
+ type: "array",
204
+ items: { type: "string" },
205
+ description: "Array of IDs to fetch (mix of context and task IDs). Use this to fetch multiple items in one call.",
206
+ },
207
+ },
208
+ },
209
+ },
188
210
  {
189
211
  name: "get_entities",
190
212
  description: "Get extracted entities (people, places, concepts) from CONTEXT items (general information). If no memory_id provided, returns top 20 most frequently mentioned entities across all context. WARNING: This tool can return large responses - use sparingly and only when entity information is specifically needed.",
@@ -291,7 +313,7 @@ const TOOLS = [
291
313
  },
292
314
  {
293
315
  name: "add_task",
294
- description: "Create one or more tasks in your space with status tracking and priority levels. Accepts a single task object or an array of task objects for batch creation. Tasks have graph relationships like memories (entities, topics, temporal). REQUIRES space_id parameter.",
316
+ description: "Create one or more tasks in your space with status tracking and priority levels. Supports BATCH creation and NESTED subtasks. Accepts a single task object or an array of task objects. Tasks have graph relationships like memories (entities, topics, temporal). REQUIRES space_id parameter. Example with subtasks: {tasks: {title: 'Parent', content: 'Main task', subtasks: [{title: 'Subtask 1', content: 'Child task'}]}}",
295
317
  inputSchema: {
296
318
  type: "object",
297
319
  properties: {
@@ -331,7 +353,42 @@ const TOOLS = [
331
353
  },
332
354
  parent_id: {
333
355
  type: "string",
334
- description: "Optional parent task ID to create this as a subtask",
356
+ description: "Optional parent task ID to create this as a subtask. Use an existing task's ID (format: task_TIMESTAMP_ID) to nest this task under it. Use list_tasks to find parent task IDs. If omitted, creates a top-level task. NOTE: Use 'subtasks' array instead for creating parent+children in one call.",
357
+ },
358
+ subtasks: {
359
+ type: "array",
360
+ items: {
361
+ type: "object",
362
+ properties: {
363
+ title: {
364
+ type: "string",
365
+ description: "Subtask title",
366
+ },
367
+ content: {
368
+ type: "string",
369
+ description: "Subtask description/details",
370
+ },
371
+ topics: {
372
+ type: "array",
373
+ items: { type: "string" },
374
+ description: "Topics/tags for this subtask",
375
+ },
376
+ status: {
377
+ type: "string",
378
+ enum: ["pending", "in_progress", "completed", "invalidated"],
379
+ description: "Subtask status (default: pending)",
380
+ default: "pending",
381
+ },
382
+ priority: {
383
+ type: "string",
384
+ enum: ["urgent", "high", "medium", "low"],
385
+ description: "Subtask priority level (default: medium)",
386
+ default: "medium",
387
+ },
388
+ },
389
+ required: ["title", "content"],
390
+ },
391
+ description: "Optional array of subtasks to create under this parent task. Each will be automatically linked to the parent.",
335
392
  },
336
393
  },
337
394
  required: ["title", "content"],
@@ -368,7 +425,42 @@ const TOOLS = [
368
425
  },
369
426
  parent_id: {
370
427
  type: "string",
371
- description: "Optional parent task ID to create this as a subtask",
428
+ description: "Optional parent task ID to create this as a subtask. Use an existing task's ID (format: task_TIMESTAMP_ID) to nest this task under it. Use list_tasks to find parent task IDs. If omitted, creates a top-level task. NOTE: Use 'subtasks' array instead for creating parent+children in one call.",
429
+ },
430
+ subtasks: {
431
+ type: "array",
432
+ items: {
433
+ type: "object",
434
+ properties: {
435
+ title: {
436
+ type: "string",
437
+ description: "Subtask title",
438
+ },
439
+ content: {
440
+ type: "string",
441
+ description: "Subtask description/details",
442
+ },
443
+ topics: {
444
+ type: "array",
445
+ items: { type: "string" },
446
+ description: "Topics/tags for this subtask",
447
+ },
448
+ status: {
449
+ type: "string",
450
+ enum: ["pending", "in_progress", "completed", "invalidated"],
451
+ description: "Subtask status (default: pending)",
452
+ default: "pending",
453
+ },
454
+ priority: {
455
+ type: "string",
456
+ enum: ["urgent", "high", "medium", "low"],
457
+ description: "Subtask priority level (default: medium)",
458
+ default: "medium",
459
+ },
460
+ },
461
+ required: ["title", "content"],
462
+ },
463
+ description: "Optional array of subtasks to create under this parent task. Each will be automatically linked to the parent.",
372
464
  },
373
465
  },
374
466
  required: ["title", "content"],
@@ -561,6 +653,10 @@ async function handleGetRecentMemories(args) {
561
653
  limit,
562
654
  });
563
655
  }
656
+ async function handleFetch(args) {
657
+ const { id, ids } = args;
658
+ return makeApiCall("fetch", { id, ids });
659
+ }
564
660
  async function handleGetEntities(args) {
565
661
  const { memory_id } = args;
566
662
  return makeApiCall("get-entities", { memory_id });
@@ -629,6 +725,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
629
725
  case "get_recent_memories":
630
726
  result = await handleGetRecentMemories(args);
631
727
  break;
728
+ case "fetch":
729
+ result = await handleFetch(args);
730
+ break;
632
731
  case "get_entities":
633
732
  result = await handleGetEntities(args);
634
733
  break;
package/index.ts CHANGED
@@ -14,6 +14,9 @@ import {
14
14
  ListToolsRequestSchema,
15
15
  McpError,
16
16
  } from "@modelcontextprotocol/sdk/types.js";
17
+ import { readFileSync } from 'fs';
18
+ import { fileURLToPath } from 'url';
19
+ import { dirname, join } from 'path';
17
20
 
18
21
  // Load environment variables from .env and .env.local
19
22
  config({ quiet: true });
@@ -33,9 +36,10 @@ if (!MCP_API_KEY) {
33
36
 
34
37
  console.log("Intangle MCP Server starting - connecting to", API_BASE_URL);
35
38
 
36
- // Version checking
37
- // IMPORTANT: Update BOTH package.json version AND this constant when bumping version
38
- const CURRENT_VERSION = "1.0.10";
39
+ // Version checking - automatically read from package.json
40
+ const __dirname = dirname(fileURLToPath(import.meta.url));
41
+ const packageJson = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf-8'));
42
+ const CURRENT_VERSION = packageJson.version;
39
43
  let latestVersion: string | null = null;
40
44
  let versionCheckDone = false;
41
45
 
@@ -217,6 +221,25 @@ const TOOLS = [
217
221
  required: ["space_id"],
218
222
  },
219
223
  },
224
+ {
225
+ name: "fetch",
226
+ description:
227
+ "Fetch complete items (context or tasks) by ID. Accepts single ID or array of IDs. Returns BOTH context (Memory nodes) and tasks (Task nodes) with full content, topics, and metadata. Always returns full content (never summaries). Use this after getting summaries from search/list/start to retrieve full details for specific items.",
228
+ inputSchema: {
229
+ type: "object",
230
+ properties: {
231
+ id: {
232
+ type: "string",
233
+ description: "Single ID to fetch (context or task ID like 'mem_123' or 'task_456')",
234
+ },
235
+ ids: {
236
+ type: "array",
237
+ items: { type: "string" },
238
+ description: "Array of IDs to fetch (mix of context and task IDs). Use this to fetch multiple items in one call.",
239
+ },
240
+ },
241
+ },
242
+ },
220
243
  {
221
244
  name: "get_entities",
222
245
  description:
@@ -328,7 +351,7 @@ const TOOLS = [
328
351
  {
329
352
  name: "add_task",
330
353
  description:
331
- "Create one or more tasks in your space with status tracking and priority levels. Accepts a single task object or an array of task objects for batch creation. Tasks have graph relationships like memories (entities, topics, temporal). REQUIRES space_id parameter.",
354
+ "Create one or more tasks in your space with status tracking and priority levels. Supports BATCH creation and NESTED subtasks. Accepts a single task object or an array of task objects. Tasks have graph relationships like memories (entities, topics, temporal). REQUIRES space_id parameter. Example with subtasks: {tasks: {title: 'Parent', content: 'Main task', subtasks: [{title: 'Subtask 1', content: 'Child task'}]}}",
332
355
  inputSchema: {
333
356
  type: "object",
334
357
  properties: {
@@ -370,7 +393,42 @@ const TOOLS = [
370
393
  },
371
394
  parent_id: {
372
395
  type: "string",
373
- description: "Optional parent task ID to create this as a subtask",
396
+ description: "Optional parent task ID to create this as a subtask. Use an existing task's ID (format: task_TIMESTAMP_ID) to nest this task under it. Use list_tasks to find parent task IDs. If omitted, creates a top-level task. NOTE: Use 'subtasks' array instead for creating parent+children in one call.",
397
+ },
398
+ subtasks: {
399
+ type: "array",
400
+ items: {
401
+ type: "object",
402
+ properties: {
403
+ title: {
404
+ type: "string",
405
+ description: "Subtask title",
406
+ },
407
+ content: {
408
+ type: "string",
409
+ description: "Subtask description/details",
410
+ },
411
+ topics: {
412
+ type: "array",
413
+ items: { type: "string" },
414
+ description: "Topics/tags for this subtask",
415
+ },
416
+ status: {
417
+ type: "string",
418
+ enum: ["pending", "in_progress", "completed", "invalidated"],
419
+ description: "Subtask status (default: pending)",
420
+ default: "pending",
421
+ },
422
+ priority: {
423
+ type: "string",
424
+ enum: ["urgent", "high", "medium", "low"],
425
+ description: "Subtask priority level (default: medium)",
426
+ default: "medium",
427
+ },
428
+ },
429
+ required: ["title", "content"],
430
+ },
431
+ description: "Optional array of subtasks to create under this parent task. Each will be automatically linked to the parent.",
374
432
  },
375
433
  },
376
434
  required: ["title", "content"],
@@ -408,7 +466,42 @@ const TOOLS = [
408
466
  },
409
467
  parent_id: {
410
468
  type: "string",
411
- description: "Optional parent task ID to create this as a subtask",
469
+ description: "Optional parent task ID to create this as a subtask. Use an existing task's ID (format: task_TIMESTAMP_ID) to nest this task under it. Use list_tasks to find parent task IDs. If omitted, creates a top-level task. NOTE: Use 'subtasks' array instead for creating parent+children in one call.",
470
+ },
471
+ subtasks: {
472
+ type: "array",
473
+ items: {
474
+ type: "object",
475
+ properties: {
476
+ title: {
477
+ type: "string",
478
+ description: "Subtask title",
479
+ },
480
+ content: {
481
+ type: "string",
482
+ description: "Subtask description/details",
483
+ },
484
+ topics: {
485
+ type: "array",
486
+ items: { type: "string" },
487
+ description: "Topics/tags for this subtask",
488
+ },
489
+ status: {
490
+ type: "string",
491
+ enum: ["pending", "in_progress", "completed", "invalidated"],
492
+ description: "Subtask status (default: pending)",
493
+ default: "pending",
494
+ },
495
+ priority: {
496
+ type: "string",
497
+ enum: ["urgent", "high", "medium", "low"],
498
+ description: "Subtask priority level (default: medium)",
499
+ default: "medium",
500
+ },
501
+ },
502
+ required: ["title", "content"],
503
+ },
504
+ description: "Optional array of subtasks to create under this parent task. Each will be automatically linked to the parent.",
412
505
  },
413
506
  },
414
507
  required: ["title", "content"],
@@ -636,6 +729,12 @@ async function handleGetRecentMemories(args: any) {
636
729
  });
637
730
  }
638
731
 
732
+ async function handleFetch(args: any) {
733
+ const { id, ids } = args as { id?: string; ids?: string[] };
734
+
735
+ return makeApiCall("fetch", { id, ids });
736
+ }
737
+
639
738
  async function handleGetEntities(args: any) {
640
739
  const { memory_id } = args as { memory_id?: string };
641
740
 
@@ -729,6 +828,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request: any) => {
729
828
  case "get_recent_memories":
730
829
  result = await handleGetRecentMemories(args);
731
830
  break;
831
+ case "fetch":
832
+ result = await handleFetch(args);
833
+ break;
732
834
  case "get_entities":
733
835
  result = await handleGetEntities(args);
734
836
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intangle/mcp-server",
3
- "version": "1.0.10",
3
+ "version": "1.1.1",
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",