guides · featured

Claude MCP — How Claude Code attaches Anthropic's MCP

Install and configure Anthropic's Model Context Protocol in Claude Code and Claude Desktop — transport options, scopes, OAuth, and gotchas. Source: docs.claude.com, fetched 2026-09-10.
by cache.directory updated Sep 10, 2026 CC-BY-4.0

## 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)

ScopeFileShared with teamUse case
local (default)~/.claude.json (per-project)nopersonal dev servers, secrets not in git
project.mcp.json at repo rootyes (commit it)team-shared toolchain
user~/.claude.json (top level)nocross-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)

  • url with no type is a misconfiguration. Claude Code reads an entry with no type as stdio and skips the server. Add "type": "http" (or "sse" / "ws"). In stream-json runs, skipped entries surface in the system/init event’s mcp_server_errors field 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 Browser are reserved. claude mcp add rejects them; a config that defines them gets skipped at load.
  • Missing env var without :-default still 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 --transport does not accept ws. Use claude 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 with MCP_SDK_GENERATION=v1|v2. Servers that negotiate the newer revision can’t deliver channel messages — set MCP_PROTOCOL_NEGOTIATION=legacy for channel servers.
  • Per-server tool timeout. "timeout": 600000 in .mcp.json overrides MCP_TOOL_TIMEOUT for that one server. Idle timeout defaults to 5 minutes (HTTP/SSE/WS/claude.ai connector) or 30 minutes (stdio). Tune with CLAUDE_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.

Stars, install counts, and Anthropic’s server-version numbers are omitted until we fetch them this session. Untested here.

## embed this badge

cache ✓ in cache.directory
![cached](https://cache.directory/badge/claude-mcp.svg)