Guides › Claude Code

How to add MCP servers to Claude Code (claude mcp add)

Claude Code is Anthropic's coding agent for the terminal. You add servers with the claude mcp command, and it saves them for you. It works the same on macOS, Windows and Linux.

Checked against the official docs on 2026-11-26. Apps change often; the sources are linked at the bottom.

Where the config file lives

Local and user scope (all systems)~/.claude.json (in your home folder)
Project scope, shared with your team.mcp.json in the project root
Top-level keymcpServers

Where a server is saved (scopes)

ScopeWho gets itStored in
local (default)Only you, only in this project~/.claude.json, under the project's path
project (--scope project)Everyone who works in the project.mcp.json in the project root (commit it)
user (--scope user)Only you, in every project~/.claude.json

Add a remote server (a URL)

  1. Add the server with its URL
    Remote HTTP servers are the recommended option for hosted services.
    claude mcp add --transport http notion https://mcp.notion.com/mcp
  2. Pass an API key header if the server needs one
    Use --header (or -H).
    claude mcp add --transport http secure-api https://api.example.com/mcp \
      --header "Authorization: Bearer your-token"
  3. Sign in
    Start claude and type /mcp, then follow the sign-in for servers that use OAuth.
    /mcp
  • SSE is deprecated. If a service only offers SSE, claude mcp add --transport http tries HTTP first and switches to SSE on its own (Claude Code v2.1.265 or later), or you can pass --transport sse.
  • In a JSON config, an entry with a url must also have "type": "http" (see this fix).

Add a local server (runs on your computer)

  1. Add the server with its command after --
    Everything after -- is the command that starts the server. Put --env before the server name.
    claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable \
      -- npx -y airtable-mcp-server
  2. Or paste JSON from another app's instructions
    If a server only gives a Claude Desktop or Cursor mcpServers block, add one entry with add-json.
    claude mcp add-json example '{"command":"npx","args":["-y","@example/mcp-server"]}'
  3. Keep tokens off the command line (2.1.327 or later)
    Pass - instead of the JSON and Claude Code reads the entry from standard input, so a token in it doesn't end up in your shell history. This works from a normal terminal, not inside a Claude Code session.
    claude mcp add-json github - < github-mcp.json

Check and manage servers

claude mcp list        # every server and its status
claude mcp get notion  # details for one server
claude mcp remove notion

Tips

  • Project servers from a .mcp.json wait for your approval the first time (details).
  • Slow servers: MCP_TIMEOUT=10000 claude sets a 10-second startup timeout.
  • Large tool results: Claude Code warns above 10,000 tokens and caps output at 25,000 by default; raise it with MAX_MCP_OUTPUT_TOKENS (details).
  • Remote server won't connect? Since Claude Code 2.1.329, the server's page in /mcp shows a Server message row with the error the server sent back.
  • Skills from MCP servers (public beta, Claude Code 2.1.331 or later): a server can now offer skills next to its tools. Type / or run /skills to find them; they are named server:skill, for example /docs:pdf. Block a server's skills with a deny rule such as Skill(mcp__docs__*) in /permissions.
  • Slow tools: add "timeout": 600000 (milliseconds) to a server's .mcp.json entry to give its tool calls up to ten minutes.

Common problems in Claude Code

Sources

Weekly MCP digest
New servers, breaking changes, and fresh fixes. One email a week.