Where Is the Claude Code MCP Config Stored?
Claude Code stores MCP server configurations in two files: ~/.claude.json in your home folder for your personal servers, and .mcp.json in your project root for servers shared with your team.
MCP servers are not saved in settings.json, which is why many people can’t find them.
This article shows which file each server goes into, how the three MCP scopes work, and the commands to add, list, and remove servers without editing JSON by hand.
The MCP config locations
Where a server is saved depends on the scope you choose when you add it:
| Scope | Stored in | Available in | Shared with team |
|---|---|---|---|
| Local (default) | ~/.claude.json, under the project’s path | Current project only | No |
| Project | .mcp.json in the project root | Current project only | Yes, if you commit it |
| User | ~/.claude.json | All your projects | No |
Note that ~/.claude.json is a file in your home folder. It’s not inside the ~/.claude/ folder, even though the names look alike.
Here’s the full path on each operating system:
| OS | Path |
|---|---|
| macOS | /Users/<you>/.claude.json |
| Linux / WSL | /home/<you>/.claude.json |
| Windows | C:\Users\<you>\.claude.json |
How to list your MCP servers
You don’t need to open any file to see which servers you have. Run this in your terminal:
claude mcp list
To see the details of one server, including the scope it was saved in:
claude mcp get <server-name>
Inside a Claude Code session, run /mcp to see each server’s connection status.
How to add an MCP server to a specific scope
Use claude mcp add with the --scope option. If you leave out --scope, the server is saved as local, so it only works in the folder where you ran the command.
Add a remote server for just this project:
claude mcp add --transport http stripe https://mcp.stripe.com
Add a server you want in every project:
claude mcp add --transport http hubspot --scope user https://mcp.hubspot.com/anthropic
Add a server for your whole team. This writes it to .mcp.json:
claude mcp add --transport http shared-server --scope project https://example.com/mcp
For a server that runs as a local program, put the command after --:
claude mcp add my-server -e API_KEY=xxx -- npx my-mcp-server
A common mistake is adding a server without --scope user, then wondering why it’s missing in other projects. Re-add it with --scope user to fix that.
What .mcp.json looks like
If you want to write the project file by hand, create .mcp.json in the project root:
{
"mcpServers": {
"shared-server": {
"type": "http",
"url": "https://example.com/mcp"
}
}
}
Don’t put API keys directly in this file, since it gets committed to git. Use environment variables instead:
{
"mcpServers": {
"api-server": {
"type": "http",
"url": "${API_BASE_URL:-https://api.example.com}/mcp",
"headers": {
"Authorization": "Bearer ${API_KEY}"
}
}
}
}
${API_KEY} is replaced with the value of that environment variable, and ${VAR:-default} uses the default when the variable isn’t set.
The first time Claude Code sees a project’s .mcp.json, it asks you to approve the servers before using them. To reset those choices, run:
claude mcp reset-project-choices
Which config wins when names clash?
If a server with the same name exists in more than one scope, Claude Code uses only one of them, in this order:
- Local scope
- Project scope
- User scope
- Servers that come from plugins
- claude.ai connectors
The whole entry from the winning scope is used. Fields are not merged between scopes.
How to remove an MCP server
Run:
claude mcp remove <server-name>
For remote servers, this also deletes the login tokens Claude Code saved for that server.
Can I import MCP servers from Claude Desktop?
Yes, on macOS and WSL. Run:
claude mcp add-from-claude-desktop
On other systems, you can copy a server from another app’s config with claude mcp add-json. Pass only the server object, not the mcpServers wrapper:
claude mcp add-json example '{"command":"npx","args":["-y","@example/mcp-server"]}'
Where is the managed MCP config?
If your organization controls which MCP servers you can use, the config is a managed-mcp.json file in a system folder:
- macOS:
/Library/Application Support/ClaudeCode/ - Linux and WSL:
/etc/claude-code/ - Windows:
C:\Program Files\ClaudeCode\
You can’t change these servers yourself.
Conclusion
Personal MCP servers live in ~/.claude.json, and team servers live in .mcp.json in the project root. Use claude mcp list to see them all, and add --scope user when you want a server in every project.
For the other config files, see where is the Claude Code settings.json file.