@intangle/mcp-server 1.2.1 → 1.2.3
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 +13 -350
- package/dist/tool-definitions.js +282 -0
- package/index.ts +13 -370
- package/package.json +1 -1
- package/tool-definitions.ts +296 -0
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError, } f
|
|
|
10
10
|
import { readFileSync } from "fs";
|
|
11
11
|
import { fileURLToPath } from "url";
|
|
12
12
|
import { dirname, join } from "path";
|
|
13
|
+
import { TOOLS } from "./tool-definitions.js";
|
|
13
14
|
// Load environment variables from .env and .env.local
|
|
14
15
|
config({ quiet: true });
|
|
15
16
|
config({ path: ".env.local", quiet: true });
|
|
@@ -77,344 +78,6 @@ const server = new Server({
|
|
|
77
78
|
tools: {},
|
|
78
79
|
},
|
|
79
80
|
});
|
|
80
|
-
const TOOLS = [
|
|
81
|
-
{
|
|
82
|
-
name: "search_memories",
|
|
83
|
-
description: "Search through ALL stored data including BOTH context (general information) AND tasks (actionable workflow items). Uses intelligent routing with query classification. Supports depth control for speed vs thoroughness tradeoff. ALWAYS provide space_id parameter - this is mandatory for all searches.",
|
|
84
|
-
inputSchema: {
|
|
85
|
-
type: "object",
|
|
86
|
-
properties: {
|
|
87
|
-
space_id: {
|
|
88
|
-
type: "string",
|
|
89
|
-
description: "REQUIRED: Space to search in (use list_spaces to see available options)",
|
|
90
|
-
},
|
|
91
|
-
query: {
|
|
92
|
-
type: "string",
|
|
93
|
-
description: "Search query for finding relevant memories",
|
|
94
|
-
},
|
|
95
|
-
topics: {
|
|
96
|
-
type: "array",
|
|
97
|
-
items: { type: "string" },
|
|
98
|
-
description: "Filter by specific topics",
|
|
99
|
-
},
|
|
100
|
-
max_results: {
|
|
101
|
-
type: "number",
|
|
102
|
-
description: "Maximum number of results to return",
|
|
103
|
-
default: 10,
|
|
104
|
-
},
|
|
105
|
-
depth: {
|
|
106
|
-
type: "string",
|
|
107
|
-
enum: ["quick", "balanced", "deep"],
|
|
108
|
-
description: "Search depth: 'quick' = fast list retrieval, 'balanced' = smart routing with AI (default), 'deep' = full hybrid search with attention agent",
|
|
109
|
-
default: "balanced",
|
|
110
|
-
},
|
|
111
|
-
return_format: {
|
|
112
|
-
type: "string",
|
|
113
|
-
enum: ["full", "summary", "ids_only"],
|
|
114
|
-
description: "Result format: 'full' = complete content (default), 'summary' = truncated content, 'ids_only' = just IDs for subsequent fetch",
|
|
115
|
-
default: "full",
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
required: ["query"],
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
name: "get_recent_memories",
|
|
123
|
-
description: "Get the most recent CONTEXT items (general information). For recent tasks, use list_tasks instead. NOTE: This tool is called 'get_recent_memories' (not 'fetch'). Returns fully decrypted data. REQUIRES space_id parameter.",
|
|
124
|
-
inputSchema: {
|
|
125
|
-
type: "object",
|
|
126
|
-
properties: {
|
|
127
|
-
space_id: {
|
|
128
|
-
type: "string",
|
|
129
|
-
description: "REQUIRED: Space to get memories from (use list_spaces to see available options)",
|
|
130
|
-
},
|
|
131
|
-
topics: {
|
|
132
|
-
type: "array",
|
|
133
|
-
items: { type: "string" },
|
|
134
|
-
description: "Filter by specific topics",
|
|
135
|
-
},
|
|
136
|
-
limit: {
|
|
137
|
-
type: "number",
|
|
138
|
-
description: "Number of recent memories to retrieve",
|
|
139
|
-
default: 20,
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
required: ["space_id"],
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
name: "fetch",
|
|
147
|
-
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.",
|
|
148
|
-
inputSchema: {
|
|
149
|
-
type: "object",
|
|
150
|
-
properties: {
|
|
151
|
-
id: {
|
|
152
|
-
type: "string",
|
|
153
|
-
description: "Single ID to fetch (context or task ID like 'mem_123' or 'task_456')",
|
|
154
|
-
},
|
|
155
|
-
ids: {
|
|
156
|
-
type: "array",
|
|
157
|
-
items: { type: "string" },
|
|
158
|
-
description: "Array of IDs to fetch (mix of context and task IDs). Use this to fetch multiple items in one call.",
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
name: "list_spaces",
|
|
165
|
-
description: "Get all available spaces with their descriptions and item counts (both context and tasks). Spaces are top-level containers that isolate different contexts (e.g., personal, work, projects).",
|
|
166
|
-
inputSchema: {
|
|
167
|
-
type: "object",
|
|
168
|
-
properties: {},
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
name: "create_space",
|
|
173
|
-
description: "Create a new space with optional configuration. Spaces are top-level containers that hold both context (general information) and tasks (actionable items). The 'start' tool loads this configuration when beginning work in this space. Checks user's plan limits and returns upgrade link if limit reached.",
|
|
174
|
-
inputSchema: {
|
|
175
|
-
type: "object",
|
|
176
|
-
properties: {
|
|
177
|
-
name: {
|
|
178
|
-
type: "string",
|
|
179
|
-
description: "Name for the space (e.g., 'Work', 'Personal', 'Project X')",
|
|
180
|
-
},
|
|
181
|
-
description: {
|
|
182
|
-
type: "string",
|
|
183
|
-
description: "Brief description of what this space is for (e.g., 'Work-related context and tasks')",
|
|
184
|
-
},
|
|
185
|
-
config_badges: {
|
|
186
|
-
type: "array",
|
|
187
|
-
items: { type: "string" },
|
|
188
|
-
description: "Array of keywords for memory focus in this space. These keywords help steer what context gets loaded when running 'start' for this space. Examples: ['TypeScript', 'React', 'API design', 'authentication']. They act as search terms to prioritize relevant memories.",
|
|
189
|
-
},
|
|
190
|
-
startup_preferences: {
|
|
191
|
-
type: "string",
|
|
192
|
-
description: "AI behavior preferences for this space. Guides how AI assistants and agents should communicate and behave (e.g., 'be concise and frank', 'think critically', 'play devils advocate'). This appears in the start briefing under 'Assistant Preferences'.",
|
|
193
|
-
},
|
|
194
|
-
include_tasks: {
|
|
195
|
-
type: "boolean",
|
|
196
|
-
description: "Whether to automatically retrieve pending/in-progress tasks when running the 'start' tool for this space",
|
|
197
|
-
default: false,
|
|
198
|
-
},
|
|
199
|
-
},
|
|
200
|
-
required: ["name"],
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
name: "get_space_info",
|
|
205
|
-
description: "Get detailed information about a specific space",
|
|
206
|
-
inputSchema: {
|
|
207
|
-
type: "object",
|
|
208
|
-
properties: {
|
|
209
|
-
space_id: {
|
|
210
|
-
type: "string",
|
|
211
|
-
description: "ID of space to get info for",
|
|
212
|
-
},
|
|
213
|
-
},
|
|
214
|
-
required: ["space_id"],
|
|
215
|
-
},
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
name: "start",
|
|
219
|
-
description: "Start working in a space and get comprehensive initialization. Returns static context, auto-searched context (general information), preferences, and optionally pending tasks. This tool retrieves BOTH context AND tasks based on space configuration. Call this when starting a conversation in a space to get relevant information.",
|
|
220
|
-
inputSchema: {
|
|
221
|
-
type: "object",
|
|
222
|
-
properties: {
|
|
223
|
-
space_id: {
|
|
224
|
-
type: "string",
|
|
225
|
-
description: "Space to start (e.g., 'renvoi', 'personal')",
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
required: ["space_id"],
|
|
229
|
-
},
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
name: "update_memory",
|
|
233
|
-
description: "Unified tool for ALL memory operations: add, update, or delete context and tasks. Supports any combination of operations in a single call. Context = general information/knowledge (Memory nodes). Tasks = actionable workflow items (Task nodes). Max 50 operations per call. At least one operation (add/update/delete) required.",
|
|
234
|
-
inputSchema: {
|
|
235
|
-
type: "object",
|
|
236
|
-
properties: {
|
|
237
|
-
space_id: {
|
|
238
|
-
type: "string",
|
|
239
|
-
description: "REQUIRED: Space to operate in (use list_spaces to see available options)",
|
|
240
|
-
},
|
|
241
|
-
add: {
|
|
242
|
-
type: "object",
|
|
243
|
-
description: "Add new context and/or tasks to memory",
|
|
244
|
-
properties: {
|
|
245
|
-
context: {
|
|
246
|
-
type: "array",
|
|
247
|
-
items: {
|
|
248
|
-
type: "object",
|
|
249
|
-
properties: {
|
|
250
|
-
title: { type: "string", description: "Context title" },
|
|
251
|
-
content: {
|
|
252
|
-
type: "string",
|
|
253
|
-
description: "Context content (general information)",
|
|
254
|
-
},
|
|
255
|
-
topics: {
|
|
256
|
-
type: "array",
|
|
257
|
-
items: { type: "string" },
|
|
258
|
-
description: "Optional topics/tags",
|
|
259
|
-
},
|
|
260
|
-
},
|
|
261
|
-
required: ["title", "content"],
|
|
262
|
-
},
|
|
263
|
-
description: "Array of context items to add",
|
|
264
|
-
},
|
|
265
|
-
tasks: {
|
|
266
|
-
type: "array",
|
|
267
|
-
items: {
|
|
268
|
-
type: "object",
|
|
269
|
-
properties: {
|
|
270
|
-
title: { type: "string", description: "Task title" },
|
|
271
|
-
content: { type: "string", description: "Task description" },
|
|
272
|
-
topics: {
|
|
273
|
-
type: "array",
|
|
274
|
-
items: { type: "string" },
|
|
275
|
-
description: "Optional topics/tags",
|
|
276
|
-
},
|
|
277
|
-
status: {
|
|
278
|
-
type: "string",
|
|
279
|
-
enum: [
|
|
280
|
-
"pending",
|
|
281
|
-
"in_progress",
|
|
282
|
-
"completed",
|
|
283
|
-
"invalidated",
|
|
284
|
-
],
|
|
285
|
-
description: "Task status (default: pending)",
|
|
286
|
-
},
|
|
287
|
-
priority: {
|
|
288
|
-
type: "string",
|
|
289
|
-
enum: ["urgent", "high", "medium", "low"],
|
|
290
|
-
description: "Priority level (default: medium)",
|
|
291
|
-
},
|
|
292
|
-
},
|
|
293
|
-
required: ["title", "content"],
|
|
294
|
-
},
|
|
295
|
-
description: "Array of tasks to add",
|
|
296
|
-
},
|
|
297
|
-
},
|
|
298
|
-
},
|
|
299
|
-
update: {
|
|
300
|
-
type: "object",
|
|
301
|
-
description: "Update existing context and/or tasks",
|
|
302
|
-
properties: {
|
|
303
|
-
context: {
|
|
304
|
-
type: "array",
|
|
305
|
-
items: {
|
|
306
|
-
type: "object",
|
|
307
|
-
properties: {
|
|
308
|
-
id: { type: "string", description: "Context ID to update" },
|
|
309
|
-
title: {
|
|
310
|
-
type: "string",
|
|
311
|
-
description: "New title (optional)",
|
|
312
|
-
},
|
|
313
|
-
content: {
|
|
314
|
-
type: "string",
|
|
315
|
-
description: "New content (optional)",
|
|
316
|
-
},
|
|
317
|
-
topics: {
|
|
318
|
-
type: "array",
|
|
319
|
-
items: { type: "string" },
|
|
320
|
-
description: "New topics (optional)",
|
|
321
|
-
},
|
|
322
|
-
},
|
|
323
|
-
required: ["id"],
|
|
324
|
-
},
|
|
325
|
-
description: "Array of context updates (must include id)",
|
|
326
|
-
},
|
|
327
|
-
tasks: {
|
|
328
|
-
type: "array",
|
|
329
|
-
items: {
|
|
330
|
-
type: "object",
|
|
331
|
-
properties: {
|
|
332
|
-
task_id: { type: "string", description: "Task ID to update" },
|
|
333
|
-
title: {
|
|
334
|
-
type: "string",
|
|
335
|
-
description: "New title (optional)",
|
|
336
|
-
},
|
|
337
|
-
content: {
|
|
338
|
-
type: "string",
|
|
339
|
-
description: "New content (optional)",
|
|
340
|
-
},
|
|
341
|
-
topics: {
|
|
342
|
-
type: "array",
|
|
343
|
-
items: { type: "string" },
|
|
344
|
-
description: "New topics (optional)",
|
|
345
|
-
},
|
|
346
|
-
status: {
|
|
347
|
-
type: "string",
|
|
348
|
-
enum: [
|
|
349
|
-
"pending",
|
|
350
|
-
"in_progress",
|
|
351
|
-
"completed",
|
|
352
|
-
"invalidated",
|
|
353
|
-
],
|
|
354
|
-
description: "New status (optional)",
|
|
355
|
-
},
|
|
356
|
-
priority: {
|
|
357
|
-
type: "string",
|
|
358
|
-
enum: ["urgent", "high", "medium", "low"],
|
|
359
|
-
description: "New priority (optional)",
|
|
360
|
-
},
|
|
361
|
-
},
|
|
362
|
-
required: ["task_id"],
|
|
363
|
-
},
|
|
364
|
-
description: "Array of task updates (must include task_id)",
|
|
365
|
-
},
|
|
366
|
-
},
|
|
367
|
-
},
|
|
368
|
-
delete: {
|
|
369
|
-
type: "object",
|
|
370
|
-
description: "Delete context and/or tasks by ID",
|
|
371
|
-
properties: {
|
|
372
|
-
context_ids: {
|
|
373
|
-
type: "array",
|
|
374
|
-
items: { type: "string" },
|
|
375
|
-
description: "Array of context IDs to delete",
|
|
376
|
-
},
|
|
377
|
-
task_ids: {
|
|
378
|
-
type: "array",
|
|
379
|
-
items: { type: "string" },
|
|
380
|
-
description: "Array of task IDs to delete",
|
|
381
|
-
},
|
|
382
|
-
},
|
|
383
|
-
},
|
|
384
|
-
},
|
|
385
|
-
required: ["space_id"],
|
|
386
|
-
},
|
|
387
|
-
},
|
|
388
|
-
{
|
|
389
|
-
name: "list_tasks",
|
|
390
|
-
description: "List tasks in a space with optional filtering",
|
|
391
|
-
inputSchema: {
|
|
392
|
-
type: "object",
|
|
393
|
-
properties: {
|
|
394
|
-
space_id: {
|
|
395
|
-
type: "string",
|
|
396
|
-
description: "Space to list tasks from",
|
|
397
|
-
},
|
|
398
|
-
status: {
|
|
399
|
-
type: "string",
|
|
400
|
-
enum: ["pending", "in_progress", "completed", "invalidated"],
|
|
401
|
-
description: "Optional: Filter by status",
|
|
402
|
-
},
|
|
403
|
-
topics: {
|
|
404
|
-
type: "array",
|
|
405
|
-
items: { type: "string" },
|
|
406
|
-
description: "Optional: Filter by topics",
|
|
407
|
-
},
|
|
408
|
-
limit: {
|
|
409
|
-
type: "number",
|
|
410
|
-
description: "Maximum number of tasks to return",
|
|
411
|
-
default: 50,
|
|
412
|
-
},
|
|
413
|
-
},
|
|
414
|
-
required: ["space_id"],
|
|
415
|
-
},
|
|
416
|
-
},
|
|
417
|
-
];
|
|
418
81
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
419
82
|
tools: TOOLS,
|
|
420
83
|
}));
|
|
@@ -450,23 +113,23 @@ async function handleFetch(args) {
|
|
|
450
113
|
const { id, ids } = args;
|
|
451
114
|
return makeApiCall("fetch", { id, ids });
|
|
452
115
|
}
|
|
453
|
-
async function
|
|
116
|
+
async function handleViewSpaces() {
|
|
454
117
|
return makeApiCall("list-spaces", {});
|
|
455
118
|
}
|
|
456
119
|
async function handleCreateSpace(args) {
|
|
457
120
|
return makeApiCall("create-space", args);
|
|
458
121
|
}
|
|
459
|
-
async function
|
|
122
|
+
async function handleViewSpace(args) {
|
|
460
123
|
const { space_id } = args;
|
|
461
|
-
return makeApiCall("
|
|
124
|
+
return makeApiCall("view-space", { space_id });
|
|
462
125
|
}
|
|
463
126
|
async function handleStart(args) {
|
|
464
127
|
const { space_id } = args;
|
|
465
128
|
return makeApiCall("start", { space_id });
|
|
466
129
|
}
|
|
467
|
-
async function
|
|
130
|
+
async function handleUpdateSpace(args) {
|
|
468
131
|
if (!args.space_id) {
|
|
469
|
-
throw new Error("space_id is required. Use
|
|
132
|
+
throw new Error("space_id is required. Use view_spaces to see available options.");
|
|
470
133
|
}
|
|
471
134
|
if (!args.add && !args.update && !args.delete) {
|
|
472
135
|
throw new Error("At least one operation (add, update, delete) must be provided");
|
|
@@ -487,7 +150,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
487
150
|
try {
|
|
488
151
|
let result;
|
|
489
152
|
switch (name) {
|
|
490
|
-
case "
|
|
153
|
+
case "search":
|
|
491
154
|
result = await handleSearchMemories(args);
|
|
492
155
|
break;
|
|
493
156
|
case "get_recent_memories":
|
|
@@ -496,20 +159,20 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
496
159
|
case "fetch":
|
|
497
160
|
result = await handleFetch(args);
|
|
498
161
|
break;
|
|
499
|
-
case "
|
|
500
|
-
result = await
|
|
162
|
+
case "view_spaces":
|
|
163
|
+
result = await handleViewSpaces();
|
|
501
164
|
break;
|
|
502
165
|
case "create_space":
|
|
503
166
|
result = await handleCreateSpace(args);
|
|
504
167
|
break;
|
|
505
|
-
case "
|
|
506
|
-
result = await
|
|
168
|
+
case "view_space":
|
|
169
|
+
result = await handleViewSpace(args);
|
|
507
170
|
break;
|
|
508
171
|
case "start":
|
|
509
172
|
result = await handleStart(args);
|
|
510
173
|
break;
|
|
511
|
-
case "
|
|
512
|
-
result = await
|
|
174
|
+
case "update_space":
|
|
175
|
+
result = await handleUpdateSpace(args);
|
|
513
176
|
break;
|
|
514
177
|
case "list_tasks":
|
|
515
178
|
result = await handleListTasks(args);
|