CC-301j · Module 1
Protocol Architecture
4 min read
The Model Context Protocol (MCP) is a standard for connecting AI models to external tools and data sources. The architecture is client-server: Claude Code is the client, your MCP server provides the tools. The protocol defines how the client discovers available tools, how it invokes them, and how the server returns results. Think of it as a REST API designed specifically for AI tool use — structured inputs, structured outputs, and a schema that tells the model exactly what each tool does.
The communication happens through one of two transports: stdio (standard input/output) for local servers, or SSE (Server-Sent Events over HTTP) for remote servers. Stdio servers run as child processes of Claude Code — fast, no network latency, but limited to the local machine. SSE servers run anywhere on the internet — higher latency, but accessible from any Claude Code session and shareable across teams. The transport choice is an architecture decision: stdio for development tools, SSE for shared data sources.
- Stdio Transport The server runs as a child process. Communication is through stdin/stdout pipes. Zero network latency. Best for: local development tools, file system operations, CLI wrappers. Limitation: runs only on the developer's machine.
- SSE Transport The server runs as an HTTP service. Communication is through Server-Sent Events. Network latency applies. Best for: shared databases, external APIs, team-wide tools. Advantage: one server serves all team members.
- The Discovery Protocol On connection, the client asks the server: "What tools do you provide?" The server responds with a list of tool definitions — name, description, and JSON Schema for inputs. The client uses these definitions to decide when and how to invoke each tool.