Transport
In MCP, a Transport is the physical or logical communication channel that carries JSON-RPC messages between a client and a server. MCP is designed to be transport-agnostic, meaning the protocol logic remains the same regardless of how the bytes are moved.
Supported Transports
- Stdio: Used for local server processes.
- SSE (Server-Sent Events): Used for remote, HTTP-based servers.
- WebSockets: (Experimental/Community) Used for low-latency, bidirectional network communication.
The transport layer handles the specifics of establishing a connection, framing messages, and ensuring reliable data delivery.
Questions & Answers
What is the "Transport" layer in the Model Context Protocol?
The Transport layer is the physical or logical communication channel—such as SSE or Stdio—that carries JSON-RPC messages between a client and a server. MCP is designed to be transport-agnostic, keeping protocol logic separate from the movement of bytes.
Name the two primary transport mechanisms supported by official MCP SDKs.
The two primary mechanisms are Stdio, which is used for local server processes, and SSE (Server-Sent Events), which is used for remote communication over standard HTTP connections.
Why is it useful that MCP is "transport-agnostic"?
Being transport-agnostic means the protocol’s core logic for tools and resources remains identical regardless of the underlying connection method. This allows developers to switch between local development (Stdio) and remote production (SSE) without rewriting their server logic.