Desktop: No way to prevent built-in MCP servers from being injected into Code tab sessions

Status Fixed / completed
Reported on v2.1.78
Maintainer reply None cached
Activity 4 comments · opened Mar 22, 2026 · closed Mar 22, 2026

Bug

Built-in MCP servers (Claude in Chrome, Claude Preview, mcp-registry, scheduled-tasks) are unconditionally injected into every Code tab session via --mcp-config. There is no mechanism to prevent this — not through Desktop preferences, settings.json, ~/.claude.json, nor any CLI flag.

Impact

The model sees tools from servers the user doesn't want (e.g. mcp__Claude_in_Chrome__*), wastes turns attempting to call them, and there is no way to remove them from the tool list.

Root cause

In the Desktop Electron app, internal MCP servers are registered unconditionally at startup:

// Fpt() — called at app startup, no conditional
function Fpt() {
    const t = yR();
    const e = Idt(t);
    IM(Mx, Opt, () => e);  // always registers
}

Px() (which lists internal servers) returns all registered servers with no filtering. createAllServers() creates proxy servers for all of them and passes them to the CLI via --mcp-config.

The chromeExtensionEnabled Desktop preference only sets an isDisabled callback on the server config object:

isDisabled: () => !Fr("chromeExtensionEnabled")

This callback is not checked before registration or injection. The server's tools are still advertised to the model regardless of this flag.

Expected behavior

When a user disables a built-in MCP server in Desktop preferences, its tools should not appear in the model's tool list. Either:

  1. Check isDisabled() before including the server in Px() / createAllServers(), or
  2. Add a settings.json key (e.g. disabledInternalServers: ["Claude in Chrome"]) that the Desktop respects when constructing --mcp-config, or
  3. Have the CLI's existing disabledMcpServers mechanism apply to --mcp-config SDK servers too

Reproduction

  1. Open Claude Desktop → Settings → disable Chrome extension
  2. Start a Code tab session
  3. Observe --mcp-config in the CLI process args still contains "Claude in Chrome": {"type":"sdk","name":"Claude in Chrome"}
  4. The model sees and attempts to use mcp__Claude_in_Chrome__* tools

Environment

  • Claude Desktop (macOS)
  • Claude Code 2.1.78 / 2.1.81

View original on GitHub ↗

4 Comments

Asher- · 6 months ago

Additionally: even if the server injection is fixed, the broader request is support for disallowedTools that applies to everything — not just MCP servers, but all built-in tools. Users should be able to disable any default tool via settings.json (WebFetch, WebSearch, Bash, etc.) and replace it with custom MCP-provided alternatives, without the model seeing or attempting to call the originals.

Currently disallowedTools in settings.json has no effect on SDK-type servers passed via --mcp-config, and there is no mechanism to suppress built-in tools at all. Fine-grained control over the full tool list is needed.

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/36868
  2. https://github.com/anthropics/claude-code/issues/20412
  3. https://github.com/anthropics/claude-code/issues/31339

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

Asher- · 6 months ago

Duplicate of #36868. Added comment there requesting disallowedTools support for built-in tools.

github-actions[bot] · 6 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.