Language Models
X

Adding an MCP server to Claude Code, and which scope to pick

2026/09/02

MCP is the protocol that lets a model reach outside tools⁠[1]. In Claude Code a server is added with claude mcp add⁠[1].

There are three transports⁠[1]. A local process is --transport stdio, where the command to run comes after a bare -- separator: claude mcp add --transport stdio db -- npx -y @bytebase/dbhub⁠[1]. A remote server is --transport http or --transport sse, taking a URL, with credentials passed as --header "Authorization: Bearer ..."⁠[1]. Environment variables go in as --env KEY=value⁠[1].

There are also three scopes, and the choice decides where the configuration lands⁠[1]. The default, local, writes to ~/.claude.json and applies to the current project only⁠[1]. --scope project writes to .mcp.json at the project root, and this is the only one that reaches anybody else⁠[1]. --scope user writes to ~/.claude.json and applies across all of your projects⁠[1]. When the same name appears in more than one, local wins over project, and project over user⁠[1].

claude mcp list shows every configured server with its connection state, and claude mcp get <name> shows one⁠[1]. Inside a session, /mcp opens the same thing as a panel⁠[1].