Skip to content

Bug: ClaudecodeMcp.fromFile and fromRulesyncMcp do not pass global flag to constructor #1275

@tmak

Description

@tmak

`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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions