[BUG] .mcp.json is not read
Resolved 💬 28 comments Opened Jul 11, 2025 by bradleyjames Closed Feb 14, 2026
💡 Likely answer: A maintainer (ollie-anthropic, collaborator)
responded on this thread — see the highlighted reply below.
Environment
- Platform (select one):
- [X] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 1.0.48
- Operating System: macOS 15.5
- Terminal: Terminal App
Bug Description
The MCP documentation refers to configuration in a .mcp.json file (https://docs.anthropic.com/en/docs/claude-code/mcp#environment-variable-expansion-in-mcp-json). I've used MCP config in ~/.claude.json for user level configuration but I can't get Claude Code to read from a .mcp.json file at the user level. I've tried it at ~/.mcp.json, ~/.claude/.mcp.json and ~/.claude/mcp.json. None of these have been picked up by Claude.
My MCP file content is:
{
"mcpServers": {
"gitlab": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@zereight/mcp-gitlab"
],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "${GITLAB_TOKEN}",
"GITLAB_READ_ONLY_MODE": "false",
"USE_GITLAB_WIKI": "false",
"USE_MILESTONE": "false",
"USE_PIPELINE": "true"
}
},
"atlassian": {
"type": "sse",
"url": "https://mcp.atlassian.com/m1/sse"
}
}
}
Steps to Reproduce
- Moved my MCP config from the
mcpServerssetting ~/.claude.json to one of the .mcp.json paths above. - Run
claude. - Run `/mcp'.
Expected Behavior
Expect my MCP servers to be listed.
Actual Behavior
None of my MCP servers are listed
Additional Context
<!-- Add any other context about the problem here, such as screenshots, logs, etc. -->
28 Comments
im having the same issue
I can't seem to get it to read from the project level. It seems to just be reading directly from the user level mcp configuration which I added via
claude mcp add -s userI think .mcp.json is only for project scoped MCP config.
One thing I stumbled over is that
claud mcp listdoes not list project scoped MCP. You have to runclaudeand then /mcp to list it.the project scope .mcp.json used to be working, not sure since when it is broken. I am using v1.0.56 right now, and even with /mcp command inside claude code, not working at all.
Hey all, thanks a lot for all the feedback here. We'll be trying to make this much clearer and easier to use for you all. Apologies for any issues you're currently facing.
In the meantime, I'll try and help address the comments here one by one:
@bradleyjames - currently, environment variable expansion is only available by
.mcp.json(in your project), although I will let you know if this changes promptly for user and local variable expansion. All user and local settings are stored within your~/.claude.jsonfile. There is no notion of a user-wide.mcp.jsonfile. (It's within~/.claude.json.)@felixzieger
Thanks for surfacing this. It feels like a bug. Do you mind mentioning which version of claude code you are on? I can't reproduce this myself. This may be fixed with a later update. Please note that
claude mcp listwill only list approved MCP servers.@je2ryw Could you provide more details? For example, could you run /doctor? I can't reproduce this myself.
Ah got it. After I approved the MCP server, it does shows for
claude mcp list.No MCP servers configured. Use
claude mcp addto add a server.RepoPrompt:
Scope: Project (shared via .mcp.json)
To remove this server, run: claude mcp remove "RepoPrompt" -s project
⎿ No MCP servers configured. Please run /doctor if this is unexpected. Otherwise, run
claude mcpor visit https://docs.anthropic.com/en/docs/claude-code/mcp to learn more.Claude CLI Diagnostic
Currently running: npm-global (1.0.56)
Path: /Users/jerry/.nvm/versions/node/v22.15.1/bin/node
Invoked: /Users/jerry/.nvm/versions/node/v22.15.1/bin/claude
Config install method: global
Auto-updates enabled: true
Update permissions: Yes
thanks @ollie-anthropic. I would very much appreciate shell expansion in
~/.claude.jsonas well as breaking out the mcp server configuration from that file. I've lost my configuration because of that file getting corrupted.Hi @ollie-anthropic, thanks for the clarifications above! I wanted to follow up with a related question about the user scope MCP configuration location.
Currently, as @bradleyjames mentioned, the user-level MCP config is stored together with other settings in ~/.claude.json. In my workflow, I use git to sync my .claude folder across machines, but this approach doesn't capture the MCP server configurations, since they're embedded in a single file rather than a dedicated config file or directory.
Could you share the reasoning behind this design choice? Are there any plans to reconsider and possibly move the user-scope MCP configuration to a separate file or into the ~/.claude/ directory? Separating it out would make it easier to manage, back up, and sync MCP settings independently.
Thanks for your time and for all the improvements!
Do we have a feature request going for a user-level declarative configuration file like this yet? Or the addition of similar MCP settings to
~/.claude/settings.json?From what I gather,
~/.claude.jsonisn’t meant for human editing or declarative configuration. It’s frustrating that we can’t use a file to configure MCP servers unless it’s scoped to a project.I was banging my head why
Claudewas not reading my.mpc.jsonfile. IT should have been named.mcp.json.I'm adding this comment here for future reference, as a Google search led me to this issue first.
The title of this issue is a bit misleading since this is not a bug, it's a missing feature.
There is no global MCP JSON file, and that seems to be by design.
But that's a bad design. It would really be helpful to be able to define MCP servers in a bespoke config file.
.claude.jsonis a big file and my understanding is that it shouldn't be touched by human users.Came to log this as a bug as well.
claude mcp add --scope project <name> <server>does not workRelated and possible duplicates:
I found in https://github.com/anthropics/claude-code/issues/5037 that I needed to call:
for it to pick up the MCP servers. This feels like a regression to me.
It's also annoying that we can't set
mcpConfigin.claude/settings.jsonin the project.I wrote this Shell function that restores the previous behavior of Claude Code, i.e., loading MCPs from
.mcp.jsonif an.mcp.jsonfile is present, or otherwise not passing the flag:Note: this is needed because otherwise Claude will fail with an error like this if an
.mcp.jsonfile doesn't exist:This is tripping up a lot of folks at the companies I work with.
Expected behaviour:
~/.claude.json.mcp.jsonActual behaviour:
~/.claude.json(why they're configured in a file that contains global state I have no idea!)---
Even forcing Claude to use .mcp.json does not work:
---
Plenty of people seem to be logging bugs here about this as well:
---
I would submit a PR to fix this - but Claude Code is not open source 🤦
Hi, actually I have this behaviour with claude
2.0.24:-> Project config
claude --strict-mcp-config --mcp-config .mcp.json-> Global config
claude-> Merged config
claude --mcp-config .mcp.json⚠️ Problem
This distinction is quite misleading, because of hidden logic:
-> If a projet config file is present, it is not read at all.
-> If a config is specified with
--mcp-config, it is not the source of truth, it is a __merged__ config(with global)Detection should simply follow the context:
-> Project first if local config present, global as fallback
-> Config specified with flag
--mcp-configmust be source of truth-> Merged config with explicit flag,
Thanks for all your work ! 🙏🙏
I feel like the bug is in the design, which involves so many config files in so many places being merged. Please see my review of the experience on #5037 , https://github.com/anthropics/claude-code/issues/5037#issuecomment-3609047115
hey folks, was able to get this working based on solution here: https://github.com/anthropics/claude-code/issues/9461#issuecomment-3396410009
i added this in
<project-folder>/.claude/settings.json(note: notsettings.local.jsonas mentioned in the solution above, as I want to check this into source control)and then the MCPs listed in
<project-folder>/.mcp.jsonmagically appeared in claude code!tested with both vscode extension as well as in terminal
claude mcp listalso showing the MCPs from<project-folder>/.mcp.json(apologies if I misunderstood this issue)
Thanks for the tip @boozedog - could that setting (
enableAllProjectMcpServers) also be added to the global~/.claude/settings.jsonfile?i don't know -- didn't try that. i think we can all agree these config files are very very fiddly!
It seems to work if I don't use
--dangerously-skip-permissionsbecause it prompts me to allow the mcp server I have configured in.mcp.jsonand creates./.claude/settings.local.json. Once that is created, things work like everybody expects, local mcp is loaded (even with--dangerously-skip-permissionsIt seems like you have to have this in
./.claude/settings.local.jsonThis is what I see without skipping permissions
Would appreciate the ability to provide a user-level MCP configuration file, such as
.claude/mcp.json.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.
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
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.