mindgraph-mcp 0.14.3 → 0.14.4
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 +8 -2
- package/dist/cli.js +34 -18
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -151,8 +151,14 @@ mindgraph-mcp uninstall-hooks Remove MindGraph-owned hook entries
|
|
|
151
151
|
mindgraph-mcp status Show installation status
|
|
152
152
|
```
|
|
153
153
|
|
|
154
|
-
Options: `--api-key <key>`, `--base-url <url>`, `--
|
|
155
|
-
`--project-dir <dir>`, `--harness <name>`, `--help`.
|
|
154
|
+
Options: `--api-key <key>`, `--base-url <url>`, `--agent-id <id>`,
|
|
155
|
+
`--scope user|project`, `--project-dir <dir>`, `--harness <name>`, `--help`.
|
|
156
|
+
|
|
157
|
+
**Teams**: when several people share one org graph, give each member a
|
|
158
|
+
distinct identity — `--agent-id claude-code:<name>` on `install-code` /
|
|
159
|
+
`install-hooks`. Anchored knowledge is shared automatically; distinct agent
|
|
160
|
+
ids keep task leases and resume briefs per-person (identical ids make
|
|
161
|
+
teammates one logical agent, which claims each other's work).
|
|
156
162
|
|
|
157
163
|
## Environment
|
|
158
164
|
|
package/dist/cli.js
CHANGED
|
@@ -4893,7 +4893,7 @@ Capture knowledge when the user shares something worth remembering:
|
|
|
4893
4893
|
server = new import_server.Server(
|
|
4894
4894
|
{
|
|
4895
4895
|
name: "mindgraph",
|
|
4896
|
-
version: "0.14.
|
|
4896
|
+
version: "0.14.4"
|
|
4897
4897
|
},
|
|
4898
4898
|
{
|
|
4899
4899
|
capabilities: {
|
|
@@ -5131,7 +5131,8 @@ function loadHookEnv(dir) {
|
|
|
5131
5131
|
const parsed = JSON.parse(raw);
|
|
5132
5132
|
return {
|
|
5133
5133
|
baseUrl: typeof parsed.baseUrl === "string" ? parsed.baseUrl : void 0,
|
|
5134
|
-
apiKey: typeof parsed.apiKey === "string" ? parsed.apiKey : void 0
|
|
5134
|
+
apiKey: typeof parsed.apiKey === "string" ? parsed.apiKey : void 0,
|
|
5135
|
+
agentId: typeof parsed.agentId === "string" ? parsed.agentId : void 0
|
|
5135
5136
|
};
|
|
5136
5137
|
} catch {
|
|
5137
5138
|
return {};
|
|
@@ -5143,7 +5144,8 @@ function saveHookEnv(env, dir) {
|
|
|
5143
5144
|
const existing = loadHookEnv(dir);
|
|
5144
5145
|
const merged = {
|
|
5145
5146
|
baseUrl: env.baseUrl ?? existing.baseUrl,
|
|
5146
|
-
apiKey: env.apiKey ?? existing.apiKey
|
|
5147
|
+
apiKey: env.apiKey ?? existing.apiKey,
|
|
5148
|
+
agentId: env.agentId ?? existing.agentId
|
|
5147
5149
|
};
|
|
5148
5150
|
import_node_fs.default.writeFileSync(file, `${JSON.stringify(merged, null, 2)}
|
|
5149
5151
|
`, {
|
|
@@ -5163,6 +5165,7 @@ function parseArgs(argv) {
|
|
|
5163
5165
|
let projectDir;
|
|
5164
5166
|
let harness;
|
|
5165
5167
|
let hooks = false;
|
|
5168
|
+
let agentId = process.env.MINDGRAPH_AGENT_ID;
|
|
5166
5169
|
for (let i = 0; i < args.length; i++) {
|
|
5167
5170
|
const arg = args[i];
|
|
5168
5171
|
switch (arg) {
|
|
@@ -5186,6 +5189,9 @@ function parseArgs(argv) {
|
|
|
5186
5189
|
case "--harness":
|
|
5187
5190
|
harness = args[++i];
|
|
5188
5191
|
break;
|
|
5192
|
+
case "--agent-id":
|
|
5193
|
+
agentId = args[++i];
|
|
5194
|
+
break;
|
|
5189
5195
|
case "--hooks":
|
|
5190
5196
|
hooks = true;
|
|
5191
5197
|
break;
|
|
@@ -5203,7 +5209,7 @@ function parseArgs(argv) {
|
|
|
5203
5209
|
break;
|
|
5204
5210
|
}
|
|
5205
5211
|
}
|
|
5206
|
-
return { command, apiKey, baseUrl, scope, projectDir, harness, hooks };
|
|
5212
|
+
return { command, apiKey, baseUrl, scope, projectDir, harness, hooks, agentId };
|
|
5207
5213
|
}
|
|
5208
5214
|
function mcpAddFailureOutput(e) {
|
|
5209
5215
|
const err5 = e;
|
|
@@ -5848,7 +5854,7 @@ function installClaudeDesktop(apiKey, baseUrl) {
|
|
|
5848
5854
|
}
|
|
5849
5855
|
console.log("Restart Claude Desktop to activate.");
|
|
5850
5856
|
}
|
|
5851
|
-
function installClaudeCode(apiKey, baseUrl) {
|
|
5857
|
+
function installClaudeCode(apiKey, baseUrl, agentId) {
|
|
5852
5858
|
const envArgs = [
|
|
5853
5859
|
`--env`,
|
|
5854
5860
|
`MINDGRAPH_API_KEY=${apiKey}`,
|
|
@@ -5857,7 +5863,7 @@ function installClaudeCode(apiKey, baseUrl) {
|
|
|
5857
5863
|
"--env",
|
|
5858
5864
|
"MINDGRAPH_HARNESS=claude-code",
|
|
5859
5865
|
"--env",
|
|
5860
|
-
"
|
|
5866
|
+
`MINDGRAPH_AGENT_ID=${agentId || "claude-code"}`
|
|
5861
5867
|
];
|
|
5862
5868
|
if (baseUrl) {
|
|
5863
5869
|
envArgs.push("--env", `MINDGRAPH_BASE_URL=${baseUrl}`);
|
|
@@ -5951,7 +5957,7 @@ function printStatus() {
|
|
|
5951
5957
|
function withHooksFlag() {
|
|
5952
5958
|
return process.argv.includes("--hooks");
|
|
5953
5959
|
}
|
|
5954
|
-
function finishCodeInstall(apiKey, baseUrl, withHooks) {
|
|
5960
|
+
function finishCodeInstall(apiKey, baseUrl, withHooks, agentId) {
|
|
5955
5961
|
if (withHooks) {
|
|
5956
5962
|
const runner = installHookRunner(__filename);
|
|
5957
5963
|
console.log(`Installed pinned hook runner at ${runner}`);
|
|
@@ -5959,7 +5965,7 @@ function finishCodeInstall(apiKey, baseUrl, withHooks) {
|
|
|
5959
5965
|
console.log(
|
|
5960
5966
|
`Installed ${result.added} and refreshed ${result.updated} MindGraph Claude Code hook entries in ${result.path}`
|
|
5961
5967
|
);
|
|
5962
|
-
const envPath = saveHookEnv({ apiKey, baseUrl });
|
|
5968
|
+
const envPath = saveHookEnv({ apiKey, baseUrl, agentId });
|
|
5963
5969
|
console.log(`Saved hook connection settings to ${envPath} (mode 600)`);
|
|
5964
5970
|
} else {
|
|
5965
5971
|
console.log(
|
|
@@ -6111,13 +6117,23 @@ async function interactiveInit(baseUrl) {
|
|
|
6111
6117
|
installClaudeDesktop(apiKey, baseUrl);
|
|
6112
6118
|
break;
|
|
6113
6119
|
case "2":
|
|
6114
|
-
installClaudeCode(apiKey, baseUrl);
|
|
6115
|
-
finishCodeInstall(
|
|
6120
|
+
installClaudeCode(apiKey, baseUrl, process.env.MINDGRAPH_AGENT_ID);
|
|
6121
|
+
finishCodeInstall(
|
|
6122
|
+
apiKey,
|
|
6123
|
+
baseUrl,
|
|
6124
|
+
withHooksFlag(),
|
|
6125
|
+
process.env.MINDGRAPH_AGENT_ID
|
|
6126
|
+
);
|
|
6116
6127
|
break;
|
|
6117
6128
|
case "3":
|
|
6118
6129
|
installClaudeDesktop(apiKey, baseUrl);
|
|
6119
|
-
installClaudeCode(apiKey, baseUrl);
|
|
6120
|
-
finishCodeInstall(
|
|
6130
|
+
installClaudeCode(apiKey, baseUrl, process.env.MINDGRAPH_AGENT_ID);
|
|
6131
|
+
finishCodeInstall(
|
|
6132
|
+
apiKey,
|
|
6133
|
+
baseUrl,
|
|
6134
|
+
withHooksFlag(),
|
|
6135
|
+
process.env.MINDGRAPH_AGENT_ID
|
|
6136
|
+
);
|
|
6121
6137
|
break;
|
|
6122
6138
|
default:
|
|
6123
6139
|
console.error("Invalid choice.");
|
|
@@ -6126,7 +6142,7 @@ async function interactiveInit(baseUrl) {
|
|
|
6126
6142
|
console.log("\nDone! Your knowledge graph is now connected.");
|
|
6127
6143
|
}
|
|
6128
6144
|
async function main2() {
|
|
6129
|
-
const { command, apiKey, baseUrl, scope, projectDir, harness, hooks } = parseArgs(process.argv);
|
|
6145
|
+
const { command, apiKey, baseUrl, scope, projectDir, harness, hooks, agentId } = parseArgs(process.argv);
|
|
6130
6146
|
switch (command) {
|
|
6131
6147
|
case "help":
|
|
6132
6148
|
printUsage();
|
|
@@ -6150,8 +6166,8 @@ async function main2() {
|
|
|
6150
6166
|
);
|
|
6151
6167
|
process.exit(1);
|
|
6152
6168
|
}
|
|
6153
|
-
installClaudeCode(apiKey, baseUrl);
|
|
6154
|
-
finishCodeInstall(apiKey, baseUrl, withHooksFlag());
|
|
6169
|
+
installClaudeCode(apiKey, baseUrl, agentId);
|
|
6170
|
+
finishCodeInstall(apiKey, baseUrl, withHooksFlag(), agentId);
|
|
6155
6171
|
break;
|
|
6156
6172
|
case "uninstall":
|
|
6157
6173
|
uninstallClaudeDesktop();
|
|
@@ -6169,8 +6185,8 @@ async function main2() {
|
|
|
6169
6185
|
console.log(
|
|
6170
6186
|
`Installed ${result.added} and refreshed ${result.updated} MindGraph Claude Code hook entries in ${result.path}`
|
|
6171
6187
|
);
|
|
6172
|
-
if (apiKey || baseUrl) {
|
|
6173
|
-
const envPath = saveHookEnv({ apiKey, baseUrl });
|
|
6188
|
+
if (apiKey || baseUrl || agentId) {
|
|
6189
|
+
const envPath = saveHookEnv({ apiKey, baseUrl, agentId });
|
|
6174
6190
|
console.log(`Saved hook connection settings to ${envPath} (mode 600)`);
|
|
6175
6191
|
} else {
|
|
6176
6192
|
console.log(
|
|
@@ -6208,7 +6224,7 @@ async function main2() {
|
|
|
6208
6224
|
telemetrySurface: "mcp"
|
|
6209
6225
|
});
|
|
6210
6226
|
const output = await runClaudeHook(input, client2, {
|
|
6211
|
-
agentId: process.env.MINDGRAPH_AGENT_ID || "claude-code"
|
|
6227
|
+
agentId: process.env.MINDGRAPH_AGENT_ID || stored.agentId || "claude-code"
|
|
6212
6228
|
});
|
|
6213
6229
|
process.stdout.write(`${JSON.stringify(output)}
|
|
6214
6230
|
`);
|
package/dist/index.js
CHANGED