Optional

MCP Integration

Model Context Protocol — connecting Claude to external tools and data

~4 min read

0

MCP client files

0+

MCP LOC

0

Transport types

MCP (Model Context Protocol) is like a universal adapter for AI tools. Just as USB-C lets you connect any device to your computer, MCP lets Claude connect to any external service — databases, APIs, cloud platforms, or custom tools.

Instead of building every integration into Claude Code directly, MCP provides a standard way for external servers to expose tools, data, and prompts. You install an MCP server (like a database connector), and Claude automatically discovers and can use its tools.

MCP Architecture #

How Claude Code connects to external services

Transport Types #

Three ways to connect to MCP servers

⟨ stdin | stdout ⟩

stdio

Spawns a local process and communicates via stdin/stdout. Best for local tools (file system, database). Zero network overhead.

POST → SSE ⟶

SSE (Server-Sent Events)

HTTP-based streaming connection. Client sends requests via POST, receives streamed responses via SSE. Good for remote services.

HTTP/1.1 ≡≡≡

Streamable HTTP

Newer protocol using standard HTTP with streaming support. Most flexible transport for cloud-hosted MCP servers.

MCP Tools in Claude Code #

How MCP tools are exposed and used

MCPTool

Execute tools from connected MCP servers — the primary interface for Claude to call external functionality

ListMcpResources

Discover what resources (files, data, configs) an MCP server makes available

ReadMcpResource

Read content from a specific MCP resource by URI

McpAuth

Handle OAuth authentication flows for MCP servers that require authorization

These tools are automatically registered when MCP servers connect. Claude uses them like any built-in tool — with the same permission checks and orchestration.

← → arrow keys to navigate