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, communicating via standard input/output streams.
- → Streamable HTTP: Used for remote, HTTP-based servers. Uses HTTP POST and GET requests, with optional Server-Sent Events (SSE) for streaming responses.
- → 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 Streamable HTTP 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 Streamable HTTP, which is used for remote communication over standard HTTP connections with optional Server-Sent Events for streaming.
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 (Streamable HTTP) without rewriting their server logic.