How to add an MCP server to Claude Code

To add an MCP server to Claude Code, run claude mcp add. For a remote server use --transport http and its URL; for a local one use --transport stdio and put the server command after --. Then run claude mcp list or /mcp to check that it connects. Reported from the docs, read 2026-10-26; not run by us.

Checked by Agentic Weekly's editorial process: vendor docs re-read.

Last verified: 2026-10-26 (America/Chicago) · Versions covered: Claude Code MCP docs as read on 2026-10-26; no Claude Code version recorded for these commands · Evidence: Reported (see “What we tested”)

Pick a transport: remote HTTP or local stdio

An MCP server is a program that gives an AI agent tools; see What is an MCP server?. Claude Code can talk to one over HTTP (a remote service) or stdio (a program it starts on your machine). Everything on this page is from Claude Code's MCP documentation, read 2026-10-26, and it is Reported: we have not run these commands.

Transports in Claude Code
TransportCommand shapeWhen to useSource and date
HTTPclaude mcp add --transport http <name> <url>The docs call HTTP the recommended option for remote servers and the most widely supported transport for cloud servicesClaude Code MCP docs, read 2026-10-26
stdioclaude mcp add [options] <name> -- <command> [args...]A local process that Claude Code starts and talks to over standard input and outputClaude Code MCP docs, read 2026-10-26
SSEclaude mcp add --transport sse <name> <url>Deprecated per the docs; use HTTP where available. The docs say the HTTP command falls back to SSE for services that only expose itClaude Code MCP docs, read 2026-10-26
WebSocketclaude mcp add-json <name> '<json>' with "type": "ws"For remote servers that push events; configured in .mcp.json or with add-json, authentication by header onlyClaude Code MCP docs, read 2026-10-26

Docs change often and describe behaviour by Claude Code version, so re-check the source before relying on a flag.

Add a remote server

Basic syntax and an example from the docs
claude mcp add --transport http <name> <url>
claude mcp add --transport http notion https://mcp.notion.com/mcp
With a bearer token (from the docs; replace the placeholder with your own token)
claude mcp add --transport http secure-api https://api.example.com/mcp \
  --header "Authorization: Bearer your-token"

The docs say that when a server needs OAuth, you sign in from the /mcp panel inside a session, or run claude mcp login <name> in your shell; a claude -p or Agent SDK run cannot start the sign-in. For a worked token example, see GitHub MCP server: how to set it up.

Evidence: Reported. Source: Claude Code MCP docs, read 2026-10-26.

Add a local server

Basic syntax and an example from the docs
claude mcp add [options] <name> -- <command> [args...]
claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable \
  -- npx -y airtable-mcp-server

The docs explain that the -- (double dash) separates Claude Code's own options, such as --transport, --env and --scope, from the command that starts the server; everything after it is passed to the server untouched. Without it, Claude Code would read the server's flags as its own. --env accepts several KEY=value pairs; if the server name comes straight after --env, the command reads the name as another pair and fails, so put another option, such as --transport stdio, between them.

A worked example for the reference Git server, built by combining the docs' command shape with that server's README. We have not run it as a command, though we did test the server itself outside Claude Code (see Git MCP server: setup and what we tested):

Not run by us: the Git server added to Claude Code
claude mcp add --transport stdio git -- uvx mcp-server-git --repository /path/to/repo

Evidence: Reported. Source: Claude Code MCP docs, read 2026-10-26.

Check it connected

Commands from the docs
claude mcp list
claude mcp get notion
/mcp   # inside a Claude Code session
  • claude mcp add prints an Added ... line when the configuration was written; that is not proof the server connects.
  • claude mcp list shows a health status next to each server, such as Connected, Needs authentication or Failed to connect.
  • claude mcp get <name> shows details; for a failed server it shows the HTTP status or error code on an Issue: line.
  • Statuses that report a configuration decision instead of a connection: Pending approval (a project server from .mcp.json you have not approved), Rejected, and Disabled for this project.

Evidence: Reported. Source: Claude Code MCP docs, read 2026-10-26.

Scopes: local, project, user

MCP installation scopes, per the docs
ScopeLoads inShared with teamStored inFlag
local (default)Current project onlyNo~/.claude.json--scope local
projectCurrent project onlyYes, via version control.mcp.json in the project root--scope project
userAll your projectsNo~/.claude.json--scope user

Project-scoped servers need your approval before Claude Code connects to them. The docs note that this "local scope" is different from general local settings, which live in .claude/settings.local.json. Source: Claude Code MCP docs, read 2026-10-26.

Remove or disable a server

Command from the docs
claude mcp remove notion

The docs say that removing a remote server also deletes the OAuth tokens and client registration Claude Code stored for it. To switch a server off for one project without removing it, use the /mcp panel. Source: Claude Code MCP docs, read 2026-10-26.

Troubleshooting

Claude Code MCP problems and fixes
SymptomLikely causeFixSource
A placeholder token is accepted at add time, then the server failsclaude mcp add saves the configuration without validating credentialsRun /mcp and check for a checkmark or an X; fix the token and add the server again.Claude Code MCP docs, read 2026-10-26
A JSON entry with a url is skipped with a message about a missing typeAn entry with no type is read as a stdio serverAdd "type": "http" (or sse or ws) to the entry.Claude Code MCP docs, read 2026-10-26
The server's own flags are rejected or misreadWithout --, Claude Code parses the flags as its ownPut the whole server command after --.Claude Code MCP docs, read 2026-10-26
--env error when addingThe name directly after --env is read as another KEY=value pairPlace another option, such as --transport stdio, between --env and the name.Claude Code MCP docs, read 2026-10-26
A server needs authenticationThe server answered 401 or 403 and Claude Code flagged itOpen /mcp and complete the sign-in; in claude -p runs, sign in from an interactive session first.Claude Code MCP docs, read 2026-10-26
A local npm-based server is older than expectednpm on an older Node installs older package versions without an errorCheck node --version. Our study measured this for four packages, including the MCP filesystem server and the MCP Inspector.Our study: older Node installs older servers, 2026-10-25

What we tested

Evidence: Reported (not run by us). We did not run claude mcp add, list, get or remove for this guide.

  • What we ran: nothing for these commands. Our only Claude Code test is a separate smoke test on 2026-10-25 of a headless edit with a local model; see the Claude Code test log. That task did not involve MCP servers.
  • Reported, from the Claude Code MCP docs, read 2026-10-26: every command, flag, scope and status on this page.
  • Not tested: OAuth sign-in, project approval prompts, plugins, managed configuration, WebSocket servers, Windows behaviour, and whether any listed server connects or works.
Evidence by section
SectionEvidenceSource
Transports, remote, localReportedClaude Code MCP docs, read 2026-10-26
Check, scopes, removeReportedClaude Code MCP docs, read 2026-10-26
Git server worked exampleReported (combination of two documents)Claude Code MCP docs, read 2026-10-26 and Git server README
  • Claude Code: Update now if you use the sandbox or run Claude Code on a cloud provider; skip if you wanted flashy new features, this is a hardening release. Tested (smoke test, 2026-10-25, local Qwen2.5-3B-Instruct, not vendor models).

FAQ

How do I add an MCP server to Claude Code?

Run claude mcp add. For a remote server use claude mcp add --transport http <name> <url>; for a local one use claude mcp add --transport stdio <name> -- <command>. Then check with claude mcp list. This is from the Claude Code docs, read 2026-10-26; we have not run it.

What is the difference between local, project and user scope?

Per the docs, local scope (the default) loads only in the current project and is private to you. Project scope stores the server in .mcp.json so your team shares it through version control. User scope loads in all your projects.

How do I see which MCP servers Claude Code has?

Run claude mcp list for each server and a health status, claude mcp get <name> for details on one server, or /mcp inside a session. These commands are from the Claude Code docs, read 2026-10-26.

How do I remove an MCP server from Claude Code?

Run claude mcp remove <name>, for example claude mcp remove notion. The docs say removing a remote server also deletes the OAuth tokens and registration Claude Code stored for it. We have not run this command.

Why does my MCP server show as failed?

The docs say Failed to connect means Claude Code could not reach the server, and claude mcp get <name> shows the HTTP status or error. Common causes are a wrong token, a missing type on a JSON entry or a server command that does not start.

Have you tested these commands?

No. We have not run claude mcp add, list, get or remove for this guide, so every command is copied from the Claude Code docs, read 2026-10-26. Our Claude Code test log covers a different task.

Sources

Page history

  • : First published. Claude Code MCP docs read on this date; nothing was run.

Markdown version for agents: /guides/add-mcp-server-to-claude-code.md