mindgraph-mcp 0.6.1 → 0.7.0
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 +65 -5
- package/dist/index.js +64 -4
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -53,6 +53,8 @@ async function handleTool(client2, name, args) {
|
|
|
53
53
|
return await handleRetrieve(client2, args);
|
|
54
54
|
case "mindgraph_ingest":
|
|
55
55
|
return await handleIngest(client2, args);
|
|
56
|
+
case "mindgraph_synthesize":
|
|
57
|
+
return await handleSynthesize(client2, args);
|
|
56
58
|
default:
|
|
57
59
|
return err(`Unknown tool: ${name}`);
|
|
58
60
|
}
|
|
@@ -566,6 +568,26 @@ async function handleIngest(client2, args) {
|
|
|
566
568
|
return err(`Unknown ingest action: ${action}`);
|
|
567
569
|
}
|
|
568
570
|
}
|
|
571
|
+
async function handleSynthesize(client2, args) {
|
|
572
|
+
const { action, project_uid, signals, target_types, job_id } = args;
|
|
573
|
+
switch (action) {
|
|
574
|
+
case "signals":
|
|
575
|
+
if (!project_uid)
|
|
576
|
+
return err("project_uid is required for action='signals'");
|
|
577
|
+
return ok(
|
|
578
|
+
await client2.signals(project_uid, { signals, target_types })
|
|
579
|
+
);
|
|
580
|
+
case "run":
|
|
581
|
+
if (!project_uid)
|
|
582
|
+
return err("project_uid is required for action='run'");
|
|
583
|
+
return ok(await client2.runSynthesis(project_uid));
|
|
584
|
+
case "job_status":
|
|
585
|
+
if (!job_id) return err("job_id is required for action='job_status'");
|
|
586
|
+
return ok(await client2.getJob(job_id));
|
|
587
|
+
default:
|
|
588
|
+
return err(`Unknown synthesize action: ${action}`);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
569
591
|
var TOOLS;
|
|
570
592
|
var init_tools = __esm({
|
|
571
593
|
"src/tools.ts"() {
|
|
@@ -1011,6 +1033,41 @@ var init_tools = __esm({
|
|
|
1011
1033
|
},
|
|
1012
1034
|
required: ["action"]
|
|
1013
1035
|
}
|
|
1036
|
+
},
|
|
1037
|
+
{
|
|
1038
|
+
name: "mindgraph_synthesize",
|
|
1039
|
+
description: "Work with Projects \u2014 scoped document corpora \u2014 and run cross-document synthesis over them. Use 'signals' to mine structural signals (entity bridges, claim hubs, theory support gaps, concept clusters, analogy candidates, dialectical pairs) without any LLM calls; useful for orientation before a full synthesis. Use 'run' to spawn a background synthesis job that turns the top idea clusters into Article nodes linked via Covers edges. Both operate on a Project's corpus, where documents are linked to the Project via PartOfProject edges (create the project with mindgraph_commit action 'project', then link docs via the ingest flow or add_link). Use 'job_status' to poll a synthesis job.",
|
|
1040
|
+
inputSchema: {
|
|
1041
|
+
type: "object",
|
|
1042
|
+
properties: {
|
|
1043
|
+
action: {
|
|
1044
|
+
type: "string",
|
|
1045
|
+
enum: ["signals", "run", "job_status"],
|
|
1046
|
+
description: "Synthesis action"
|
|
1047
|
+
},
|
|
1048
|
+
project_uid: {
|
|
1049
|
+
type: "string",
|
|
1050
|
+
description: "UID of the Project node (required for signals/run)"
|
|
1051
|
+
},
|
|
1052
|
+
signals: {
|
|
1053
|
+
type: "string",
|
|
1054
|
+
description: "Comma-separated subset of signal names to compute, e.g. 'clustered_claim_hubs,dialectical_pairs'. If omitted, all signals run. (Only for action='signals'.)"
|
|
1055
|
+
},
|
|
1056
|
+
target_types: {
|
|
1057
|
+
type: "string",
|
|
1058
|
+
description: "Comma-separated node types used to filter entity_bridges and claim_hubs (e.g. 'Person,Organization,Theory'). (Only for action='signals'.)"
|
|
1059
|
+
},
|
|
1060
|
+
job_id: {
|
|
1061
|
+
type: "string",
|
|
1062
|
+
description: "Job ID to poll (for action='job_status')"
|
|
1063
|
+
},
|
|
1064
|
+
agent_id: {
|
|
1065
|
+
type: "string",
|
|
1066
|
+
description: "Agent identity"
|
|
1067
|
+
}
|
|
1068
|
+
},
|
|
1069
|
+
required: ["action"]
|
|
1070
|
+
}
|
|
1014
1071
|
}
|
|
1015
1072
|
];
|
|
1016
1073
|
}
|
|
@@ -1022,10 +1079,10 @@ async function main() {
|
|
|
1022
1079
|
const transport = new import_stdio.StdioServerTransport();
|
|
1023
1080
|
await server.connect(transport);
|
|
1024
1081
|
console.error(
|
|
1025
|
-
`MindGraph MCP server v0.
|
|
1082
|
+
`MindGraph MCP server v0.7.0 running on stdio (${BASE_URL})`
|
|
1026
1083
|
);
|
|
1027
1084
|
}
|
|
1028
|
-
var import_server, import_stdio, import_types, import_mindgraph, API_KEY, BASE_URL, AGENT_ID, client, INSTRUCTIONS, server, PROMPTS;
|
|
1085
|
+
var import_server, import_stdio, import_types, import_mindgraph, API_KEY, BASE_URL, AGENT_ID, ORG_ID, client, INSTRUCTIONS, server, PROMPTS;
|
|
1029
1086
|
var init_src = __esm({
|
|
1030
1087
|
"src/index.ts"() {
|
|
1031
1088
|
"use strict";
|
|
@@ -1037,6 +1094,7 @@ var init_src = __esm({
|
|
|
1037
1094
|
API_KEY = process.env.MINDGRAPH_API_KEY;
|
|
1038
1095
|
BASE_URL = process.env.MINDGRAPH_BASE_URL || "https://api.mindgraph.cloud";
|
|
1039
1096
|
AGENT_ID = process.env.MINDGRAPH_AGENT_ID || "mcp";
|
|
1097
|
+
ORG_ID = process.env.MINDGRAPH_ORG_ID;
|
|
1040
1098
|
if (!API_KEY) {
|
|
1041
1099
|
console.error(
|
|
1042
1100
|
"Error: MINDGRAPH_API_KEY environment variable is required.\nGet your API key at https://mindgraph.cloud/dashboard/keys\nOr run: npx mindgraph-mcp init"
|
|
@@ -1045,9 +1103,10 @@ var init_src = __esm({
|
|
|
1045
1103
|
}
|
|
1046
1104
|
client = new import_mindgraph.MindGraph({
|
|
1047
1105
|
baseUrl: BASE_URL,
|
|
1048
|
-
apiKey: API_KEY
|
|
1106
|
+
apiKey: API_KEY,
|
|
1107
|
+
orgId: ORG_ID
|
|
1049
1108
|
});
|
|
1050
|
-
INSTRUCTIONS = `You have access to a persistent knowledge graph via MindGraph (
|
|
1109
|
+
INSTRUCTIONS = `You have access to a persistent knowledge graph via MindGraph (7 tools).
|
|
1051
1110
|
|
|
1052
1111
|
## #1 RULE: Go straight to the user's topic
|
|
1053
1112
|
|
|
@@ -1110,6 +1169,7 @@ Capture knowledge when the user shares something worth remembering:
|
|
|
1110
1169
|
- Goals or projects \u2192 \`mindgraph_commit\` action "goal"/"project"
|
|
1111
1170
|
- Decisions \u2192 \`mindgraph_commit\` action "open_decision"
|
|
1112
1171
|
- Long-form content \u2192 \`mindgraph_ingest\`
|
|
1172
|
+
- Cross-document synthesis over a project corpus \u2192 \`mindgraph_synthesize\` (action "signals" for structural signals; action "run" to spawn a synthesis job that writes Article nodes)
|
|
1113
1173
|
|
|
1114
1174
|
## Tool tips
|
|
1115
1175
|
|
|
@@ -1123,7 +1183,7 @@ Capture knowledge when the user shares something worth remembering:
|
|
|
1123
1183
|
server = new import_server.Server(
|
|
1124
1184
|
{
|
|
1125
1185
|
name: "mindgraph",
|
|
1126
|
-
version: "0.
|
|
1186
|
+
version: "0.7.0"
|
|
1127
1187
|
},
|
|
1128
1188
|
{
|
|
1129
1189
|
capabilities: {
|
package/dist/index.js
CHANGED
|
@@ -448,6 +448,41 @@ var TOOLS = [
|
|
|
448
448
|
},
|
|
449
449
|
required: ["action"]
|
|
450
450
|
}
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
name: "mindgraph_synthesize",
|
|
454
|
+
description: "Work with Projects \u2014 scoped document corpora \u2014 and run cross-document synthesis over them. Use 'signals' to mine structural signals (entity bridges, claim hubs, theory support gaps, concept clusters, analogy candidates, dialectical pairs) without any LLM calls; useful for orientation before a full synthesis. Use 'run' to spawn a background synthesis job that turns the top idea clusters into Article nodes linked via Covers edges. Both operate on a Project's corpus, where documents are linked to the Project via PartOfProject edges (create the project with mindgraph_commit action 'project', then link docs via the ingest flow or add_link). Use 'job_status' to poll a synthesis job.",
|
|
455
|
+
inputSchema: {
|
|
456
|
+
type: "object",
|
|
457
|
+
properties: {
|
|
458
|
+
action: {
|
|
459
|
+
type: "string",
|
|
460
|
+
enum: ["signals", "run", "job_status"],
|
|
461
|
+
description: "Synthesis action"
|
|
462
|
+
},
|
|
463
|
+
project_uid: {
|
|
464
|
+
type: "string",
|
|
465
|
+
description: "UID of the Project node (required for signals/run)"
|
|
466
|
+
},
|
|
467
|
+
signals: {
|
|
468
|
+
type: "string",
|
|
469
|
+
description: "Comma-separated subset of signal names to compute, e.g. 'clustered_claim_hubs,dialectical_pairs'. If omitted, all signals run. (Only for action='signals'.)"
|
|
470
|
+
},
|
|
471
|
+
target_types: {
|
|
472
|
+
type: "string",
|
|
473
|
+
description: "Comma-separated node types used to filter entity_bridges and claim_hubs (e.g. 'Person,Organization,Theory'). (Only for action='signals'.)"
|
|
474
|
+
},
|
|
475
|
+
job_id: {
|
|
476
|
+
type: "string",
|
|
477
|
+
description: "Job ID to poll (for action='job_status')"
|
|
478
|
+
},
|
|
479
|
+
agent_id: {
|
|
480
|
+
type: "string",
|
|
481
|
+
description: "Agent identity"
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
required: ["action"]
|
|
485
|
+
}
|
|
451
486
|
}
|
|
452
487
|
];
|
|
453
488
|
function ok(data) {
|
|
@@ -476,6 +511,8 @@ async function handleTool(client2, name, args) {
|
|
|
476
511
|
return await handleRetrieve(client2, args);
|
|
477
512
|
case "mindgraph_ingest":
|
|
478
513
|
return await handleIngest(client2, args);
|
|
514
|
+
case "mindgraph_synthesize":
|
|
515
|
+
return await handleSynthesize(client2, args);
|
|
479
516
|
default:
|
|
480
517
|
return err(`Unknown tool: ${name}`);
|
|
481
518
|
}
|
|
@@ -989,11 +1026,32 @@ async function handleIngest(client2, args) {
|
|
|
989
1026
|
return err(`Unknown ingest action: ${action}`);
|
|
990
1027
|
}
|
|
991
1028
|
}
|
|
1029
|
+
async function handleSynthesize(client2, args) {
|
|
1030
|
+
const { action, project_uid, signals, target_types, job_id } = args;
|
|
1031
|
+
switch (action) {
|
|
1032
|
+
case "signals":
|
|
1033
|
+
if (!project_uid)
|
|
1034
|
+
return err("project_uid is required for action='signals'");
|
|
1035
|
+
return ok(
|
|
1036
|
+
await client2.signals(project_uid, { signals, target_types })
|
|
1037
|
+
);
|
|
1038
|
+
case "run":
|
|
1039
|
+
if (!project_uid)
|
|
1040
|
+
return err("project_uid is required for action='run'");
|
|
1041
|
+
return ok(await client2.runSynthesis(project_uid));
|
|
1042
|
+
case "job_status":
|
|
1043
|
+
if (!job_id) return err("job_id is required for action='job_status'");
|
|
1044
|
+
return ok(await client2.getJob(job_id));
|
|
1045
|
+
default:
|
|
1046
|
+
return err(`Unknown synthesize action: ${action}`);
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
992
1049
|
|
|
993
1050
|
// src/index.ts
|
|
994
1051
|
var API_KEY = process.env.MINDGRAPH_API_KEY;
|
|
995
1052
|
var BASE_URL = process.env.MINDGRAPH_BASE_URL || "https://api.mindgraph.cloud";
|
|
996
1053
|
var AGENT_ID = process.env.MINDGRAPH_AGENT_ID || "mcp";
|
|
1054
|
+
var ORG_ID = process.env.MINDGRAPH_ORG_ID;
|
|
997
1055
|
if (!API_KEY) {
|
|
998
1056
|
console.error(
|
|
999
1057
|
"Error: MINDGRAPH_API_KEY environment variable is required.\nGet your API key at https://mindgraph.cloud/dashboard/keys\nOr run: npx mindgraph-mcp init"
|
|
@@ -1002,9 +1060,10 @@ if (!API_KEY) {
|
|
|
1002
1060
|
}
|
|
1003
1061
|
var client = new import_mindgraph.MindGraph({
|
|
1004
1062
|
baseUrl: BASE_URL,
|
|
1005
|
-
apiKey: API_KEY
|
|
1063
|
+
apiKey: API_KEY,
|
|
1064
|
+
orgId: ORG_ID
|
|
1006
1065
|
});
|
|
1007
|
-
var INSTRUCTIONS = `You have access to a persistent knowledge graph via MindGraph (
|
|
1066
|
+
var INSTRUCTIONS = `You have access to a persistent knowledge graph via MindGraph (7 tools).
|
|
1008
1067
|
|
|
1009
1068
|
## #1 RULE: Go straight to the user's topic
|
|
1010
1069
|
|
|
@@ -1067,6 +1126,7 @@ Capture knowledge when the user shares something worth remembering:
|
|
|
1067
1126
|
- Goals or projects \u2192 \`mindgraph_commit\` action "goal"/"project"
|
|
1068
1127
|
- Decisions \u2192 \`mindgraph_commit\` action "open_decision"
|
|
1069
1128
|
- Long-form content \u2192 \`mindgraph_ingest\`
|
|
1129
|
+
- Cross-document synthesis over a project corpus \u2192 \`mindgraph_synthesize\` (action "signals" for structural signals; action "run" to spawn a synthesis job that writes Article nodes)
|
|
1070
1130
|
|
|
1071
1131
|
## Tool tips
|
|
1072
1132
|
|
|
@@ -1080,7 +1140,7 @@ Capture knowledge when the user shares something worth remembering:
|
|
|
1080
1140
|
var server = new import_server.Server(
|
|
1081
1141
|
{
|
|
1082
1142
|
name: "mindgraph",
|
|
1083
|
-
version: "0.
|
|
1143
|
+
version: "0.7.0"
|
|
1084
1144
|
},
|
|
1085
1145
|
{
|
|
1086
1146
|
capabilities: {
|
|
@@ -1436,7 +1496,7 @@ async function main() {
|
|
|
1436
1496
|
const transport = new import_stdio.StdioServerTransport();
|
|
1437
1497
|
await server.connect(transport);
|
|
1438
1498
|
console.error(
|
|
1439
|
-
`MindGraph MCP server v0.
|
|
1499
|
+
`MindGraph MCP server v0.7.0 running on stdio (${BASE_URL})`
|
|
1440
1500
|
);
|
|
1441
1501
|
}
|
|
1442
1502
|
main().catch((error) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mindgraph-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "MCP server for MindGraph — connect Claude Desktop, Claude Code, and any MCP client to your knowledge graph",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
30
|
-
"mindgraph": "^0.
|
|
30
|
+
"mindgraph": "^0.4.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "^22.0.0",
|