Model Context Protocol — What and Why
MCP connects Claude to external tools through a standard protocol. The architecture before you install your first server.
Claude Code is powerful on its own, but it hits a wall the moment it needs something outside your project. Customer data in a database. Tickets in JIRA. Errors in Sentry. Designs in Figma. Without a way to reach those systems, you're the integration layer, copying and pasting context into the conversation like it's 2019. Gets old fast.
MCP (Model Context Protocol) is the fix. An open source standard that lets AI tools connect to external data sources and APIs through a shared protocol. Think USB-C for AI integrations. One plug, hundreds of devices.
The Problem
Before MCP, every AI tool built its own integrations from scratch. GitHub? Custom integration. Postgres? Another one. Every combination of AI tool and external service required unique glue code. N tools times M services equals N times M integrations. Totally unsustainable.
MCP collapses that. A standard protocol both sides speak. An MCP server wraps any external service in a consistent interface. Any AI tool that speaks MCP connects to any MCP server. Build once, use everywhere. Over 500 integrations already exist on GitHub, and the number keeps climbing.
Architecture in 60 Seconds
Three parts. Claude Code is the client. The MCP server is a lightweight process wrapping an external service. The transport is how they talk to each other.
When you connect a server, it tells Claude Code what it can do through three types of capabilities. Tools are actions: "query this database," "create a JIRA ticket." Resources are readable data: files, API responses. Prompts are pre-written templates for structuring common interactions.
Discovery is automatic. Connect a server and Claude Code sees the available tools. No manual configuration. It'll use them when they're relevant to your task.
Transport Types
Three transport options.
stdio is for local servers. The MCP server runs as a child process on your machine, communication happens through stdin/stdout. Most common setup for development tools. No network, everything stays local.
HTTP is the recommended transport for remote servers. Server lives on the internet, Claude Code talks to it over HTTP with server-sent events for streaming. Supports OAuth 2.0, so you just go through a normal login flow the first time.
SSE is the older streaming transport. Still works, but HTTP is the path forward. If you see SSE in older tutorials, mentally swap it for HTTP.
Configuration Scopes
Where you store the configuration matters more than you'd think, especially on teams.
Local scope (the default) configures the server just for you, in your current project. Not committed to version control.
Project scope saves to .mcp.json at the project root. Gets committed to git, so everyone on the team gets the same servers when they clone. This is how you standardize tooling across a team.
User scope makes the server available across all your projects. Good for personal databases or tools you use everywhere.
Set scope with claude mcp add --scope. Manage servers with claude mcp list, claude mcp get, claude mcp remove. Inside a session, /mcp shows connection status for everything.
Try It
You don't need to install anything to see MCP in action. Check if any servers are already configured:
claude mcp listNothing there? Expected. Try adding one. Say your team has a shared MCP server for a staging database:
claude mcp add my-db-server --transport http --url https://mcp.example.com/dbStart a Claude Code session, type /mcp, verify it shows up. Then you can ask things like "query the users table for accounts created in the last week" and Claude Code uses the MCP server's tools to run that query directly.
For local servers, use stdio transport:
claude mcp add my-local-tool --transport stdio -- npx some-mcp-serverThe -- separates the claude mcp add flags from the command that actually starts the server process.
Output Limits and Tool Search
Two practical details worth knowing. MCP tool output has size limits: warning at 10,000 tokens, hard cap at 25,000. Adjust with MAX_MCP_OUTPUT_TOKENS if your servers return large payloads.
When you've got many servers configured, Claude Code uses Tool Search to load tools on demand instead of dumping everything into context at startup. Keeps the window clean. You don't pay for tools you aren't using.
Referencing MCP Resources
MCP servers can expose resources (readable data) that you reference with @ syntax:
@server-name:protocol://path/to/resource
Pulls resource content directly into the conversation. Documentation, config files, API specs, whatever the server exposes.
Claude Code as an MCP Server
This one's fun. Claude Code can itself act as an MCP server. Run claude mcp serve and it starts in server mode, exposing its capabilities through MCP. Other MCP-compatible tools can use Claude Code as a backend. Turtles all the way down.
The Short Version
- MCP is an open standard connecting AI tools to external services, replacing custom integrations
- Servers expose tools, resources, and prompts; Claude Code discovers them automatically
- Three transports: stdio (local), HTTP (remote, recommended), SSE (legacy)
- Configuration scopes control sharing: local (just you), project (team via git), user (all your projects)
- 500+ integrations and growing
Mastering Claude Code
Lesson 56 of 70