In Claude Code, how do the local, project and user MCP server scopes differ, and which one is the default?
answer
- who sees it, and in which projects
- two files hold all three
- the default stays private to one project
- one file is meant to be committed
- whole entry wins, no field merge
basics
~20 sLocal, the default, is private to you and one project, stored in ~/.claude.json under that project's path. Project writes .mcp.json at the repository root for everyone who clones it. User is private to you across all projects.
solid answer
~40 s`claude mcp add` writes to one of three scopes chosen with `--scope`. **Local** is the default: the entry lives in `~/.claude.json` under the current project's path, loads only in that project and is never shared. **Project** writes `.mcp.json` at the project root, meant to be committed so teammates get the same server after approving it. **User** lives in `~/.claude.json` under the top-level `mcpServers` key and loads in every project you open, still private to you. So a server carrying your own token belongs at local or user scope, never in `.mcp.json`. If the same name is defined in several scopes, Claude Code connects once using the highest-precedence definition — local, then project, then user, then plugin servers, then claude.ai connectors — and takes that whole entry without merging fields.
code
bash · 12 lines# Personal note server: every project, private to you
claude mcp add --scope user --transport http notes https://notes.example.com/mcp
# Team issue tracker: written to .mcp.json and committed
claude mcp add --scope project --transport http tracker https://tracker.example.com/mcp
# Local database with your credential: the default local scope
claude mcp add --env DB_URL=postgres://localhost/orders --transport stdio \
orders-db -- npx -y @example/db-mcp-server
# Which scope holds a definition?
claude mcp get trackergo deeper
Know the three names and that local is the default: private to you, this project only. Know that .mcp.json is the shared one.
Explain where each scope is stored, the local-scope naming trap against settings.local.json, and how to move a server between scopes by removing and re-adding it.
Walk the precedence order and the no-merge rule, how plugin servers and connectors are matched by endpoint, and why per-endpoint OAuth makes duplicate names confusing.
Decide what a team standardises in .mcp.json versus leaves to each developer, so shared configuration never needs a secret and personal overrides stay predictable.
## Why scope matters A **scope** decides two things about an MCP server: **which projects it loads in** and **who else gets the configuration**. Getting it wrong has a concrete cost. A server with a personal API key added at project scope ends up in a committed file; a team server added at local scope never reaches your teammates. ## The three scopes | Scope | Loads in | Shared with the team | Stored in | |---|---|---|---| | `local` (default) | The current project only | No | `~/.claude.json`, under that project's path | | `project` | The current project only | Yes, through version control | `.mcp.json` at the project root | | `user` | All your projects | No | `~/.claude.json`, under the top-level `mcpServers` key | - **Local** suits personal or experimental servers and servers whose credentials must stay out of the repository. The project it belongs to is the repository root, or the exact directory when you are not in a repository, so running `claude mcp add` from another project and then not seeing the server is a common surprise. - **Project** suits servers the whole team should have. `claude mcp add --scope project` creates or updates `.mcp.json`; you commit it. Teammates are asked to approve each project server the first time an interactive session sees it. - **User** suits personal tools you want everywhere, such as a note server. A naming trap: MCP's **local scope** is not the same thing as the general local settings file `.claude/settings.local.json`. Local-scope servers are stored in your home directory's `~/.claude.json`, not in the project directory. With `CLAUDE_CONFIG_DIR` set, Claude Code reads `.claude.json` from that directory instead. ## Choosing a scope for a mixed setup Consider three servers on one machine: 1. A team **issue tracker**, reached over HTTP and signed in to with OAuth: project scope, because everyone needs it and the file holds no secret — each person signs in through `/mcp` and the tokens stay with them. 2. A **local database server** started with a connection string: local scope, because the credential is yours and the server only makes sense in this repository. 3. A **personal note server**: user scope, so it follows you into every project. ## Precedence when names collide When the same server is defined in more than one place, Claude Code connects to it **once**, using the definition from the highest-precedence source: 1. Local scope 2. Project scope 3. User scope 4. Plugin-provided servers 5. claude.ai connectors Two details matter in practice: - **The whole entry wins.** Fields are not merged across scopes, so a local entry that only changes a header does not inherit the URL from `.mcp.json` — it replaces the project definition entirely. - **How duplicates are matched.** Across the three scopes, by **name**. Plugin servers and claude.ai connectors are matched by **endpoint**, so one that points at the same URL or command as a server above counts as a duplicate. If the same name is defined in two scopes with different endpoints, `claude mcp list` and `/mcp` warn about the conflict. Because OAuth sign-ins are stored per endpoint, signing in to the definition that loads in one project does not sign you in where a different definition loads. ## Moving and inspecting servers - A server's scope is fixed when you add it. To move it, remove it at the old scope (`claude mcp remove <name> --scope local`) and add it again with the new `--scope`. - `claude mcp get <name>` shows which scope holds a server's definition. - Adding a name that already exists at the same scope fails, for example `MCP server sentry already exists in local config`. - `claude mcp add-json` and `claude mcp add-from-claude-desktop` take the same `--scope` flag. ## Common mistakes - Assuming the default is project scope and expecting teammates to see a server. - Putting a token in `.mcp.json` because "the team needs the server" — share the entry, not the credential. - Expecting a local override to merge with the project entry. - Editing files Claude Code never reads, such as `~/.claude/mcp.json`; the real files are `~/.claude.json` and `<project>/.mcp.json`.
- You define `tracker` in `.mcp.json` and again at local scope with only a different header. What does Claude Code connect?Only the local definition, because local outranks project and the whole entry from the winning source is used. Fields are not merged, so if the local entry has a different or missing URL, that is what Claude Code uses; the project entry's values are not inherited.
- A plugin bundles a server pointing at the same URL as a server you added at user scope. Do you get two?No. Plugin servers and claude.ai connectors are matched against the three scopes by endpoint, not name, so a plugin server with the same URL counts as a duplicate and your user-scope definition, which ranks higher, is the one Claude Code connects.
- How do you move a server from local to user scope?Scope is fixed at add time, so remove the local entry with `claude mcp remove <name> --scope local` and add it again with `--scope user`. Leaving both in place works, but the local entry keeps winning in that project and may trigger the duplicate-name warning.
Local scope is a sticky note on your own desk in one office, project scope is the notice pinned to that office's shared board, and user scope is the keyring you carry into every office. Nobody else reads your desk or your keyring.
- claude mcp add writes to .mcp.json unless told otherwise
- Local scope means the project's .claude/settings.local.json file
- A local override merges its fields into the project entry
- User scope servers are shared with everyone on the team
- Project scope is fine for a personal token because the repo is private