Claude MCP — How Claude Code attaches Anthropic's MCP
## what it does
tl;dr: Anthropic’s MCP is the same Model Context Protocol the rest of the ecosystem uses. Claude Code installs it with claude mcp add (CLI). Claude Desktop installs it via claude_desktop_config.json (JSON). Both speak stdio or streamable HTTP; OAuth is per-server. The “claude mcp” and “anthropic mcp” queries resolve to the same product — same docs site, same spec, same protocol.
What Anthropic’s MCP is
Anthropic co-publishes the Model Context Protocol — an open standard for connecting AI applications to data sources, tools, and workflows. The architecture docs describe three participants: host (the AI app), client (the host’s per-server connector), and server (the program that provides tools, resources, and prompts). Two transports in the spec: stdio (local process) and streamable HTTP (remote, with OAuth recommended).
Claude is both an MCP host (Claude Code, Claude Desktop) and the canonical reference-server collection on GitHub (modelcontextprotocol/servers). The product page Anthropic ships is mirrored at docs.claude.com/en/docs/agents-and-tools/mcp and docs.anthropic.com/en/docs/agents-and-tools/mcp — same content, both fetched.
Install in Claude Code
Claude Code manages MCP through claude mcp add. Source: docs.claude.com/en/docs/claude-code/mcp, fetched 2026-09-10.
Remote HTTP server (recommended):
# Basic syntax
claude mcp add --transport http <name> <url>
# Real example
claude mcp add --transport http notion https://mcp.notion.com/mcp
# With bearer token
claude mcp add --transport http secure-api https://api.example.com/mcp \
--header "Authorization: Bearer your-token"
Local stdio server (runs as a process on your machine):
# Basic syntax
claude mcp add [options] <name> -- <command> [args...]
# Real example with env var
claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable \
-- npx -y airtable-mcp-server
The -- separates Claude’s own flags from the server’s command. Without it, Claude Code tries to parse the server’s flags as its own. Server names accept only A-Z, a-z, 0-9, -, _; other characters fail.
Then check status:
claude mcp list # all servers with health icons
claude mcp get <name> # one server, with failure detail
/mcp # in-session panel; auth flows too
Install in Claude Desktop
Claude Desktop reads claude_desktop_config.json from your OS-specific config path. Same MCP servers, different file shape. Example matching the official GitHub MCP remote URL from that catalog page:
{
"mcpServers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/"
}
}
}
Restart Claude Desktop after editing. Tools from the server appear in your next conversation.
Configuration scopes (Claude Code)
| Scope | File | Shared with team | Use case |
|---|---|---|---|
local (default) | ~/.claude.json (per-project) | no | personal dev servers, secrets not in git |
project | .mcp.json at repo root | yes (commit it) | team-shared toolchain |
user | ~/.claude.json (top level) | no | cross-project utilities |
Add scope with --scope project or --scope user. A cloned repo cannot pre-approve its own project servers — .mcp.json approvals stay at ⏸ Pending approval until you trust the workspace. On duplicate names across scopes, higher-precedence wins; fields are not merged.
${VAR} and ${VAR:-default} expand in command, args, env, url, and headers. A reference to an unset variable without a default still loads the server with the literal ${VAR} text — Claude Code warns and you get an unconfigured server.
Gotchas (from this fetch)
urlwith notypeis a misconfiguration. Claude Code reads an entry with notypeas stdio and skips the server. Add"type": "http"(or"sse"/"ws"). Instream-jsonruns, skipped entries surface in thesystem/initevent’smcp_server_errorsfield so scripts can detect them (v2.1.219+).- OAuth is per-endpoint, not per-name. Define the same name in two scopes with different endpoints and authenticating one does not authenticate the other. Use
claude mcp remove <name> --scope <scope>to drop the loser. - Hidden whitespace breaks tokens. A trailing newline pasted into a header or env value triggers a Claude Code warning. It does not trim — edit the file.
- Reserved names.
workspace,claude-in-chrome,computer-use,Claude Preview,Claude Browserare reserved.claude mcp addrejects them; a config that defines them gets skipped at load. - Missing env var without
:-defaultstill loads the server. Claude Code warns and uses the literal${VAR}text unexpanded. - SSE is deprecated. New servers should expose HTTP. Claude Code tries HTTP first and falls back to SSE for endpoints that don’t accept HTTP (v2.1.265+). For older versions or strict SSE, pass
--transport sse. - WebSocket needs
add-json.claude mcp add --transportdoes not acceptws. Useclaude mcp add-json name '{"type":"ws","url":"wss://…","headers":{…}}'. - v1 vs v2 runtime. Claude Code v2.1.232+ uses the v2 runtime (MCP TypeScript SDK 2.0, protocol revision
2026-07-28) on most hosts. Bedrock, Vertex-style host platforms, and signed-in-through-gateway sessions fall back to v1. Pin withMCP_SDK_GENERATION=v1|v2. Servers that negotiate the newer revision can’t deliver channel messages — setMCP_PROTOCOL_NEGOTIATION=legacyfor channel servers. - Per-server tool timeout.
"timeout": 600000in.mcp.jsonoverridesMCP_TOOL_TIMEOUTfor that one server. Idle timeout defaults to 5 minutes (HTTP/SSE/WS/claude.ai connector) or 30 minutes (stdio). Tune withCLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT. - Trust every server before you connect. Servers that fetch external content expose you to prompt-injection risk. The docs warn about this explicitly. A read-only DB user for any data-pointing server is the cheapest fix you will not regret.
Where the spec lives
Anthropic co-publishes MCP at modelcontextprotocol.io. The authoritative definition is the Specification, with the JSON-RPC 2.0 message schema in schema.ts. Anthropic’s product docs are mirrored on docs.claude.com and docs.anthropic.com (same content). For the catalog of reviewed remote servers Anthropic lists, see the Claude Directory; each entry works with claude mcp add directly.
Related
- MCP Servers Explained — protocol concepts and the broader catalog
- Best MCP Servers — allowlist grounded in this session’s fetch
- GitHub MCP Server — reference install example
- Claude Code getting started — first-hour Claude Code setup
- Claude CLI — the
claudebinary that hostsclaude mcp add
Stars, install counts, and Anthropic’s server-version numbers are omitted until we fetch them this session. Untested here.
## embed this badge
