Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

Fix mcp remove hanging: add -s user scope flag

Martin Vogelc4449d15f129
diff --git a/cmd/codebase-memory-mcp/install.go b/cmd/codebase-memory-mcp/install.go
index 7a65ab214..7a485b6dd 100644
--- a/cmd/codebase-memory-mcp/install.go
+++ b/cmd/codebase-memory-mcp/install.go
@@ -240,11 +240,11 @@ func installSkills(cfg installConfig) {
// registerClaudeCodeMCP registers the MCP server with Claude Code CLI.
func registerClaudeCodeMCP(binaryPath, claudePath string, cfg installConfig) {
if cfg.dryRun {
- fmt.Printf(" [dry-run] Would run: %s mcp remove codebase-memory-mcp\n", claudePath)
+ fmt.Printf(" [dry-run] Would run: %s mcp remove -s user codebase-memory-mcp\n", claudePath)
fmt.Printf(" [dry-run] Would run: %s mcp add --scope user codebase-memory-mcp -- %s\n", claudePath, binaryPath)
} else {
// Silent remove (may fail if not registered — that's fine)
- _ = execCLI(claudePath, "mcp", "remove", "codebase-memory-mcp")
+ _ = execCLI(claudePath, "mcp", "remove", "-s", "user", "codebase-memory-mcp")
if err := execCLI(claudePath, "mcp", "add", "--scope", "user", "codebase-memory-mcp", "--", binaryPath); err != nil {
fmt.Printf(" ⚠ MCP registration failed: %v\n", err)
} else {
@@ -321,9 +321,9 @@ func removeClaudeSkills(cfg installConfig) {
// deregisterMCP removes the MCP server registration from a CLI.
func deregisterMCP(cliPath, cliName string, cfg installConfig) {
if cfg.dryRun {
- fmt.Printf(" [dry-run] Would run: %s mcp remove codebase-memory-mcp\n", cliPath)
+ fmt.Printf(" [dry-run] Would run: %s mcp remove -s user codebase-memory-mcp\n", cliPath)
} else {
- if err := execCLI(cliPath, "mcp", "remove", "codebase-memory-mcp"); err != nil {
+ if err := execCLI(cliPath, "mcp", "remove", "-s", "user", "codebase-memory-mcp"); err != nil {
fmt.Printf(" ⚠ %s MCP deregistration: %v\n", cliName, err)
} else {
fmt.Printf(" ✓ %s MCP server deregistered\n", cliName)