[BUG] User-level MCP servers don't load in worktree sessions
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
- Add an MCP server to
~/.claude/settings.json:
{
"mcpServers": {
"rescuetime": {
"command": "fastmcp",
"args": ["run", "/path/to/server.py"],
"env": { "API_KEY": "..." }
}
}
}
- Start a regular Claude Code session in a repo -- MCP tools appear in deferred tools list. Works.
- Start a worktree session:
claude -w my-worktree(or enter an existing worktree) - MCP tools do NOT appear.
ToolSearchreturns no matches for the server name. - The server binary runs fine when tested manually from the worktree directory (
fastmcp run server.pystarts 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 -wor manually viagit worktree add - FastMCP 3.2.3 (also reproduced with a
uv runbased 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.
Showing cached comments. Read the full discussion on GitHub ↗
7 Comments
Found 1 possible duplicate issue:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Not a duplicate. #38914 is about user-level permissions not inheriting in worktree sessions; this issue is about user-level MCP servers silently failing to connect. Same root cause (worktree config inheritance), but different subsystem and different fix surface. Linking as related.
Is this still not fixed? Worktrees are incredibly important and not being able to use MCPs within Worktrees is crippling to the harness' functionality.
+1 on this, I'm likely having the same issue with the laravel-boost MCP.
works without a
-w <worktree>flag:doesn't work with a
-w <worktree>flag:``
``❯ /mcp
⎿ Failed to reconnect to laravel-boost: -32000
+1 this is super disruptive
3 months and no update to this issue? Has this even been confirmed as a bug and added to an action list?
I think I'm hitting this too, incredibly annoying.