Skip to content

Client setup

Claude Code MCP scopes: local, project or user for a fetch server

Claude Code stores an MCP server in local, project or user scope. Which one to use for a fetch server, where each is stored, and how to keep the key out of git.

Published

This article was drafted with AI assistance from the sources listed below and edited and published by Teneo Labs. Disclosure: this site is run by Teneo Labs, the company behind Live Web Data API, which this article mentions.

Claude Code MCP scopes at a glance
CriterionWho sees itWhere it is stored
local (default)You, in this project onlyYour user config, under this project
projectEveryone who opens the repo.mcp.json at the repository root
userYou, in every projectYour user config

claude mcp add stores every server in one of three scopes. The scope decides who sees the server and in which projects, and for a server that needs a key it also decides whether that key could end up in git. The default is rarely the right choice for a fetch server you use everywhere.

Checked against the Claude Code MCP docs as of this post's date.

The three scopes

  • local (the default) is private to you and only active in the project where you added it. It is the right choice for a server you are trying out.
  • project writes the entry to .mcp.json at the repository root, so everyone who clones the repository gets it. Claude Code asks each person to approve a project server before it is used; claude mcp reset-project-choices clears those answers.
  • user is private to you and active in every project. It is the natural home for a tool like a fetch server that you want everywhere.

Pick the scope when you add the server:

claude mcp add --scope user --transport http live-web-data https://fetchmcp.net/mcp \
  --header "Authorization: Bearer $LIVE_WEB_DATA_API_KEY"

Where the key ends up

The shell expands $LIVE_WEB_DATA_API_KEY before Claude Code sees it, so the stored entry holds the key itself. That is fine in local or user scope, which live in your own config. It is not fine in project scope, because .mcp.json is meant to be committed.

For a shared entry, write .mcp.json by hand and use a variable that Claude Code expands when it loads the file:

{
  "mcpServers": {
    "live-web-data": {
      "type": "http",
      "url": "https://fetchmcp.net/mcp",
      "headers": { "Authorization": "Bearer ${LIVE_WEB_DATA_API_KEY}" }
    }
  }
}

Each developer then sets LIVE_WEB_DATA_API_KEY in their own environment. ${VAR:-default} also works when a fallback makes sense, though a key should not have one.

A rule for fetch servers

  • Just you, every project: user scope, key expanded by your shell.
  • The whole team: project scope, .mcp.json with ${VAR}, one key per person.
  • Trying a server once: local scope, then remove it.

Before you commit, search the diff for Bearer followed by anything that is not a variable. The authentication guide covers rotation and what to do if a key reaches git history.

Check which entry is active

claude mcp list shows every server and whether it connected. claude mcp get live-web-data shows the stored entry, including its scope, URL and headers, which is the quickest way to spot a server that exists in two scopes. The other clients' equivalents are in the setup guide.

Try it

Live Web Data API, made by Teneo Labs, runs a remote fetch server with a bearer key, so the user-scope command above is all Claude Code needs. Copy the current URL from the MCP docs.

Frequently asked questions

Which Claude Code MCP scope is the default?

local. Without --scope, claude mcp add stores the server privately for you and only in the current project.

Can I change the scope of an MCP server I already added?

Not in place. Remove it with claude mcp remove, naming the scope if the same name exists in several, and add it again with the scope you want.

What happens if two scopes define the same server name?

Claude Code uses one of them: local wins over project, and project wins over user. Run claude mcp get with the name to see which entry is active.

Sources

  1. Connect Claude Code to tools via MCP (Claude Code docs) (Documentation)
  2. Claude Code settings (Claude Code docs) (Documentation)