MCP servers from mcp.json not loaded when CLAUDE_CONFIG_DIR is set

Resolved 💬 5 comments Opened Apr 1, 2026 by kayvee25 Closed Jun 25, 2026

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

  1. Create a separate config directory:

``
cp -r ~/.claude ~/.claude-work
``

  1. Set the env var:

``
export CLAUDE_CONFIG_DIR=~/.claude-work
``

  1. Verify mcp.json exists with valid server definitions:

``
cat ~/.claude-work/mcp.json # has mcpServers with ado, slack, github, etc.
``

  1. Run claude and check /mcponly claude.ai marketplace servers appear
  2. Run unset CLAUDE_CONFIG_DIR && claudeall 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

View original on GitHub ↗

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