[BUG] User-level MCP servers don't load in worktree sessions

Open 💬 6 comments Opened Apr 14, 2026 by adelaidasofia

Description

MCP servers configured in ~/.claude/settings.json (user-level) do not load when Claude Code is running inside a git worktree (e.g., claude -w <worktree>). The servers start fine when tested manually and work in regular (non-worktree) sessions.

Steps to Reproduce

  1. Add an MCP server to ~/.claude/settings.json:
{
  "mcpServers": {
    "rescuetime": {
      "command": "fastmcp",
      "args": ["run", "/path/to/server.py"],
      "env": { "API_KEY": "..." }
    }
  }
}
  1. Start a regular Claude Code session in a repo -- MCP tools appear in deferred tools list. Works.
  2. Start a worktree session: claude -w my-worktree (or enter an existing worktree)
  3. MCP tools do NOT appear. ToolSearch returns no matches for the server name.
  4. The server binary runs fine when tested manually from the worktree directory (fastmcp run server.py starts without error).

Expected Behavior

User-level MCP servers from ~/.claude/settings.json should load regardless of whether the session is in a worktree or the main working tree.

Actual Behavior

MCP servers silently fail to connect in worktree sessions. No error is shown. The tools simply don't appear.

Environment

  • Claude Code version: latest (April 2026)
  • macOS (Darwin 25.4.0, arm64)
  • Git worktrees created via claude -w or manually via git worktree add
  • FastMCP 3.2.3 (also reproduced with a uv run based community MCP server)

Additional Context

This is related to a known pattern where worktree sessions also silently skip UserPromptSubmit hooks. It appears worktree sessions may not fully inherit user-level configuration. Project-level settings (.claude/settings.local.json) ARE read, but user-level MCP servers are not connected.

Workaround: duplicate the MCP config into the project-level .claude/settings.local.json, but this is fragile and requires manual sync.

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗