How to choose an MCP server scope in Claude Code

To choose an MCP server scope in Claude Code, use local scope for a personal server in one project, project scope for a server your team shares through a committed .mcp.json file, and user scope for a personal server you want in every project. Local is the default.
The three scopes at a glance
Checked against the Claude Code MCP documentation as of 2026-11-30. Scope is set with the --scope flag on claude mcp add and claude mcp add-json.
| Scope | Loads in | Shared with team | Stored in | Flag |
|---|---|---|---|---|
| Local | Current project only | No | ~/.claude.json, under that project’s path |
--scope local (default) |
| Project | Current project only | Yes, through version control | .mcp.json in the project root |
--scope project |
| User | All your projects | No | ~/.claude.json |
--scope user |
The table shows the two questions that decide the scope: which projects should load the server, and should the configuration travel with the repository. Local and user both stay out of version control. Only project scope puts the entry in a file your team can commit.
Local scope: the default for personal servers
Local scope is what you get when you run claude mcp add without a --scope flag. The server loads only in the project where you added it, and it stays private to you. Claude Code keeps the entry in ~/.claude.json, under that project’s path, not in the repository.
Use local scope for personal development servers, experimental configurations, and servers with credentials you do not want in version control. A teammate who clones the repository never receives the entry.
claude mcp add --transport http stripe --scope local https://mcp.stripe.com
The command writes an entry like this under your project’s path in ~/.claude.json:
{
"projects": {
"/path/to/your/project": {
"mcpServers": {
"stripe": {
"type": "http",
"url": "https://mcp.stripe.com"
}
}
}
}
}
Do not confuse this with general local settings. Those live in .claude/settings.local.json in the project directory. Local-scoped MCP servers do not use that file, and the docs call out the difference for that reason.
Project scope: the shared list for the team
Project scope writes the server to a .mcp.json file at the project root. Claude Code creates or updates that file when you add the server with --scope project. Commit the file so everyone on the team gets the same tools and services.
claude mcp add --transport http shared-server --scope project https://example.com/mcp
The file follows a standard format with an mcpServers key, and each entry holds the server’s type and URL or command.
Committing the file does not mean every session uses it without a question. In an interactive session, Claude Code asks for approval before it uses a project-scoped server from .mcp.json. To reset those choices, run claude mcp reset-project-choices.
Keeping a project server out of a run
The docs describe three ways to keep a project-scoped server out, including in non-interactive runs where no prompt appears:
- Add its name to
disabledMcpjsonServers. The docs say this blocks the server in every permission mode. - Exclude project settings with
--setting-sources, or with thesettingSourcesoption in the Agent SDK. - Start the session with
--strict-mcp-config. Claude Code then loads only the servers you pass with--mcp-config. Skipping the approval prompt for project-scoped servers that Claude Code is not loading requires Claude Code v2.1.246 or later.
User scope: personal tools across projects
User scope stores the server in ~/.claude.json and makes it available in all your projects on the machine. It stays private to your user account and is not shared with the team.
Use it for personal utility servers, development tools and services you use across repositories. It suits a tool you would otherwise add by hand to every project. Each new project then gets the server without a repository change, which also means you should review what the server can reach before you rely on it everywhere.
claude mcp add --transport http hubspot --scope user https://mcp.hubspot.com/anthropic
It is the wrong scope for a server the team depends on. Nothing in the repository carries a user-scoped entry, so a colleague’s Claude Code session will not have it.
Same name in two scopes: which definition loads
Claude Code matches duplicate servers across the three scopes by name. It connects once, using the definition from the highest-precedence source, and it uses the whole entry from that source. Fields are not merged, so a URL from the user scope and headers from the project scope never combine.
The docs list the order as local, project and user, followed by plugin-provided servers and claude.ai connectors. A server your organization provides through the managedMcpServers managed setting ranks above all of them, and needs Claude Code v2.1.259 or later.
Plugins and connectors are matched by endpoint, not by name. Two URLs count as the same endpoint in the cases below.
| Difference between two URLs | Same endpoint? |
|---|---|
| Letter case of the scheme or host | Yes |
The scheme’s default port, such as :443 on https |
Yes |
| A trailing slash | Yes |
| A different path or query string | No |
| Userinfo, or a non-default port | No |
A decision checklist
- Is the server for you alone, in one repository? Use local scope.
- Does the whole team need it in this repository? Use project scope, commit
.mcp.json, and review the entry before anyone approves it. The review guide covers what to check. - Do you need it in every project on your machine? Use user scope.
- Does it take a credential that must stay out of version control? Use local or user scope, never project scope.
- Before you add it, run
claude mcp listand check that the name is not already defined in another scope with a different endpoint. Runclaude mcp get <name>to see its status.
Gotchas from the docs
A header helper’s credentials depend on scope. Claude Code runs a headersHelper without credential variables such as ANTHROPIC_API_KEY when the helper comes from a project .mcp.json or from a plugin. A helper at local or user scope keeps those variables. If a project helper needs a secret, have the script read it from a file or a credential store.
Scope is not a permission control. The page describes scope as controlling which projects load a server and whether it is shared. It does not describe scope as a way to limit what Claude Code may run. To restrict which servers can run, use the managed settings covered in the restrict guide. For the wider security view, see the MCP security hub.
Enforcing this with AIControls
Scope decides where a server loads and whether it is shared. It does not decide which servers your organization allows, and this post makes no claim that AIControls changes that. AIControls supports Claude Code through the gateway, in the CLI and in VS Code. If the question is which servers a developer may add at all, the answer sits in the allowlist settings, not in scope. For the product side of coding agent controls, see the AIControls coding agents page.
Frequently asked questions
Will a user-scoped MCP server show up for my teammates?
No. User scope stores the server in ~/.claude.json on your machine, and the entry is not shared with the team. It loads in every project you open on that machine, so a personal tool added at user scope appears in each repository. Teammates who want the same server need their own entry, or a project-scoped entry committed to the repository.
What happens when a local server and a user server have the same name?
Claude Code connects once, using the definition from the highest-precedence source. The docs list local ahead of user, so in that project the local entry is used and the user entry is ignored. Fields are not merged across scopes, so the entry you see is the whole entry. Run claude mcp get with the server name to check which definition is active before you rely on it.
Does the approval prompt apply to user-scoped and local-scoped servers?
The approval prompt the docs describe applies to project-scoped servers from a .mcp.json file, in interactive sessions. The docs do not describe a prompt for servers at local or user scope. Claude Code can't show the prompt in claude -p runs, Agent SDK sessions or cloud sessions outside a project's threads, so project servers load there without asking.