MCP servers in .claude/.mcp.json not loading properly

Open 💬 29 comments Opened Aug 3, 2025 by cameronstewart

MCP Configuration Issue: .claude/.mcp.json Not Loading All Servers

Summary

MCP servers configured in .claude/.mcp.json are not being loaded properly by Claude Code, while the same configuration works correctly when placed in the root directory as .mcp.json.

Environment

  • Claude Code Version: 1.0.67
  • Platform: Linux (WSL2)
  • OS: Linux 6.6.87.2-microsoft-standard-WSL2
  • Working Directory: /mnt/e/CodeProjects/TWC_Meta

Expected Behavior

All MCP servers defined in .claude/.mcp.json should be loaded and available, similar to how they work when the configuration is in the root .mcp.json file.

Actual Behavior

Only one MCP server (snap-happy) loads from .claude/.mcp.json, while other servers (puppeteer, ElevenLabs, xero, microsoft, markitdown) are ignored.

Steps to Reproduce

  1. Create a .claude/.mcp.json file with multiple MCP server configurations:
{
  "mcpServers": {
    "puppeteer": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-puppeteer"],
      "env": {}
    },
    "ElevenLabs": {
      "command": "uvx",
      "args": ["elevenlabs-mcp"],
      "env": {
        "ELEVENLABS_API_KEY": "sk_xxx"
      }
    },
    "snap-happy": {
      "command": "node",
      "args": ["/path/to/snap-happy/dist/index.js"],
      "env": {
        "SNAP_HAPPY_SCREENSHOT_PATH": "/path/to/screenshots"
      }
    }
  }
}
  1. Run claude mcp list
  2. Observe that only snap-happy is loaded
  3. Move the file to root directory as .mcp.json
  4. Run claude mcp list again
  5. Observe that all servers now load correctly

Test Results

With .claude/.mcp.json:

Checking MCP server health...

snap-happy: npx @mariozechner/snap-happy - ✓ Connected

With root .mcp.json:

Checking MCP server health...

puppeteer: npx -y @modelcontextprotocol/server-puppeteer - ✓ Connected
ElevenLabs: uvx elevenlabs-mcp - ✓ Connected
snap-happy: npx @mariozechner/snap-happy - ✓ Connected

Debug Output

When running with --debug, only the snap-happy server shows connection attempts:

[DEBUG] MCP server "snap-happy": Starting connection attempt
[DEBUG] MCP server "snap-happy": Connection attempt completed in 1077ms - status: connected

No debug output appears for other servers, suggesting they're not being read from the configuration file.

Impact

This prevents users from organizing their MCP configurations within the .claude/ directory structure, forcing them to clutter the root directory with configuration files.

Possible Cause

The MCP configuration loader may not be properly reading or processing the .claude/.mcp.json file format, or there may be a path resolution issue when loading servers from this location.

Workaround

Move .mcp.json to the root directory of the project.

View original on GitHub ↗

29 Comments

github-actions[bot] · 11 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/2156
  2. https://github.com/anthropics/claude-code/issues/4938
  3. https://github.com/anthropics/claude-code/issues/1870

If your issue is a duplicate, please close it and 👍 the existing issue instead.

🤖 Generated with Claude Code

t0ddharris · 11 months ago

Same problem - there seem to be too many places where mcp servers are stored in Claude Code. My .claude.json is a giant file with at least two sections of mcp servers - one I had no idea existed and both had mcp servers I thought I had uninstalled.

serpent213 · 11 months ago

Same here. Was working earlier, not sure what broke it – tried various older versions. macOS update to 15.6...?

stavarc · 11 months ago

same issue here, wondering why this isn't already fixed

massdo · 11 months ago

Same issue.

Xpos587 · 10 months ago

Try using:

claude --strict-mcp-config --mcp-config /path/to/.mcp.json
raveenb · 10 months ago
Try using: claude --strict-mcp-config --mcp-config /path/to/.mcp.json

thanks, this was ruining my day :)

michael-airspace · 10 months ago
Try using: claude --strict-mcp-config --mcp-config /path/to/.mcp.json

good tip, but this now only loads from mcp servers from .mcp.json

To get both (seems like it should be the default behavior):

claude --mcp-config /path/to/.mcp.json

now mcps are loaded from local, project, and user scopes.

I am using 1.0.109 (Claude Code)

josh-enfield · 10 months ago

Same

pjaol · 10 months ago

still an issue in

claude -v
1.0.117 (Claude Code)

At least update https://docs.claude.com/en/docs/claude-code/mcp#mcp-installation-scopes
with details to run

claude --mcp-config .mcp.json
ruant · 9 months ago

project scoped mcp file .mcp.json isn't being picked up.
2.0.1 (Claude Code)

PaulRBerg · 9 months ago

Big regression in terms of UI/UX to not load the .mcp.json by default.

Anthropic, please fix this 🙏

jpcaparas · 8 months ago
claude --mcp-config .mcp.json

This did it for me. I don't recall toggling any settings to have that file even ignored to begin with. Interestingly .mcp.json inside a plugin folder does NOT get ignored. only root-level.

jpcaparas · 8 months ago

The annoying thing is that I have to run claude --mcp-config .mcp.json every time.

Was there any indication that they will deprecate .mcp.json? I'm looking at the docs right now and no mention of that.

jpcaparas · 8 months ago

This bash function wrapper should remove the need to do claude --mcp-config .mcp.json each time.

# Claude wrapper that auto-loads a local .mcp.json if present.
claude() {
  local -a extra=()
  local has_mcp=0

  # Detect an existing --mcp-config (both forms).
  for a in "$@"; do
    if [[ "$a" == --mcp-config || "$a" == --mcp-config=* ]]; then
      has_mcp=1
      break
    fi
  done

  # Only inject if a file exists here and user didn't pass their own.
  if [[ -f ./.mcp.json && $has_mcp -eq 0 ]]; then
    extra+=(--mcp-config=./.mcp.json)
  fi

  # Debug: show the final command if env var is set.
  if [[ -n "${CLAUDE_WRAPPER_DEBUG:-}" ]]; then
    printf '→ %q ' claude "${extra[@]}" "$@"; printf '\n'
  fi

  command claude "${extra[@]}" "$@"
}

and the variant with --dangerously-skip-permissions enabled by default:

# Put this in ~/.zshrc or ~/.bashrc, then `source` it.
claude() {
  local -a extra=()
  local has_mcp=0
  local has_skip=0

  # Detect existing flags (both --mcp-config forms; skip-permissions is a simple flag)
  for a in "$@"; do
    case "$a" in
      --mcp-config|--mcp-config=*) has_mcp=1 ;;
      --dangerously-skip-permissions) has_skip=1 ;;
    esac
  done

  # Always add skip-permissions unless the user already provided it
  if [[ $has_skip -eq 0 ]]; then
    extra+=(--dangerously-skip-permissions)
  fi

  # Add project .mcp.json if present and not explicitly supplied
  if [[ -f ./.mcp.json && $has_mcp -eq 0 ]]; then
    extra+=(--mcp-config=./.mcp.json)
  fi

  # Optional: show final command if CLAUDE_WRAPPER_DEBUG=1
  if [[ -n "${CLAUDE_WRAPPER_DEBUG:-}" ]]; then
    printf '→ %q ' claude "${extra[@]}" "$@"; printf '\n'
  fi

  command claude "${extra[@]}" "$@"
}
danielrosehill · 8 months ago

Experiencing this

Zain-ul-din · 7 months ago

Any new update?

I'm using Ubuntu

neomaitre · 7 months ago

I am also experiencing this issue, even MCP Servers defined at User Scope are no longer working.

waterscar · 7 months ago

Wanted to add my cases with the latest version 2.0.53

Now Claude Code complains about the file not being valid, meanwhile, with --mcp-config .mcp.json it does read the server in

> /mcp 

MCP Config Diagnostics

For help configuring MCP servers, see: https://docs.claude.com/en/docs/claude-code/mcp

[Failed to parse] Project config (shared via .mcp.json)
Location: /Users/<my-foler>/.mcp.json
 └ [Error] MCP config is not a valid JSON

.mcp.json looks like this

{
	"mcpServers": {
		"svelte-llm": {
			"type": "http",
			"url": "https://mcp.svelte.dev/mcp"
		},
		"context7": {
			"type": "http",
			"url": "https://mcp.context7.com/mcp"
		}
	}
}
webern · 7 months ago

I love claude code, but I just came here because I have to say. Configuring claude is an absolute morass of config files located in different places being merged and ignored in mysterious ways. Claude code itself can't make sense of it and help the user figure out what's wrong. It just told me this:

So the mcpServers in your ~/.claude/settings.json does nothing. It's dead config that Claude Code ignores.

If that's actually true, which I sort of doubt, then I would love to be able to run claude in a stricter mode in which it would error out on extraneous/unrecognized keys in configuration files.

(Edit: looks like someone just said this above claude --strict-mcp-config, which I will try)

Configuring MCP servers is an absolutely disastrous user experience. It's literally almost impossible to do because the configuration files are such a mess.

Edit: Furthermore: my MCP configurations are something I would like to keep under source control with my dot files, so now I'm keeping ~/.claude.json under source control and I discover that this is not a configuration file at all, it's state file that changes every time run claude. 🤦 . So we have a piece of configuration, mcpServers, that is for some reason stored in the state file instead of with the rest of the user configuration.

jimweller · 7 months ago
Edit: Furthermore: my MCP configurations are something I would like to keep under source control with my dot files, so now I'm keeping ~/.claude.json under source control and I discover that this is not a configuration file at all, it's state file that changes every time run claude. 🤦 . So we have a piece of configuration, mcpServers, that is for some reason stored in the state file instead of with the rest of the user configuration.

+100

jimweller · 7 months ago

settings.local.json seems to be needed to enabled project local mcp
https://github.com/anthropics/claude-code/issues/3321#issuecomment-3656211741

PaulRBerg · 7 months ago
Furthermore: my MCP configurations are something I would like to keep under source control with my dot files

💯

The fact that it's ~/.claude.json which manages MCPs is abhorring, dead-in-the-water UX.

Noticing that Anthropic doesn't seem to care about this issue (unfortunately), or they have competing priorities, I've started using gemini as my go-to-AI-agent for MCP management.

d3lm · 6 months ago

You have to put the .mcp.json inside the project root next to the .claude folder and not inside the .claude folder.

jpcaparas · 6 months ago

Yeah previous versions of Claude Code didn't respect a root .mcp.json either.

github-actions[bot] · 5 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

gabiudrescu · 4 months ago

still experiencing this issue :(

Kenya-West · 4 months ago
claude --strict-mcp-config --mcp-config /path/to/.mcp.json

It does not work, Claude Code CLI VS Code extension does not see the MCPs defined there, though Claude Code CLI for Windows does.

alessandro-amos · 3 months ago

Not sure if this helps, but in my case the issue was an invalid JSON , there was a trailing comma at the end of the file.

For example:

Invalid:
{
"key": "value",
}

Valid:
{
"key": "value"
}