← Claude Docs

Connect to MCP servers - Claude Code Docs

Claude Docs · June 1, 2026
The Model Context Protocol (MCP) extends Claude Code's capabilities by connecting external tools through servers that can run locally or as hosted services, such as issue trackers, databases, and browsers. Servers are connected using the `claude mcp add` command, with configurations saved to .claude.json or .mcp.json depending on the chosen scope (local, project, or user). Different server types including HTTP-based hosted services, local stdio processes, and OAuth-authenticated applications can be added, verified, and configured either through CLI commands or by manually editing configuration files.

Detailed Analysis

Claude Code's documentation for connecting to Model Context Protocol (MCP) servers outlines a structured approach to extending the AI coding assistant's capabilities beyond its built-in toolset. MCP enables Claude Code to interact with external systems — including issue trackers, databases, and web browsers — by connecting to servers that expose specialized tools. The documentation walks users through an end-to-end setup process using the Claude Code documentation server itself as a reference example, chosen specifically because it requires no authentication and offers full-text search over Claude Code's own documentation, making it an accessible entry point for developers new to the protocol.

A central organizational feature of the MCP integration is its three-tier scoping system, which governs where server configurations are stored and who can access them. Local scope registers a server privately within a single project, written to `~/.claude.json` under that project's entry. Project scope writes to an `.mcp.json` file in the project root, enabling shared configurations that teammates can access after cloning the repository and approving the server. User scope registers a server globally across all of a developer's projects while keeping it private. This granular permission model reflects Anthropic's effort to balance convenience with security, particularly relevant in team environments where shared tooling must be explicitly approved before taking effect.

The documentation distinguishes between two primary server types: hosted servers accessed over HTTP URLs, and local stdio servers that Claude Code launches as subprocesses on the user's machine. The hosted category includes services like Sentry, Linear, and Notion, which typically require OAuth browser-based authentication flows. The local category, exemplified by the Playwright MCP server, gives Claude Code access to system-level resources such as the filesystem, local databases, or a controllable browser instance. This distinction is architecturally significant — local servers expand Claude Code's reach into the developer's own environment, while hosted servers integrate it into broader organizational toolchains.

The documentation's treatment of `.mcp.json` as "configuration-as-code" reflects a broader pattern in developer tooling toward reproducible, version-controlled environments. By committing the project-scope configuration file to a repository, teams can standardize which MCP tools are available across contributors without requiring manual setup on each machine. This approach mirrors conventions established by tools like Docker Compose or `.devcontainer` configurations, positioning MCP server management as a first-class concern in software project infrastructure rather than an ad-hoc per-developer customization.

The release and documentation of MCP connectivity in Claude Code arrives amid a wider industry movement to standardize how AI agents interact with external tools and services. Anthropic's development of MCP as an open protocol — and its publication of a public directory of compatible servers — signals an attempt to build a durable ecosystem around Claude's agentic capabilities rather than relying on proprietary integrations. As AI coding assistants evolve from autocomplete tools toward autonomous development agents capable of managing entire workflows, the ability to compose and configure external tool access in a principled, team-friendly way becomes a foundational requirement, and Claude Code's MCP documentation represents a concrete step in that direction.

Read original article →