Claude Code MCP Setup: claude mcp add, Scopes, and Transports

How to add and manage MCP servers from the Claude Code CLI: local/project/user scopes, .mcp.json team sharing, stdio/http transports (SSE deprecated), and claude mcp add/list/get — per official docs.

Wiring MCP servers into Claude Code (the terminal CLI) lets Claude operate external tools like GitHub, databases, and browsers directly. Unlike the app/desktop connection overview (a separate article), this guide focuses on adding and managing servers from the Claude Code CLI, centered on scopes and transports. (As of June 2026; source: the official Claude Code doc "Connect Claude Code to tools via MCP".)

Three MCP server scopeslocalDefault · this project, just you~/.claude.json (keyed by project)projectTeam-shared · commit to git.mcp.json at project rootuserAcross all your projects~/.claude.json (global)

Decide first — the three scopes

An MCP server can be configured at three scopes, and the scope controls which projects it loads in and whether it is shared with your team.

  • local (default): loads only in the project where you added it and stays private to you. Claude Code stores it in ~/.claude.json under that project's path.
  • project: stored in .mcp.json at the project root, which you can commit to git. Everyone who clones the repo gets the same server config.
  • user: a global setting available across all your projects (also stored in ~/.claude.json).

local and user live in each machine's ~/.claude.json and don't sync. To share identical config with a team, the canonical path is project scope + committing .mcp.json. Administrators can also deploy servers at the enterprise level via managed configuration.

From adding a server to using itAddclaude mcp add(--transport, --scope)Verifyclaude mcp listclaude mcp get Auth/mcp in sessionhandle OAuth if neededUsestart new session →tools auto-discovered

From adding to using

The base command is claude mcp add, specifying transport and scope.

# local scope (default) + http transport
claude mcp add --transport http stripe https://mcp.stripe.com

# explicitly specify scope
claude mcp add --transport http stripe --scope local https://mcp.stripe.com

If you already have a JSON config, add it directly with claude mcp add-json. After adding, use claude mcp list for the full list and claude mcp get <name> for a server's status and details. For servers that need auth, use the /mcp slash command inside a session to check status and handle OAuth.

For stdio servers, tools are discovered at session start. If you added a server mid-session, start a new session to pick up its tools.

Transports: stdio vs httpstdioRuns as a local processDirect system access / custom scriptsInjects CLAUDE_PROJECT_DIR envhttpConnects to a remote serviceNo local process neededFor remote MCP serversSSE is deprecated → use http (streamable HTTP)

Transports — stdio and http

There are two transports. A stdio server runs as a local process on your machine, ideal for tools needing direct system access or custom scripts. Claude Code injects CLAUDE_PROJECT_DIR (the project root) into that process's environment, so your server can resolve project-relative paths without depending on the working directory (process.env.CLAUDE_PROJECT_DIR in Node, os.environ["CLAUDE_PROJECT_DIR"] in Python).

An http server connects to a remote service and needs no local process. The older SSE transport is deprecated, so if you hit connection errors, switch from --transport sse to --transport http (streamable HTTP).

Common commands & gotchasclaude mcp addAdd a server (set transport/scope)claude mcp add-jsonAdd via JSON configclaude mcp list / getCheck connection / detailsclaude mcp removeRemove a server/mcp (in session)Status & OAuth authAfter config changes, restart or reconnect via /mcp to apply.

Common commands and gotchas

For MCP, Claude Code provides claude mcp add, claude mcp list, claude mcp get, claude mcp remove, claude mcp add-json, claude mcp add-from-claude-desktop, and claude mcp serve. Inside a session, /mcp handles server status and OAuth.

A common mistake is forgetting to restart after a config change. Editing .mcp.json directly or changing a referenced environment variable does not affect the running session. After changes, restart Claude Code or at least disconnect/reconnect the server via /mcp. You can attach many servers — Tool Search is on by default and defers tool definitions, so adding more servers has minimal context impact.

The MCP concept: what is MCP; an overview of the 4 connection methods: how to connect MCP; servers by use case: recommended MCP servers.

Note: This article is based on the official Claude Code documentation (accessed June 2026); commands, scopes, and defaults may change across versions. Check the official docs for the latest spec. This site is not affiliated with Anthropic.

Keep reading

Have a question or want to share how you use Claude?

Join the community to share tips with other users, or explore more guides.