• AgentArmor teamTeam3d agoNeeds helpSolved

    How do I stop Claude Code from auto-loading claude.ai MCP connectors into CLI sessions?

    Claude Code (2.1.x) on Linux is automatically loading MCP servers that were connected through the Claude.ai web account, showing up as "claude.ai " in claude mcp list. These duplicate local servers, add context overhead, and on a low-memory Raspberry Pi 5 contributed to OOM kills. Users cannot remove them with claude mcp remove and want a persistent opt-out.

    Originally asked on GitHub: https://github.com/anthropics/claude-code/issues/20412

    7 answers

    • Best answerAgentArmor teamTeam3d ago

      The thread does not show an official fix or setting. The issue was closed as COMPLETED, but commenters report no user-facing opt-out at the time. Commenters describe several mitigations that reduce the impact.

      Workarounds reported in the thread:

      1. Per-project disable with a SessionStart hook. A commenter wrote a script that reads the working directory from the hook input and adds the unwanted connector names (for example "claude.ai Figma") to .projects[cwd].disabledMcpServers in ~/.claude.json using jq. It is registered in ~/.claude/settings.json under hooks.SessionStart with matcher "startup". This needs jq installed and does not stop the connectors from syncing.

      2. Feature flag override. Setting cachedGrowthBookFeatures.tengu_claudeai_mcp_connectors to false in ~/.claude.json reportedly helped some users, but the flag is refreshed on login and on startup, so it may be overwritten.

      3. ENABLE_TOOL_SEARCH=true keeps the tool schemas out of context until needed. This reduces context cost but does not remove the servers.

      4. For a clean session with no MCP servers at all: claude --strict-mcp-config --mcp-config '{}'. This also disables your local servers.

      General advice: check claude mcp list and /mcp after upgrades to confirm which servers are active.

      Security note: remote connectors may carry permissions from a different account, so review which ones are loaded in shared or work projects.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What a GitHub user tried on GitHub (Partly worked)

      Reporter edited ~/.claude.json to set cachedGrowthBookFeatures.tengu_claudeai_mcp_connectors to false, and tried claude mcp remove "claude.ai PayPal", which returned No MCP server found.

      Source: https://github.com/anthropics/claude-code/issues/20412 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @mpenza tried on GitHub (Worked)

      Added a SessionStart hook script that uses jq to append unwanted claude.ai connector names to disabledMcpServers for the current project in ~/.claude.json, registered under hooks.SessionStart with matcher startup.

      Source: https://github.com/anthropics/claude-code/issues/20412#issuecomment-3862058782 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @jamie-tm tried on GitHub (Partly worked)

      Set ENABLE_TOOL_SEARCH=true so MCP tools are loaded only when needed, reducing context overhead, though the servers are still synced.

      Source: https://github.com/anthropics/claude-code/issues/20412#issuecomment-3900209686 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @jamie-tm tried on GitHub (Partly worked)

      Patched tengu_claudeai_mcp_connectors back to false in ~/.claude.json, which reportedly worked at least temporarily.

      Source: https://github.com/anthropics/claude-code/issues/20412#issuecomment-3900209686 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @gwpl tried on GitHub (Worked)

      Ran claude --strict-mcp-config --mcp-config '{}' to start a session with no MCP servers, including cloud connectors.

      Source: https://github.com/anthropics/claude-code/issues/20412#issuecomment-3922793618 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @mattheworiordan tried on GitHub (Partly worked)

      Ran a file watcher that re-patches tengu_claudeai_mcp_connectors to false after each re-auth, since the flag gets overwritten.

      Source: https://github.com/anthropics/claude-code/issues/20412#issuecomment-3914922171 (opens external site)

      Did this work for you?

    Add your answer or comment