`ClaudecodeMcp.fromFile()` and `ClaudecodeMcp.fromRulesyncMcp()` both accept a `global` parameter and use it to resolve paths via `getSettablePaths({ global })`, but neither passes it through to the `ClaudecodeMcp` constructor.
This means instances created by these factory methods always have `this.global = false` (the default), causing `isDeletable()` to incorrectly return `true` even in global mode. In global mode, `~/.claude/.claude.json` may contain other user settings and should not be deleted.
// src/features/mcp/claudecode-mcp.ts (lines 61–67)
return new ClaudecodeMcp({
baseDir,
relativeDirPath: paths.relativeDirPath,
relativeFilePath: paths.relativeFilePath,
fileContent: JSON.stringify(newJson, null, 2),
validate,
// missing: global,
});
The same issue exists in fromRulesyncMcp (lines 86–92).
For reference, CursorMcp (added in #1273) correctly passes global in both factory methods.
Fix: Add global to the constructor argument object in both fromFile and fromRulesyncMcp.
`ClaudecodeMcp.fromFile()` and `ClaudecodeMcp.fromRulesyncMcp()` both accept a `global` parameter and use it to resolve paths via `getSettablePaths({ global })`, but neither passes it through to the `ClaudecodeMcp` constructor.
This means instances created by these factory methods always have `this.global = false` (the default), causing `isDeletable()` to incorrectly return `true` even in global mode. In global mode, `~/.claude/.claude.json` may contain other user settings and should not be deleted.
The same issue exists in
fromRulesyncMcp(lines 86–92).For reference,
CursorMcp(added in #1273) correctly passesglobalin both factory methods.Fix: Add
globalto the constructor argument object in bothfromFileandfromRulesyncMcp.