@betterdb/memory 0.1.1 → 0.1.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/package.json +1 -1
- package/src/index.ts +12 -15
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -185,21 +185,17 @@ async function runInstall() {
|
|
|
185
185
|
writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n");
|
|
186
186
|
console.log(" Registered 4 hooks in ~/.claude/settings.json");
|
|
187
187
|
|
|
188
|
-
// Register MCP server
|
|
189
|
-
const
|
|
190
|
-
|
|
188
|
+
// Register MCP server globally (-s user) so it's available in all projects
|
|
189
|
+
const mcpBin = join(BIN_DIR, "mcp-server");
|
|
190
|
+
Bun.spawnSync(["claude", "mcp", "remove", "-s", "user", "betterdb-memory"]);
|
|
191
|
+
const mcpResult = Bun.spawnSync([
|
|
192
|
+
"claude", "mcp", "add", "-s", "user", "betterdb-memory", "--", mcpBin,
|
|
193
|
+
]);
|
|
191
194
|
if (mcpResult.exitCode === 0) {
|
|
192
|
-
console.log(" Registered MCP server: betterdb-memory");
|
|
195
|
+
console.log(" Registered MCP server: betterdb-memory (global)");
|
|
193
196
|
} else {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
const retry = Bun.spawnSync(["claude", "mcp", "add-json", "betterdb-memory", mcpConfig]);
|
|
197
|
-
if (retry.exitCode === 0) {
|
|
198
|
-
console.log(" Registered MCP server: betterdb-memory (replaced existing)");
|
|
199
|
-
} else {
|
|
200
|
-
console.log(" WARNING: MCP registration failed — register manually:");
|
|
201
|
-
console.log(` claude mcp add-json betterdb-memory '${mcpConfig}'`);
|
|
202
|
-
}
|
|
197
|
+
console.log(" WARNING: MCP registration failed — register manually:");
|
|
198
|
+
console.log(` claude mcp add -s user betterdb-memory -- ${mcpBin}`);
|
|
203
199
|
}
|
|
204
200
|
|
|
205
201
|
// 5. SETUP VALKEY INDEX
|
|
@@ -285,8 +281,9 @@ async function runUninstall() {
|
|
|
285
281
|
}
|
|
286
282
|
}
|
|
287
283
|
|
|
288
|
-
// Remove MCP server
|
|
289
|
-
|
|
284
|
+
// Remove MCP server (try both user and local scope)
|
|
285
|
+
Bun.spawnSync(["claude", "mcp", "remove", "-s", "local", "betterdb-memory"]);
|
|
286
|
+
const mcpResult = Bun.spawnSync(["claude", "mcp", "remove", "-s", "user", "betterdb-memory"]);
|
|
290
287
|
if (mcpResult.exitCode === 0) {
|
|
291
288
|
console.log(" Removed MCP server: betterdb-memory");
|
|
292
289
|
} else {
|