Agents, Tool Use & MCP·Question 26 of 90Intermediate

Compare MCP's transports. When would you choose each?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

MCP defines two supported transports: stdio and Streamable HTTP, both carrying JSON-RPC 2.0 messages.

Full worked answer

MCP defines two supported transports: stdio and Streamable HTTP, both carrying JSON-RPC 2.0 messages.

stdio: the host launches the server as a local subprocess and exchanges messages over stdin/stdout. Properties: zero network surface, no auth machinery needed (the process inherits your local user's privileges and environment), trivial to develop and debug, near-zero latency overhead. It's the right choice for local, single-user integrations - filesystem access, local git, a dev database, CLI wrappers. Two implications worth stating in an interview: (1) the security model is "whatever your OS user can do, the server can do" - that's convenient and dangerous, since a malicious stdio server is arbitrary local code execution; (2) it's inherently 1:1 - one host, one server instance, no sharing across users or machines.

Streamable HTTP: the server exposes a single HTTP endpoint; clients POST JSON-RPC messages, and the server can respond directly or upgrade to an SSE stream for progressive/multi-message responses. This replaced the original HTTP+SSE transport (which needed two endpoints and mandatory long-lived connections) in the 2025-03-26 spec revision, a redesign that made servers stateless-friendly and easier to run behind ordinary load-balanced infrastructure. The current revision, 2026-07-28, finishes that job at the protocol level: the initialize/initialized handshake and the Mcp-Session-Id header are gone, each request carries its own protocol version, identity and capabilities, so no session affinity is required and any request can land on any instance behind a plain load balancer with no shared session store. Choose it for anything remote or shared: SaaS-hosted MCP servers, internal services used by a whole team, multi-tenant deployments. It's where real auth lives - the spec defines OAuth-based authorization for protected servers - plus standard HTTP operational tooling (TLS, gateways, rate limiting, observability).

Decision rule: local personal tooling → stdio; anything crossing a machine or trust boundary → Streamable HTTP. A common production pattern is developing against stdio and deploying the same server logic behind Streamable HTTP, since most SDKs abstract the transport.

On revision skew: the spec now carries a formal feature lifecycle (active, deprecated, removed), with at least twelve months between deprecation and the earliest possible removal. Sampling, roots and logging, all deprecated in 2026-07-28, are on that clock now. That window is what lets you carry several client revisions at once instead of cutting anyone off on release day.

What a good answer covers

  • MCP defines two supported transports: stdio and Streamable HTTP, both carrying JSON-RPC 2.0 messages
  • stdio: the host launches the server as a local subprocess and exchanges messages over stdin/stdout
  • Properties: zero network surface, no auth machinery needed (the process inherits your local user's…
  • It's the right choice for local, single-user integrations - filesystem access, local git, a dev…
  • Streamable HTTP: the server exposes a single HTTP endpoint; clients POST JSON-RPC messages, and the…

Key terms: stdio · Streamable HTTP

Interviewer follow-ups to expect

  1. Why was mandatory long-lived SSE a problem for serverless deployments?

  2. How does session state work over Streamable HTTP if the server is stateless?

  3. You maintain an MCP server with clients on three different revisions. How do you handle negotiation and deprecation?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep