mindgraph-mcp 0.10.0 → 0.11.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/README.md +3 -3
- package/dist/cli.js +172 -15
- package/dist/index.js +172 -15
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -55,9 +55,9 @@ Or drop this into your Claude Desktop config by hand (`~/Library/Application Sup
|
|
|
55
55
|
|------|---------|
|
|
56
56
|
| `mindgraph_capture` | Entities, observations, sources, snippets, concepts, journal entries |
|
|
57
57
|
| `mindgraph_reason` | Claims with evidence, open questions, hypotheses, theories, anomalies |
|
|
58
|
-
| `mindgraph_commit` | Goals, projects, decisions, options, milestones |
|
|
58
|
+
| `mindgraph_commit` | Goals, projects, decisions, options, milestones, and dated decision-context linkage |
|
|
59
59
|
| `mindgraph_plan` | Plans, tasks, procedures, governance policies, risk assessments, executions |
|
|
60
|
-
| `mindgraph_retrieve` |
|
|
60
|
+
| `mindgraph_retrieve` | Context retrieval with bounded graph expansion, search, min-cost traversal, document index |
|
|
61
61
|
| `mindgraph_ingest` | Chunk / document / session ingestion with LLM-powered extraction |
|
|
62
62
|
| `mindgraph_synthesize` | Project-scoped cross-document synthesis — mine signals, spawn Article-generation jobs |
|
|
63
63
|
| `mindgraph_ontology` | Operational Ontology (Layer 7) — typed domain objects, NL queries with provenance, extraction proposal review (approve/reject), object linking |
|
|
@@ -113,7 +113,7 @@ The server auto-injects `agent_id: "mcp"` on every write so you always know whic
|
|
|
113
113
|
|
|
114
114
|
This MCP server is a thin wrapper over the [mindgraph](https://www.npmjs.com/package/mindgraph) TypeScript SDK. It exposes cognitive-layer abstractions (Reality, Epistemic, Intent, Action, Memory, Agent) as consolidated tools rather than one-tool-per-endpoint, which keeps the tool surface compact enough for high-quality tool selection by the model.
|
|
115
115
|
|
|
116
|
-
Search strategy is **keyword-first**: `mindgraph_retrieve` defaults to `action: "context"
|
|
116
|
+
Search strategy is **keyword-first**: `mindgraph_retrieve` defaults to `action: "context"`, which seeds bounded cheapest-first graph expansion from BM25/hybrid recall. Escalate to `semantic` or `hybrid` only when keywords fail. Set `graph_expansion_limit: 0` when direct-only retrieval is required.
|
|
117
117
|
|
|
118
118
|
## Development
|
|
119
119
|
|
package/dist/cli.js
CHANGED
|
@@ -209,6 +209,10 @@ async function handleCommit(client2, args) {
|
|
|
209
209
|
parent_uid,
|
|
210
210
|
decision_uid,
|
|
211
211
|
chosen_option_uid,
|
|
212
|
+
informs_uid,
|
|
213
|
+
as_of_date,
|
|
214
|
+
session_id,
|
|
215
|
+
retrieval_trace_id,
|
|
212
216
|
confidence,
|
|
213
217
|
salience,
|
|
214
218
|
props,
|
|
@@ -256,6 +260,11 @@ async function handleCommit(client2, args) {
|
|
|
256
260
|
return ok(
|
|
257
261
|
await client2.resolveDecision(decision_uid, chosen_option_uid, {
|
|
258
262
|
summary,
|
|
263
|
+
props,
|
|
264
|
+
informs_uid,
|
|
265
|
+
as_of_date,
|
|
266
|
+
session_id,
|
|
267
|
+
retrieval_trace_id,
|
|
259
268
|
agent_id
|
|
260
269
|
})
|
|
261
270
|
);
|
|
@@ -376,11 +385,17 @@ async function handleRetrieve(client2, args) {
|
|
|
376
385
|
max_depth,
|
|
377
386
|
direction,
|
|
378
387
|
edge_types,
|
|
388
|
+
exclude_edge_types,
|
|
389
|
+
include_provenance,
|
|
390
|
+
max_nodes,
|
|
379
391
|
node_types,
|
|
380
392
|
layer,
|
|
381
393
|
limit,
|
|
394
|
+
offset,
|
|
382
395
|
include_chunks,
|
|
383
396
|
include_graph,
|
|
397
|
+
graph_expansion_limit,
|
|
398
|
+
graph_max_depth,
|
|
384
399
|
confidence_min,
|
|
385
400
|
salience_min,
|
|
386
401
|
agent_id
|
|
@@ -395,7 +410,9 @@ async function handleRetrieve(client2, args) {
|
|
|
395
410
|
node_types,
|
|
396
411
|
layer,
|
|
397
412
|
chunk_limit: include_chunks ? limit ?? 5 : 0,
|
|
398
|
-
include_graph
|
|
413
|
+
include_graph,
|
|
414
|
+
graph_expansion_limit: graph_expansion_limit ?? 3,
|
|
415
|
+
graph_max_depth: graph_max_depth ?? 2
|
|
399
416
|
})
|
|
400
417
|
);
|
|
401
418
|
case "text":
|
|
@@ -445,6 +462,14 @@ async function handleRetrieve(client2, args) {
|
|
|
445
462
|
return ok(await client2.getPendingApprovals());
|
|
446
463
|
case "unresolved_contradictions":
|
|
447
464
|
return ok(await client2.getContradictions());
|
|
465
|
+
case "stale_derivations":
|
|
466
|
+
return ok(
|
|
467
|
+
await client2.retrieve({
|
|
468
|
+
action: "stale_derivations",
|
|
469
|
+
limit,
|
|
470
|
+
offset
|
|
471
|
+
})
|
|
472
|
+
);
|
|
448
473
|
case "preferences":
|
|
449
474
|
return ok(
|
|
450
475
|
await client2.retrieve({
|
|
@@ -490,7 +515,10 @@ async function handleRetrieve(client2, args) {
|
|
|
490
515
|
await client2.traverse({
|
|
491
516
|
action: "chain",
|
|
492
517
|
start_uid,
|
|
493
|
-
max_depth
|
|
518
|
+
max_depth,
|
|
519
|
+
exclude_edge_types,
|
|
520
|
+
include_provenance,
|
|
521
|
+
max_nodes
|
|
494
522
|
})
|
|
495
523
|
);
|
|
496
524
|
case "neighborhood":
|
|
@@ -501,7 +529,10 @@ async function handleRetrieve(client2, args) {
|
|
|
501
529
|
start_uid,
|
|
502
530
|
max_depth,
|
|
503
531
|
direction,
|
|
504
|
-
edge_types
|
|
532
|
+
edge_types,
|
|
533
|
+
exclude_edge_types,
|
|
534
|
+
include_provenance,
|
|
535
|
+
max_nodes
|
|
505
536
|
})
|
|
506
537
|
);
|
|
507
538
|
case "path":
|
|
@@ -514,7 +545,10 @@ async function handleRetrieve(client2, args) {
|
|
|
514
545
|
end_uid,
|
|
515
546
|
max_depth,
|
|
516
547
|
direction,
|
|
517
|
-
edge_types
|
|
548
|
+
edge_types,
|
|
549
|
+
exclude_edge_types,
|
|
550
|
+
include_provenance,
|
|
551
|
+
max_nodes
|
|
518
552
|
})
|
|
519
553
|
);
|
|
520
554
|
case "subgraph":
|
|
@@ -525,7 +559,10 @@ async function handleRetrieve(client2, args) {
|
|
|
525
559
|
start_uid,
|
|
526
560
|
max_depth,
|
|
527
561
|
direction,
|
|
528
|
-
edge_types
|
|
562
|
+
edge_types,
|
|
563
|
+
exclude_edge_types,
|
|
564
|
+
include_provenance,
|
|
565
|
+
max_nodes
|
|
529
566
|
})
|
|
530
567
|
);
|
|
531
568
|
default:
|
|
@@ -533,17 +570,40 @@ async function handleRetrieve(client2, args) {
|
|
|
533
570
|
}
|
|
534
571
|
}
|
|
535
572
|
async function handleIngest(client2, args) {
|
|
536
|
-
const {
|
|
573
|
+
const {
|
|
574
|
+
action,
|
|
575
|
+
content,
|
|
576
|
+
title,
|
|
577
|
+
source_uri,
|
|
578
|
+
source,
|
|
579
|
+
// deprecated alias for source_uri (kept for cached tool schemas)
|
|
580
|
+
content_type,
|
|
581
|
+
document_type,
|
|
582
|
+
layers,
|
|
583
|
+
ontology_schema_id,
|
|
584
|
+
participants,
|
|
585
|
+
occurred_at,
|
|
586
|
+
context,
|
|
587
|
+
document_uid,
|
|
588
|
+
chunk_index,
|
|
589
|
+
chunk_size,
|
|
590
|
+
chunk_overlap,
|
|
591
|
+
job_id,
|
|
592
|
+
agent_id
|
|
593
|
+
} = args;
|
|
594
|
+
const src = source_uri ?? source;
|
|
537
595
|
switch (action) {
|
|
538
596
|
case "chunk":
|
|
539
597
|
if (!content) return err("content is required for chunk ingestion");
|
|
540
598
|
return ok(
|
|
541
599
|
await client2.ingestChunk({
|
|
542
600
|
content,
|
|
543
|
-
title,
|
|
544
|
-
|
|
601
|
+
label: title,
|
|
602
|
+
document_uid,
|
|
603
|
+
chunk_index,
|
|
545
604
|
layers,
|
|
546
|
-
agent_id
|
|
605
|
+
agent_id,
|
|
606
|
+
ontology_schema_id
|
|
547
607
|
})
|
|
548
608
|
);
|
|
549
609
|
case "document":
|
|
@@ -552,8 +612,14 @@ async function handleIngest(client2, args) {
|
|
|
552
612
|
await client2.ingestDocument({
|
|
553
613
|
content,
|
|
554
614
|
title,
|
|
555
|
-
|
|
615
|
+
source_uri: src,
|
|
616
|
+
content_type,
|
|
617
|
+
document_type,
|
|
556
618
|
layers,
|
|
619
|
+
ontology_schema_id,
|
|
620
|
+
participants,
|
|
621
|
+
occurred_at,
|
|
622
|
+
context,
|
|
557
623
|
chunk_size,
|
|
558
624
|
chunk_overlap,
|
|
559
625
|
agent_id
|
|
@@ -565,8 +631,13 @@ async function handleIngest(client2, args) {
|
|
|
565
631
|
await client2.ingestSession({
|
|
566
632
|
content,
|
|
567
633
|
title,
|
|
568
|
-
source,
|
|
569
634
|
layers,
|
|
635
|
+
ontology_schema_id,
|
|
636
|
+
participants,
|
|
637
|
+
occurred_at,
|
|
638
|
+
context,
|
|
639
|
+
chunk_size,
|
|
640
|
+
chunk_overlap,
|
|
570
641
|
agent_id
|
|
571
642
|
})
|
|
572
643
|
);
|
|
@@ -921,6 +992,23 @@ var init_tools = __esm({
|
|
|
921
992
|
type: "string",
|
|
922
993
|
description: "UID of the chosen option (for resolve_decision)"
|
|
923
994
|
},
|
|
995
|
+
informs_uid: {
|
|
996
|
+
type: "array",
|
|
997
|
+
items: { type: "string" },
|
|
998
|
+
description: "Decision-time context UIDs to link with dated INFORMS edges"
|
|
999
|
+
},
|
|
1000
|
+
as_of_date: {
|
|
1001
|
+
type: "string",
|
|
1002
|
+
description: "ISO 8601 date when the decision context was available"
|
|
1003
|
+
},
|
|
1004
|
+
session_id: {
|
|
1005
|
+
type: "string",
|
|
1006
|
+
description: "Session whose retrieval context informed the decision"
|
|
1007
|
+
},
|
|
1008
|
+
retrieval_trace_id: {
|
|
1009
|
+
type: "string",
|
|
1010
|
+
description: "Identifier of the decision-time retrieval trace"
|
|
1011
|
+
},
|
|
924
1012
|
confidence: {
|
|
925
1013
|
type: "number",
|
|
926
1014
|
minimum: 0,
|
|
@@ -1011,7 +1099,7 @@ var init_tools = __esm({
|
|
|
1011
1099
|
},
|
|
1012
1100
|
{
|
|
1013
1101
|
name: "mindgraph_retrieve",
|
|
1014
|
-
description: "Search and explore the knowledge graph. Use 'context' (default) for BM25 keyword retrieval \u2014 returns graph nodes only by default (labels, summaries, types, confidence); set include_chunks=true to also get full source text. Pass 1-3 discriminating keywords, not sentences. GOOD: 'Kissinger NATO'. BAD: 'What is Kissinger\\'s view on NATO?'. Use 'document_index' to list all ingested documents (titles, dates, UIDs) for orientation. Use 'semantic' when keywords return nothing \u2014 conceptual/fuzzy queries. Use 'hybrid' for keyword + semantic. Use 'text' for fast keyword-only. Use 'neighborhood'/'chain'/'path'/'subgraph' for graph traversal \u2014 traversal steps carry path_cost (lower = stronger connection; sum of -ln(edge weight))
|
|
1102
|
+
description: "Search and explore the knowledge graph. Use 'context' (default) for BM25 keyword retrieval plus bounded cheapest-first graph expansion \u2014 returns graph nodes only by default (labels, summaries, types, confidence); set include_chunks=true to also get full source text. Pass 1-3 discriminating keywords, not sentences. GOOD: 'Kissinger NATO'. BAD: 'What is Kissinger\\'s view on NATO?'. Use 'document_index' to list all ingested documents (titles, dates, UIDs) for orientation. Use 'semantic' when keywords return nothing \u2014 conceptual/fuzzy queries. Use 'hybrid' for keyword + semantic. Use 'text' for fast keyword-only. Use 'neighborhood'/'chain'/'path'/'subgraph' for graph traversal \u2014 traversal steps carry the cheapest witness path_cost (lower = stronger connection; sum of -ln(edge weight)), path_confidence, and witness depth. Use 'preferences' for advice or recommendation requests ('suggest a hotel', 'what should I read?') \u2014 it returns the user's stated/learned preferences relevant to the query (pass the topic as 'query'), so your answer reflects what they actually like instead of being generic. Other structured actions ('active_goals', 'open_questions', etc.) only when the user explicitly asks.",
|
|
1015
1103
|
inputSchema: {
|
|
1016
1104
|
type: "object",
|
|
1017
1105
|
properties: {
|
|
@@ -1027,6 +1115,7 @@ var init_tools = __esm({
|
|
|
1027
1115
|
"weak_claims",
|
|
1028
1116
|
"pending_approvals",
|
|
1029
1117
|
"unresolved_contradictions",
|
|
1118
|
+
"stale_derivations",
|
|
1030
1119
|
"preferences",
|
|
1031
1120
|
"layer",
|
|
1032
1121
|
"recent",
|
|
@@ -1064,6 +1153,19 @@ var init_tools = __esm({
|
|
|
1064
1153
|
items: { type: "string" },
|
|
1065
1154
|
description: "Filter by edge types (for traversal actions)"
|
|
1066
1155
|
},
|
|
1156
|
+
exclude_edge_types: {
|
|
1157
|
+
type: "array",
|
|
1158
|
+
items: { type: "string" },
|
|
1159
|
+
description: "Denylist edge types (for traversal actions)"
|
|
1160
|
+
},
|
|
1161
|
+
include_provenance: {
|
|
1162
|
+
type: "boolean",
|
|
1163
|
+
description: "Include ingestion/provenance edges in traversal (default false)"
|
|
1164
|
+
},
|
|
1165
|
+
max_nodes: {
|
|
1166
|
+
type: "number",
|
|
1167
|
+
description: "Global distinct-node traversal budget, including the seed (default 500)"
|
|
1168
|
+
},
|
|
1067
1169
|
node_types: {
|
|
1068
1170
|
type: "array",
|
|
1069
1171
|
items: { type: "string" },
|
|
@@ -1078,6 +1180,10 @@ var init_tools = __esm({
|
|
|
1078
1180
|
type: "number",
|
|
1079
1181
|
description: "Max results to return (default: 27)"
|
|
1080
1182
|
},
|
|
1183
|
+
offset: {
|
|
1184
|
+
type: "number",
|
|
1185
|
+
description: "Pagination offset (for stale_derivations)"
|
|
1186
|
+
},
|
|
1081
1187
|
include_chunks: {
|
|
1082
1188
|
type: "boolean",
|
|
1083
1189
|
description: "Include source document chunks in context results (default: false \u2014 set true to fetch full chunk text for citations or deep reading)"
|
|
@@ -1086,6 +1192,14 @@ var init_tools = __esm({
|
|
|
1086
1192
|
type: "boolean",
|
|
1087
1193
|
description: "Include graph nodes in context results (default: true)"
|
|
1088
1194
|
},
|
|
1195
|
+
graph_expansion_limit: {
|
|
1196
|
+
type: "number",
|
|
1197
|
+
description: "Context-only graph expansion slots (default 3; set 0 for direct-only retrieval)"
|
|
1198
|
+
},
|
|
1199
|
+
graph_max_depth: {
|
|
1200
|
+
type: "number",
|
|
1201
|
+
description: "Context-only graph expansion hop limit (default 2)"
|
|
1202
|
+
},
|
|
1089
1203
|
confidence_min: {
|
|
1090
1204
|
type: "number",
|
|
1091
1205
|
minimum: 0,
|
|
@@ -1125,10 +1239,19 @@ var init_tools = __esm({
|
|
|
1125
1239
|
type: "string",
|
|
1126
1240
|
description: "Document or session title"
|
|
1127
1241
|
},
|
|
1128
|
-
|
|
1242
|
+
source_uri: {
|
|
1129
1243
|
type: "string",
|
|
1130
1244
|
description: "Source URL or reference"
|
|
1131
1245
|
},
|
|
1246
|
+
content_type: {
|
|
1247
|
+
type: "string",
|
|
1248
|
+
enum: ["article", "meeting_notes", "report", "journal", "transcript"],
|
|
1249
|
+
description: "Semantic type that drives default extraction layers. IMPORTANT: for conversation transcripts, use action 'session' OR content_type 'transcript' \u2014 otherwise Decisions, Options, and Constraints are NOT extracted."
|
|
1250
|
+
},
|
|
1251
|
+
document_type: {
|
|
1252
|
+
type: "string",
|
|
1253
|
+
description: "Free-form document type label (e.g. 'note', 'spec')."
|
|
1254
|
+
},
|
|
1132
1255
|
layers: {
|
|
1133
1256
|
type: "array",
|
|
1134
1257
|
items: {
|
|
@@ -1139,11 +1262,45 @@ var init_tools = __esm({
|
|
|
1139
1262
|
"intent",
|
|
1140
1263
|
"action",
|
|
1141
1264
|
"memory",
|
|
1142
|
-
"agent"
|
|
1265
|
+
"agent",
|
|
1266
|
+
"ontology"
|
|
1143
1267
|
]
|
|
1144
1268
|
},
|
|
1145
1269
|
description: "Cognitive layers to extract (defaults vary by action)"
|
|
1146
1270
|
},
|
|
1271
|
+
ontology_schema_id: {
|
|
1272
|
+
type: "string",
|
|
1273
|
+
description: "When set, run typed Layer-7 (domain-object) extraction against this schema in addition to the cognitive layers."
|
|
1274
|
+
},
|
|
1275
|
+
participants: {
|
|
1276
|
+
type: "array",
|
|
1277
|
+
items: {
|
|
1278
|
+
type: "object",
|
|
1279
|
+
properties: {
|
|
1280
|
+
name: { type: "string" },
|
|
1281
|
+
organization: { type: "string" },
|
|
1282
|
+
role: { type: "string" }
|
|
1283
|
+
},
|
|
1284
|
+
required: ["name"]
|
|
1285
|
+
},
|
|
1286
|
+
description: "Named conversation participants. Maps generic speaker labels ('Interviewer:') to real people so claims/demands attribute to the named person."
|
|
1287
|
+
},
|
|
1288
|
+
occurred_at: {
|
|
1289
|
+
type: "string",
|
|
1290
|
+
description: "When the conversation/document occurred (ISO-8601)."
|
|
1291
|
+
},
|
|
1292
|
+
context: {
|
|
1293
|
+
type: "string",
|
|
1294
|
+
description: "Free-text context grounding attribution during extraction."
|
|
1295
|
+
},
|
|
1296
|
+
document_uid: {
|
|
1297
|
+
type: "string",
|
|
1298
|
+
description: "chunk action: the parent Document uid, so this chunk joins that document's provenance chain."
|
|
1299
|
+
},
|
|
1300
|
+
chunk_index: {
|
|
1301
|
+
type: "number",
|
|
1302
|
+
description: "chunk action: 0-based index of this chunk within its document."
|
|
1303
|
+
},
|
|
1147
1304
|
chunk_size: {
|
|
1148
1305
|
type: "number",
|
|
1149
1306
|
description: "Characters per chunk for document ingestion (default: 4000)"
|
|
@@ -1501,7 +1658,7 @@ Capture knowledge when the user shares something worth remembering:
|
|
|
1501
1658
|
server = new import_server.Server(
|
|
1502
1659
|
{
|
|
1503
1660
|
name: "mindgraph",
|
|
1504
|
-
version: "0.
|
|
1661
|
+
version: "0.10.0"
|
|
1505
1662
|
},
|
|
1506
1663
|
{
|
|
1507
1664
|
capabilities: {
|
package/dist/index.js
CHANGED
|
@@ -207,6 +207,23 @@ var TOOLS = [
|
|
|
207
207
|
type: "string",
|
|
208
208
|
description: "UID of the chosen option (for resolve_decision)"
|
|
209
209
|
},
|
|
210
|
+
informs_uid: {
|
|
211
|
+
type: "array",
|
|
212
|
+
items: { type: "string" },
|
|
213
|
+
description: "Decision-time context UIDs to link with dated INFORMS edges"
|
|
214
|
+
},
|
|
215
|
+
as_of_date: {
|
|
216
|
+
type: "string",
|
|
217
|
+
description: "ISO 8601 date when the decision context was available"
|
|
218
|
+
},
|
|
219
|
+
session_id: {
|
|
220
|
+
type: "string",
|
|
221
|
+
description: "Session whose retrieval context informed the decision"
|
|
222
|
+
},
|
|
223
|
+
retrieval_trace_id: {
|
|
224
|
+
type: "string",
|
|
225
|
+
description: "Identifier of the decision-time retrieval trace"
|
|
226
|
+
},
|
|
210
227
|
confidence: {
|
|
211
228
|
type: "number",
|
|
212
229
|
minimum: 0,
|
|
@@ -297,7 +314,7 @@ var TOOLS = [
|
|
|
297
314
|
},
|
|
298
315
|
{
|
|
299
316
|
name: "mindgraph_retrieve",
|
|
300
|
-
description: "Search and explore the knowledge graph. Use 'context' (default) for BM25 keyword retrieval \u2014 returns graph nodes only by default (labels, summaries, types, confidence); set include_chunks=true to also get full source text. Pass 1-3 discriminating keywords, not sentences. GOOD: 'Kissinger NATO'. BAD: 'What is Kissinger\\'s view on NATO?'. Use 'document_index' to list all ingested documents (titles, dates, UIDs) for orientation. Use 'semantic' when keywords return nothing \u2014 conceptual/fuzzy queries. Use 'hybrid' for keyword + semantic. Use 'text' for fast keyword-only. Use 'neighborhood'/'chain'/'path'/'subgraph' for graph traversal \u2014 traversal steps carry path_cost (lower = stronger connection; sum of -ln(edge weight))
|
|
317
|
+
description: "Search and explore the knowledge graph. Use 'context' (default) for BM25 keyword retrieval plus bounded cheapest-first graph expansion \u2014 returns graph nodes only by default (labels, summaries, types, confidence); set include_chunks=true to also get full source text. Pass 1-3 discriminating keywords, not sentences. GOOD: 'Kissinger NATO'. BAD: 'What is Kissinger\\'s view on NATO?'. Use 'document_index' to list all ingested documents (titles, dates, UIDs) for orientation. Use 'semantic' when keywords return nothing \u2014 conceptual/fuzzy queries. Use 'hybrid' for keyword + semantic. Use 'text' for fast keyword-only. Use 'neighborhood'/'chain'/'path'/'subgraph' for graph traversal \u2014 traversal steps carry the cheapest witness path_cost (lower = stronger connection; sum of -ln(edge weight)), path_confidence, and witness depth. Use 'preferences' for advice or recommendation requests ('suggest a hotel', 'what should I read?') \u2014 it returns the user's stated/learned preferences relevant to the query (pass the topic as 'query'), so your answer reflects what they actually like instead of being generic. Other structured actions ('active_goals', 'open_questions', etc.) only when the user explicitly asks.",
|
|
301
318
|
inputSchema: {
|
|
302
319
|
type: "object",
|
|
303
320
|
properties: {
|
|
@@ -313,6 +330,7 @@ var TOOLS = [
|
|
|
313
330
|
"weak_claims",
|
|
314
331
|
"pending_approvals",
|
|
315
332
|
"unresolved_contradictions",
|
|
333
|
+
"stale_derivations",
|
|
316
334
|
"preferences",
|
|
317
335
|
"layer",
|
|
318
336
|
"recent",
|
|
@@ -350,6 +368,19 @@ var TOOLS = [
|
|
|
350
368
|
items: { type: "string" },
|
|
351
369
|
description: "Filter by edge types (for traversal actions)"
|
|
352
370
|
},
|
|
371
|
+
exclude_edge_types: {
|
|
372
|
+
type: "array",
|
|
373
|
+
items: { type: "string" },
|
|
374
|
+
description: "Denylist edge types (for traversal actions)"
|
|
375
|
+
},
|
|
376
|
+
include_provenance: {
|
|
377
|
+
type: "boolean",
|
|
378
|
+
description: "Include ingestion/provenance edges in traversal (default false)"
|
|
379
|
+
},
|
|
380
|
+
max_nodes: {
|
|
381
|
+
type: "number",
|
|
382
|
+
description: "Global distinct-node traversal budget, including the seed (default 500)"
|
|
383
|
+
},
|
|
353
384
|
node_types: {
|
|
354
385
|
type: "array",
|
|
355
386
|
items: { type: "string" },
|
|
@@ -364,6 +395,10 @@ var TOOLS = [
|
|
|
364
395
|
type: "number",
|
|
365
396
|
description: "Max results to return (default: 27)"
|
|
366
397
|
},
|
|
398
|
+
offset: {
|
|
399
|
+
type: "number",
|
|
400
|
+
description: "Pagination offset (for stale_derivations)"
|
|
401
|
+
},
|
|
367
402
|
include_chunks: {
|
|
368
403
|
type: "boolean",
|
|
369
404
|
description: "Include source document chunks in context results (default: false \u2014 set true to fetch full chunk text for citations or deep reading)"
|
|
@@ -372,6 +407,14 @@ var TOOLS = [
|
|
|
372
407
|
type: "boolean",
|
|
373
408
|
description: "Include graph nodes in context results (default: true)"
|
|
374
409
|
},
|
|
410
|
+
graph_expansion_limit: {
|
|
411
|
+
type: "number",
|
|
412
|
+
description: "Context-only graph expansion slots (default 3; set 0 for direct-only retrieval)"
|
|
413
|
+
},
|
|
414
|
+
graph_max_depth: {
|
|
415
|
+
type: "number",
|
|
416
|
+
description: "Context-only graph expansion hop limit (default 2)"
|
|
417
|
+
},
|
|
375
418
|
confidence_min: {
|
|
376
419
|
type: "number",
|
|
377
420
|
minimum: 0,
|
|
@@ -411,10 +454,19 @@ var TOOLS = [
|
|
|
411
454
|
type: "string",
|
|
412
455
|
description: "Document or session title"
|
|
413
456
|
},
|
|
414
|
-
|
|
457
|
+
source_uri: {
|
|
415
458
|
type: "string",
|
|
416
459
|
description: "Source URL or reference"
|
|
417
460
|
},
|
|
461
|
+
content_type: {
|
|
462
|
+
type: "string",
|
|
463
|
+
enum: ["article", "meeting_notes", "report", "journal", "transcript"],
|
|
464
|
+
description: "Semantic type that drives default extraction layers. IMPORTANT: for conversation transcripts, use action 'session' OR content_type 'transcript' \u2014 otherwise Decisions, Options, and Constraints are NOT extracted."
|
|
465
|
+
},
|
|
466
|
+
document_type: {
|
|
467
|
+
type: "string",
|
|
468
|
+
description: "Free-form document type label (e.g. 'note', 'spec')."
|
|
469
|
+
},
|
|
418
470
|
layers: {
|
|
419
471
|
type: "array",
|
|
420
472
|
items: {
|
|
@@ -425,11 +477,45 @@ var TOOLS = [
|
|
|
425
477
|
"intent",
|
|
426
478
|
"action",
|
|
427
479
|
"memory",
|
|
428
|
-
"agent"
|
|
480
|
+
"agent",
|
|
481
|
+
"ontology"
|
|
429
482
|
]
|
|
430
483
|
},
|
|
431
484
|
description: "Cognitive layers to extract (defaults vary by action)"
|
|
432
485
|
},
|
|
486
|
+
ontology_schema_id: {
|
|
487
|
+
type: "string",
|
|
488
|
+
description: "When set, run typed Layer-7 (domain-object) extraction against this schema in addition to the cognitive layers."
|
|
489
|
+
},
|
|
490
|
+
participants: {
|
|
491
|
+
type: "array",
|
|
492
|
+
items: {
|
|
493
|
+
type: "object",
|
|
494
|
+
properties: {
|
|
495
|
+
name: { type: "string" },
|
|
496
|
+
organization: { type: "string" },
|
|
497
|
+
role: { type: "string" }
|
|
498
|
+
},
|
|
499
|
+
required: ["name"]
|
|
500
|
+
},
|
|
501
|
+
description: "Named conversation participants. Maps generic speaker labels ('Interviewer:') to real people so claims/demands attribute to the named person."
|
|
502
|
+
},
|
|
503
|
+
occurred_at: {
|
|
504
|
+
type: "string",
|
|
505
|
+
description: "When the conversation/document occurred (ISO-8601)."
|
|
506
|
+
},
|
|
507
|
+
context: {
|
|
508
|
+
type: "string",
|
|
509
|
+
description: "Free-text context grounding attribution during extraction."
|
|
510
|
+
},
|
|
511
|
+
document_uid: {
|
|
512
|
+
type: "string",
|
|
513
|
+
description: "chunk action: the parent Document uid, so this chunk joins that document's provenance chain."
|
|
514
|
+
},
|
|
515
|
+
chunk_index: {
|
|
516
|
+
type: "number",
|
|
517
|
+
description: "chunk action: 0-based index of this chunk within its document."
|
|
518
|
+
},
|
|
433
519
|
chunk_size: {
|
|
434
520
|
type: "number",
|
|
435
521
|
description: "Characters per chunk for document ingestion (default: 4000)"
|
|
@@ -776,6 +862,10 @@ async function handleCommit(client2, args) {
|
|
|
776
862
|
parent_uid,
|
|
777
863
|
decision_uid,
|
|
778
864
|
chosen_option_uid,
|
|
865
|
+
informs_uid,
|
|
866
|
+
as_of_date,
|
|
867
|
+
session_id,
|
|
868
|
+
retrieval_trace_id,
|
|
779
869
|
confidence,
|
|
780
870
|
salience,
|
|
781
871
|
props,
|
|
@@ -823,6 +913,11 @@ async function handleCommit(client2, args) {
|
|
|
823
913
|
return ok(
|
|
824
914
|
await client2.resolveDecision(decision_uid, chosen_option_uid, {
|
|
825
915
|
summary,
|
|
916
|
+
props,
|
|
917
|
+
informs_uid,
|
|
918
|
+
as_of_date,
|
|
919
|
+
session_id,
|
|
920
|
+
retrieval_trace_id,
|
|
826
921
|
agent_id
|
|
827
922
|
})
|
|
828
923
|
);
|
|
@@ -943,11 +1038,17 @@ async function handleRetrieve(client2, args) {
|
|
|
943
1038
|
max_depth,
|
|
944
1039
|
direction,
|
|
945
1040
|
edge_types,
|
|
1041
|
+
exclude_edge_types,
|
|
1042
|
+
include_provenance,
|
|
1043
|
+
max_nodes,
|
|
946
1044
|
node_types,
|
|
947
1045
|
layer,
|
|
948
1046
|
limit,
|
|
1047
|
+
offset,
|
|
949
1048
|
include_chunks,
|
|
950
1049
|
include_graph,
|
|
1050
|
+
graph_expansion_limit,
|
|
1051
|
+
graph_max_depth,
|
|
951
1052
|
confidence_min,
|
|
952
1053
|
salience_min,
|
|
953
1054
|
agent_id
|
|
@@ -962,7 +1063,9 @@ async function handleRetrieve(client2, args) {
|
|
|
962
1063
|
node_types,
|
|
963
1064
|
layer,
|
|
964
1065
|
chunk_limit: include_chunks ? limit ?? 5 : 0,
|
|
965
|
-
include_graph
|
|
1066
|
+
include_graph,
|
|
1067
|
+
graph_expansion_limit: graph_expansion_limit ?? 3,
|
|
1068
|
+
graph_max_depth: graph_max_depth ?? 2
|
|
966
1069
|
})
|
|
967
1070
|
);
|
|
968
1071
|
case "text":
|
|
@@ -1012,6 +1115,14 @@ async function handleRetrieve(client2, args) {
|
|
|
1012
1115
|
return ok(await client2.getPendingApprovals());
|
|
1013
1116
|
case "unresolved_contradictions":
|
|
1014
1117
|
return ok(await client2.getContradictions());
|
|
1118
|
+
case "stale_derivations":
|
|
1119
|
+
return ok(
|
|
1120
|
+
await client2.retrieve({
|
|
1121
|
+
action: "stale_derivations",
|
|
1122
|
+
limit,
|
|
1123
|
+
offset
|
|
1124
|
+
})
|
|
1125
|
+
);
|
|
1015
1126
|
case "preferences":
|
|
1016
1127
|
return ok(
|
|
1017
1128
|
await client2.retrieve({
|
|
@@ -1057,7 +1168,10 @@ async function handleRetrieve(client2, args) {
|
|
|
1057
1168
|
await client2.traverse({
|
|
1058
1169
|
action: "chain",
|
|
1059
1170
|
start_uid,
|
|
1060
|
-
max_depth
|
|
1171
|
+
max_depth,
|
|
1172
|
+
exclude_edge_types,
|
|
1173
|
+
include_provenance,
|
|
1174
|
+
max_nodes
|
|
1061
1175
|
})
|
|
1062
1176
|
);
|
|
1063
1177
|
case "neighborhood":
|
|
@@ -1068,7 +1182,10 @@ async function handleRetrieve(client2, args) {
|
|
|
1068
1182
|
start_uid,
|
|
1069
1183
|
max_depth,
|
|
1070
1184
|
direction,
|
|
1071
|
-
edge_types
|
|
1185
|
+
edge_types,
|
|
1186
|
+
exclude_edge_types,
|
|
1187
|
+
include_provenance,
|
|
1188
|
+
max_nodes
|
|
1072
1189
|
})
|
|
1073
1190
|
);
|
|
1074
1191
|
case "path":
|
|
@@ -1081,7 +1198,10 @@ async function handleRetrieve(client2, args) {
|
|
|
1081
1198
|
end_uid,
|
|
1082
1199
|
max_depth,
|
|
1083
1200
|
direction,
|
|
1084
|
-
edge_types
|
|
1201
|
+
edge_types,
|
|
1202
|
+
exclude_edge_types,
|
|
1203
|
+
include_provenance,
|
|
1204
|
+
max_nodes
|
|
1085
1205
|
})
|
|
1086
1206
|
);
|
|
1087
1207
|
case "subgraph":
|
|
@@ -1092,7 +1212,10 @@ async function handleRetrieve(client2, args) {
|
|
|
1092
1212
|
start_uid,
|
|
1093
1213
|
max_depth,
|
|
1094
1214
|
direction,
|
|
1095
|
-
edge_types
|
|
1215
|
+
edge_types,
|
|
1216
|
+
exclude_edge_types,
|
|
1217
|
+
include_provenance,
|
|
1218
|
+
max_nodes
|
|
1096
1219
|
})
|
|
1097
1220
|
);
|
|
1098
1221
|
default:
|
|
@@ -1100,17 +1223,40 @@ async function handleRetrieve(client2, args) {
|
|
|
1100
1223
|
}
|
|
1101
1224
|
}
|
|
1102
1225
|
async function handleIngest(client2, args) {
|
|
1103
|
-
const {
|
|
1226
|
+
const {
|
|
1227
|
+
action,
|
|
1228
|
+
content,
|
|
1229
|
+
title,
|
|
1230
|
+
source_uri,
|
|
1231
|
+
source,
|
|
1232
|
+
// deprecated alias for source_uri (kept for cached tool schemas)
|
|
1233
|
+
content_type,
|
|
1234
|
+
document_type,
|
|
1235
|
+
layers,
|
|
1236
|
+
ontology_schema_id,
|
|
1237
|
+
participants,
|
|
1238
|
+
occurred_at,
|
|
1239
|
+
context,
|
|
1240
|
+
document_uid,
|
|
1241
|
+
chunk_index,
|
|
1242
|
+
chunk_size,
|
|
1243
|
+
chunk_overlap,
|
|
1244
|
+
job_id,
|
|
1245
|
+
agent_id
|
|
1246
|
+
} = args;
|
|
1247
|
+
const src = source_uri ?? source;
|
|
1104
1248
|
switch (action) {
|
|
1105
1249
|
case "chunk":
|
|
1106
1250
|
if (!content) return err("content is required for chunk ingestion");
|
|
1107
1251
|
return ok(
|
|
1108
1252
|
await client2.ingestChunk({
|
|
1109
1253
|
content,
|
|
1110
|
-
title,
|
|
1111
|
-
|
|
1254
|
+
label: title,
|
|
1255
|
+
document_uid,
|
|
1256
|
+
chunk_index,
|
|
1112
1257
|
layers,
|
|
1113
|
-
agent_id
|
|
1258
|
+
agent_id,
|
|
1259
|
+
ontology_schema_id
|
|
1114
1260
|
})
|
|
1115
1261
|
);
|
|
1116
1262
|
case "document":
|
|
@@ -1119,8 +1265,14 @@ async function handleIngest(client2, args) {
|
|
|
1119
1265
|
await client2.ingestDocument({
|
|
1120
1266
|
content,
|
|
1121
1267
|
title,
|
|
1122
|
-
|
|
1268
|
+
source_uri: src,
|
|
1269
|
+
content_type,
|
|
1270
|
+
document_type,
|
|
1123
1271
|
layers,
|
|
1272
|
+
ontology_schema_id,
|
|
1273
|
+
participants,
|
|
1274
|
+
occurred_at,
|
|
1275
|
+
context,
|
|
1124
1276
|
chunk_size,
|
|
1125
1277
|
chunk_overlap,
|
|
1126
1278
|
agent_id
|
|
@@ -1132,8 +1284,13 @@ async function handleIngest(client2, args) {
|
|
|
1132
1284
|
await client2.ingestSession({
|
|
1133
1285
|
content,
|
|
1134
1286
|
title,
|
|
1135
|
-
source,
|
|
1136
1287
|
layers,
|
|
1288
|
+
ontology_schema_id,
|
|
1289
|
+
participants,
|
|
1290
|
+
occurred_at,
|
|
1291
|
+
context,
|
|
1292
|
+
chunk_size,
|
|
1293
|
+
chunk_overlap,
|
|
1137
1294
|
agent_id
|
|
1138
1295
|
})
|
|
1139
1296
|
);
|
|
@@ -1451,7 +1608,7 @@ Capture knowledge when the user shares something worth remembering:
|
|
|
1451
1608
|
var server = new import_server.Server(
|
|
1452
1609
|
{
|
|
1453
1610
|
name: "mindgraph",
|
|
1454
|
-
version: "0.
|
|
1611
|
+
version: "0.10.0"
|
|
1455
1612
|
},
|
|
1456
1613
|
{
|
|
1457
1614
|
capabilities: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mindgraph-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "MCP server for MindGraph — connect Claude Desktop, Claude Code, and any MCP client to your knowledge graph",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/shuruheel/mindgraph-mcp.git"
|
|
8
|
+
},
|
|
5
9
|
"main": "dist/index.js",
|
|
6
10
|
"types": "dist/index.d.ts",
|
|
7
11
|
"bin": {
|
|
@@ -28,7 +32,7 @@
|
|
|
28
32
|
"license": "MIT",
|
|
29
33
|
"dependencies": {
|
|
30
34
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
31
|
-
"mindgraph": "^0.
|
|
35
|
+
"mindgraph": "^0.12.0"
|
|
32
36
|
},
|
|
33
37
|
"devDependencies": {
|
|
34
38
|
"@types/node": "^22.0.0",
|