[BUG] MCP servers defined in global.json are not applied to projects

Status Fixed / completed
Maintainer reply ✓ Yes — ashwin-ant
Activity 6 comments · opened Mar 15, 2025 · closed Mar 17, 2025
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

Description

Global MCP servers configured in ~/.claude-code/mcp/global.json are not being detected or applied to projects automatically. This defeats the purpose of having global configuration.

Steps to reproduce

  1. Configure MCP servers in ~/.claude-code/mcp/global.json under the "mcpServers" key
  2. Open Claude Code in a project directory
  3. Run claude mcp list - no servers are shown despite being in global config
  4. Manually adding servers with claude mcp add-json works as a workaround

Expected behavior

MCP servers defined in the global config should be automatically available to all projects without requiring per-project configuration.

Environment

Using Claude Code CLI with globally configured MCP servers in ~/.claude-code/mcp/global.json

Configuration reference (API keys redacted)

{
  "brave-search": {
    "command": "npx",
    "args": [
      "-y",
      "@modelcontextprotocol/server-brave-search"
    ],
    "env": {
      "BRAVE_API_KEY": "API_KEY_REDACTED"
    }
  },
  "puppeteer": {
    "command": "npx",
    "args": [
      "-y",
      "@modelcontextprotocol/server-puppeteer"
    ]
  }
}

This is from the mcpServers field in global.json.

Workaround applied

As a workaround, we were able to add the MCP servers to the project-specific configuration using:

claude mcp add-json brave-search "$(cat ~/.claude-code/mcp/global.json | jq '.mcpServers."brave-search"')"
claude mcp add-json puppeteer "$(cat ~/.claude-code/mcp/global.json | jq '.mcpServers.puppeteer')"

After running these commands, claude mcp list properly showed both servers as configured.

View original on GitHub ↗

6 Comments

ashwin-ant collaborator · 1 year ago

~/.claude-code/mcp/global.json is not a supported file path for defining MCP servers, so this wouldn't work. To add a global server, you can use one of the add commands and specify --scope global. For example, either claude mcp add --scope global ... or claude mcp add-json --scope global .... You can also just do claude mcp add and go through the wizard flow.

I'm curious, where did you see ~/.claude-code/mcp.global.json?

sedghi · 1 year ago

@ashwin-ant, I'm finding it pretty hard to interact with the add command. Could you point me to the JSON file that stores global MCP servers? I'm not interested in local or project-based servers, just the global ones. I don't see any json file in the ~/.claude

!Image

and settings.json does not have this info either

amxv · 1 year ago

For anyone looking for the json location where claude code stores global (now called "user scoped") MCP servers today, it's in ~/.claude.json

duquesnay · 1 year ago

You just saved me after 2 hours of pulling my hairs. somehow ~/.claude/mcp.json is referenced left and right

aaronlippold · 1 year ago

It takes a village :-)

--------
Aaron Lippold

@.***

260-255-4779

twitter/aim/yahoo,etc.
'aaronlippold'

On Tue, Jul 8, 2025 at 06:43 Guillaume Duquesnay @.***>
wrote:

duquesnay left a comment (anthropics/claude-code#515) <https://github.com/anthropics/claude-code/issues/515#issuecomment-3048361991> You just saved me after 2 hours of pulling my hairs. somehow ~/.claude/mcp.json is referenced left and right — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/515#issuecomment-3048361991>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AALK42DVFJ5DIABNFWWHRRD3HOOE5AVCNFSM6AAAAABZCTWVZGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTANBYGM3DCOJZGE> . You are receiving this because you authored the thread.Message ID: @.***>
github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.