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".)
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.jsonunder that project's path. - project: stored in
.mcp.jsonat 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 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 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 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.
Related reading
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.