MCP servers from mcp.json not loaded when CLAUDE_CONFIG_DIR is set
Description
When CLAUDE_CONFIG_DIR is set to a custom path (e.g., ~/.claude-work), Claude Code does not load MCP servers from mcp.json in that directory — or from any other location. Only claude.ai marketplace MCPs appear in /mcp.
Unsetting CLAUDE_CONFIG_DIR and running claude from the same directory immediately loads all MCP servers correctly from ~/.claude/mcp.json.
Steps to Reproduce
- Create a separate config directory:
````
cp -r ~/.claude ~/.claude-work
- Set the env var:
````
export CLAUDE_CONFIG_DIR=~/.claude-work
- Verify
mcp.jsonexists with valid server definitions:
````
cat ~/.claude-work/mcp.json # has mcpServers with ado, slack, github, etc.
- Run
claudeand check/mcp— onlyclaude.aimarketplace servers appear - Run
unset CLAUDE_CONFIG_DIR && claude— all MCP servers load correctly
Locations tested
All of these were tried with CLAUDE_CONFIG_DIR set — none worked:
| Location | Result |
|---|---|
| $CLAUDE_CONFIG_DIR/mcp.json | Not loaded |
| ~/.claude/mcp.json | Not loaded |
| $PROJECT_ROOT/.mcp.json | Not loaded |
| $PROJECT_ROOT/.claude/mcp.json | Not loaded |
| mcpServers key in $CLAUDE_CONFIG_DIR/.claude.json | Not loaded |
Same files load fine when CLAUDE_CONFIG_DIR is unset.
Use case
Using CLAUDE_CONFIG_DIR to run separate work and personal Claude accounts in parallel (different OAuth accounts in .claude.json). This is a widely documented pattern and there's even a dedicated tool for it (claude-code-profiles) — all of which are affected by this bug.
Environment
- Claude Code: 2.1.89
- macOS Darwin 25.2.0 (arm64)
- Shell: zsh
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗