mindgraph-mcp 0.3.1 → 0.3.2
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/cli.js +3 -85
- package/dist/index.js +3 -85
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -41,8 +41,6 @@ function err(message) {
|
|
|
41
41
|
async function handleTool(client2, name, args) {
|
|
42
42
|
try {
|
|
43
43
|
switch (name) {
|
|
44
|
-
case "mindgraph_session":
|
|
45
|
-
return await handleSession(client2, args);
|
|
46
44
|
case "mindgraph_journal":
|
|
47
45
|
return await handleJournal(client2, args);
|
|
48
46
|
case "mindgraph_capture":
|
|
@@ -71,55 +69,15 @@ async function handleTool(client2, name, args) {
|
|
|
71
69
|
return err(message);
|
|
72
70
|
}
|
|
73
71
|
}
|
|
74
|
-
async function handleSession(client2, args) {
|
|
75
|
-
const { action, label, session_uid, summary, props, agent_id } = args;
|
|
76
|
-
switch (action) {
|
|
77
|
-
case "open": {
|
|
78
|
-
if (!label) return err("label is required for open");
|
|
79
|
-
const result = await client2.session({
|
|
80
|
-
action: "open",
|
|
81
|
-
label,
|
|
82
|
-
summary,
|
|
83
|
-
props,
|
|
84
|
-
agent_id
|
|
85
|
-
});
|
|
86
|
-
return ok(result);
|
|
87
|
-
}
|
|
88
|
-
case "trace": {
|
|
89
|
-
if (!session_uid) return err("session_uid is required for trace");
|
|
90
|
-
if (!label) return err("label is required for trace");
|
|
91
|
-
const result = await client2.session({
|
|
92
|
-
action: "trace",
|
|
93
|
-
label,
|
|
94
|
-
session_uid,
|
|
95
|
-
props,
|
|
96
|
-
agent_id
|
|
97
|
-
});
|
|
98
|
-
return ok(result);
|
|
99
|
-
}
|
|
100
|
-
case "close": {
|
|
101
|
-
if (!session_uid) return err("session_uid is required for close");
|
|
102
|
-
const result = await client2.session({
|
|
103
|
-
action: "close",
|
|
104
|
-
session_uid,
|
|
105
|
-
summary,
|
|
106
|
-
agent_id
|
|
107
|
-
});
|
|
108
|
-
return ok(result);
|
|
109
|
-
}
|
|
110
|
-
default:
|
|
111
|
-
return err(`Unknown session action: ${action}`);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
72
|
async function handleJournal(client2, args) {
|
|
115
|
-
const { label, content, mood, tags,
|
|
73
|
+
const { label, content, mood, tags, agent_id } = args;
|
|
116
74
|
const props = { content };
|
|
117
75
|
if (mood) props.mood = mood;
|
|
118
76
|
if (tags) props.tags = tags;
|
|
119
77
|
const result = await client2.journal(
|
|
120
78
|
label,
|
|
121
79
|
props,
|
|
122
|
-
{
|
|
80
|
+
{ agent_id }
|
|
123
81
|
);
|
|
124
82
|
return ok(result);
|
|
125
83
|
}
|
|
@@ -535,41 +493,6 @@ var init_tools = __esm({
|
|
|
535
493
|
"src/tools.ts"() {
|
|
536
494
|
"use strict";
|
|
537
495
|
TOOLS = [
|
|
538
|
-
{
|
|
539
|
-
name: "mindgraph_session",
|
|
540
|
-
description: "Manage conversation sessions. Only open a session for long, substantive conversations \u2014 never as a first action. Use 'trace' to bookmark key moments (decisions, important facts). Close with a summary to trigger knowledge distillation. Sessions track conversation continuity but are optional for short interactions.",
|
|
541
|
-
inputSchema: {
|
|
542
|
-
type: "object",
|
|
543
|
-
properties: {
|
|
544
|
-
action: {
|
|
545
|
-
type: "string",
|
|
546
|
-
enum: ["open", "trace", "close"],
|
|
547
|
-
description: "Session lifecycle action"
|
|
548
|
-
},
|
|
549
|
-
label: {
|
|
550
|
-
type: "string",
|
|
551
|
-
description: "Session or trace label (required for open/trace)"
|
|
552
|
-
},
|
|
553
|
-
session_uid: {
|
|
554
|
-
type: "string",
|
|
555
|
-
description: "Session UID (required for trace/close)"
|
|
556
|
-
},
|
|
557
|
-
summary: {
|
|
558
|
-
type: "string",
|
|
559
|
-
description: "Session summary (used on close)"
|
|
560
|
-
},
|
|
561
|
-
props: {
|
|
562
|
-
type: "object",
|
|
563
|
-
description: "Additional properties"
|
|
564
|
-
},
|
|
565
|
-
agent_id: {
|
|
566
|
-
type: "string",
|
|
567
|
-
description: "Agent identity for multi-agent systems"
|
|
568
|
-
}
|
|
569
|
-
},
|
|
570
|
-
required: ["action"]
|
|
571
|
-
}
|
|
572
|
-
},
|
|
573
496
|
{
|
|
574
497
|
name: "mindgraph_journal",
|
|
575
498
|
description: "Quick, informal capture for the user's inner world: preferences ('I prefer dark mode'), reflections ('I've been thinking about...'), moods, daily notes, and anything subjective. Use this instead of mindgraph_capture when the content is personal/informal rather than a structured fact about the external world. Good for: likes/dislikes, feelings, habits, reminders-to-self, freeform notes.",
|
|
@@ -593,10 +516,6 @@ var init_tools = __esm({
|
|
|
593
516
|
items: { type: "string" },
|
|
594
517
|
description: "Categorization tags"
|
|
595
518
|
},
|
|
596
|
-
session_uid: {
|
|
597
|
-
type: "string",
|
|
598
|
-
description: "Link to an active session"
|
|
599
|
-
},
|
|
600
519
|
agent_id: {
|
|
601
520
|
type: "string",
|
|
602
521
|
description: "Agent identity"
|
|
@@ -1095,7 +1014,7 @@ async function main() {
|
|
|
1095
1014
|
const transport = new import_stdio.StdioServerTransport();
|
|
1096
1015
|
await server.connect(transport);
|
|
1097
1016
|
console.error(
|
|
1098
|
-
`MindGraph MCP server v0.3.
|
|
1017
|
+
`MindGraph MCP server v0.3.2 running on stdio (${BASE_URL})`
|
|
1099
1018
|
);
|
|
1100
1019
|
}
|
|
1101
1020
|
var import_server, import_stdio, import_types, import_mindgraph, API_KEY, BASE_URL, AGENT_ID, client, INSTRUCTIONS, server, PROMPTS;
|
|
@@ -1126,7 +1045,6 @@ var init_src = __esm({
|
|
|
1126
1045
|
|
|
1127
1046
|
- **Jump straight to the user's topic.** Do NOT pre-fetch goals, open questions, or other convenience queries unless the user specifically asks about them.
|
|
1128
1047
|
- **Parallelize tool calls.** When you need to search and capture at the same time, issue all calls in a single parallel batch \u2014 never serialize independent calls.
|
|
1129
|
-
- **Sessions are optional.** Only open a session if the conversation is long and substantive. Never open a session as a first action \u2014 answer the user's question first, then open a session in the background if warranted.
|
|
1130
1048
|
|
|
1131
1049
|
## When to READ from the graph
|
|
1132
1050
|
|
package/dist/index.js
CHANGED
|
@@ -8,41 +8,6 @@ var import_mindgraph = require("mindgraph");
|
|
|
8
8
|
|
|
9
9
|
// src/tools.ts
|
|
10
10
|
var TOOLS = [
|
|
11
|
-
{
|
|
12
|
-
name: "mindgraph_session",
|
|
13
|
-
description: "Manage conversation sessions. Only open a session for long, substantive conversations \u2014 never as a first action. Use 'trace' to bookmark key moments (decisions, important facts). Close with a summary to trigger knowledge distillation. Sessions track conversation continuity but are optional for short interactions.",
|
|
14
|
-
inputSchema: {
|
|
15
|
-
type: "object",
|
|
16
|
-
properties: {
|
|
17
|
-
action: {
|
|
18
|
-
type: "string",
|
|
19
|
-
enum: ["open", "trace", "close"],
|
|
20
|
-
description: "Session lifecycle action"
|
|
21
|
-
},
|
|
22
|
-
label: {
|
|
23
|
-
type: "string",
|
|
24
|
-
description: "Session or trace label (required for open/trace)"
|
|
25
|
-
},
|
|
26
|
-
session_uid: {
|
|
27
|
-
type: "string",
|
|
28
|
-
description: "Session UID (required for trace/close)"
|
|
29
|
-
},
|
|
30
|
-
summary: {
|
|
31
|
-
type: "string",
|
|
32
|
-
description: "Session summary (used on close)"
|
|
33
|
-
},
|
|
34
|
-
props: {
|
|
35
|
-
type: "object",
|
|
36
|
-
description: "Additional properties"
|
|
37
|
-
},
|
|
38
|
-
agent_id: {
|
|
39
|
-
type: "string",
|
|
40
|
-
description: "Agent identity for multi-agent systems"
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
required: ["action"]
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
11
|
{
|
|
47
12
|
name: "mindgraph_journal",
|
|
48
13
|
description: "Quick, informal capture for the user's inner world: preferences ('I prefer dark mode'), reflections ('I've been thinking about...'), moods, daily notes, and anything subjective. Use this instead of mindgraph_capture when the content is personal/informal rather than a structured fact about the external world. Good for: likes/dislikes, feelings, habits, reminders-to-self, freeform notes.",
|
|
@@ -66,10 +31,6 @@ var TOOLS = [
|
|
|
66
31
|
items: { type: "string" },
|
|
67
32
|
description: "Categorization tags"
|
|
68
33
|
},
|
|
69
|
-
session_uid: {
|
|
70
|
-
type: "string",
|
|
71
|
-
description: "Link to an active session"
|
|
72
|
-
},
|
|
73
34
|
agent_id: {
|
|
74
35
|
type: "string",
|
|
75
36
|
description: "Agent identity"
|
|
@@ -573,8 +534,6 @@ function err(message) {
|
|
|
573
534
|
async function handleTool(client2, name, args) {
|
|
574
535
|
try {
|
|
575
536
|
switch (name) {
|
|
576
|
-
case "mindgraph_session":
|
|
577
|
-
return await handleSession(client2, args);
|
|
578
537
|
case "mindgraph_journal":
|
|
579
538
|
return await handleJournal(client2, args);
|
|
580
539
|
case "mindgraph_capture":
|
|
@@ -603,55 +562,15 @@ async function handleTool(client2, name, args) {
|
|
|
603
562
|
return err(message);
|
|
604
563
|
}
|
|
605
564
|
}
|
|
606
|
-
async function handleSession(client2, args) {
|
|
607
|
-
const { action, label, session_uid, summary, props, agent_id } = args;
|
|
608
|
-
switch (action) {
|
|
609
|
-
case "open": {
|
|
610
|
-
if (!label) return err("label is required for open");
|
|
611
|
-
const result = await client2.session({
|
|
612
|
-
action: "open",
|
|
613
|
-
label,
|
|
614
|
-
summary,
|
|
615
|
-
props,
|
|
616
|
-
agent_id
|
|
617
|
-
});
|
|
618
|
-
return ok(result);
|
|
619
|
-
}
|
|
620
|
-
case "trace": {
|
|
621
|
-
if (!session_uid) return err("session_uid is required for trace");
|
|
622
|
-
if (!label) return err("label is required for trace");
|
|
623
|
-
const result = await client2.session({
|
|
624
|
-
action: "trace",
|
|
625
|
-
label,
|
|
626
|
-
session_uid,
|
|
627
|
-
props,
|
|
628
|
-
agent_id
|
|
629
|
-
});
|
|
630
|
-
return ok(result);
|
|
631
|
-
}
|
|
632
|
-
case "close": {
|
|
633
|
-
if (!session_uid) return err("session_uid is required for close");
|
|
634
|
-
const result = await client2.session({
|
|
635
|
-
action: "close",
|
|
636
|
-
session_uid,
|
|
637
|
-
summary,
|
|
638
|
-
agent_id
|
|
639
|
-
});
|
|
640
|
-
return ok(result);
|
|
641
|
-
}
|
|
642
|
-
default:
|
|
643
|
-
return err(`Unknown session action: ${action}`);
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
565
|
async function handleJournal(client2, args) {
|
|
647
|
-
const { label, content, mood, tags,
|
|
566
|
+
const { label, content, mood, tags, agent_id } = args;
|
|
648
567
|
const props = { content };
|
|
649
568
|
if (mood) props.mood = mood;
|
|
650
569
|
if (tags) props.tags = tags;
|
|
651
570
|
const result = await client2.journal(
|
|
652
571
|
label,
|
|
653
572
|
props,
|
|
654
|
-
{
|
|
573
|
+
{ agent_id }
|
|
655
574
|
);
|
|
656
575
|
return ok(result);
|
|
657
576
|
}
|
|
@@ -1083,7 +1002,6 @@ var INSTRUCTIONS = `You have access to a persistent knowledge graph via MindGrap
|
|
|
1083
1002
|
|
|
1084
1003
|
- **Jump straight to the user's topic.** Do NOT pre-fetch goals, open questions, or other convenience queries unless the user specifically asks about them.
|
|
1085
1004
|
- **Parallelize tool calls.** When you need to search and capture at the same time, issue all calls in a single parallel batch \u2014 never serialize independent calls.
|
|
1086
|
-
- **Sessions are optional.** Only open a session if the conversation is long and substantive. Never open a session as a first action \u2014 answer the user's question first, then open a session in the background if warranted.
|
|
1087
1005
|
|
|
1088
1006
|
## When to READ from the graph
|
|
1089
1007
|
|
|
@@ -1490,7 +1408,7 @@ async function main() {
|
|
|
1490
1408
|
const transport = new import_stdio.StdioServerTransport();
|
|
1491
1409
|
await server.connect(transport);
|
|
1492
1410
|
console.error(
|
|
1493
|
-
`MindGraph MCP server v0.3.
|
|
1411
|
+
`MindGraph MCP server v0.3.2 running on stdio (${BASE_URL})`
|
|
1494
1412
|
);
|
|
1495
1413
|
}
|
|
1496
1414
|
main().catch((error) => {
|
package/package.json
CHANGED