Skip to content

install: no way to skip a single agent, so VS Code gets an absolute path written into every profile #1599

Description

@smoochy

What happens

codebase-memory-mcp install detects VS Code as an agent and writes a codebase-memory-mcp stdio entry into the mcp.json of every VS Code profile it finds. On a machine with ten profiles that is ten files, each holding an absolute path to the binary. Measured against 0.10.3 on Windows: two profile files were emptied by hand, install was run once, and it reported an mcp: line per profile and refilled all ten.

Why that is a problem for VS Code specifically

mcp.json is carried between machines by VS Code's Settings Sync, per profile. An absolute Windows path therefore arrives on a Mac, where it names nothing and the server cannot start. This is not a problem for the agents whose config files do not sync.

Since VS Code 1.101 an extension can register an MCP server through vscode.lm.registerMcpServerDefinitionProvider, which is provided in memory at activation and written to no file at all. An extension that does this needs the file entry not to exist - it is a second, absolute-path copy of a server VS Code already has, and the only copy of the two that syncs.

What is missing

install offers --skip-config, which skips config writing for every agent, and there is no way to deselect one. The workaround in smoochy/codebase-memory-mcp-vscode is to run install normally and then delete our own key back out of each mcp.json afterwards - which works, but races anything else writing that file and has to be repeated at every activation.

What would solve it

Any one of:

  • --skip-agent=<name> (repeatable), or
  • --agents=<comma separated list> to opt in explicitly, or
  • an install that leaves VS Code alone when the extension already provides the server - though the CLI has no way to detect that, so a flag is the simpler contract.

Happy to send a PR if you name the spelling you would accept.

Metadata

Metadata

Assignees

No one assigned

    Labels

    editor/integrationEditor compatibility and CLI integrationwindowsWindows-specific issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions