Study FAQ
When should an MCP server use stdio, Streamable HTTP, or a custom transport?
Also asked as 2
- What are the standard transports in MCP 2026-07-28?
- Is SSE or a socket a standard alternative to stdio for a new MCP server?
Answer
Use stdio for a local server the host launches as a subprocess. Use Streamable HTTP for a separately reachable service. These are the two standard transports for MCP 2026-07-28. Choose a custom binding such as a Unix socket only when a concrete deployment requirement outweighs the loss of standard client interoperability.
With stdio, exchange newline-delimited UTF-8 JSON-RPC over stdin and stdout and send diagnostics to stderr. Launch only an approved executable and arguments with a restricted environment and appropriate access. The HTTP OAuth flow should not be used for stdio; obtain credentials through the process environment when needed.
With Streamable HTTP, send JSON-RPC messages by POST to the MCP endpoint with the required headers and matching body metadata. Responses can be JSON or request-scoped SSE, including a subscription response stream where supported. The separate HTTP+SSE binding from 2024-11-05 is deprecated. Validate Origin according to the binding, use protected transport and authentication for remote deployments, and keep local-only endpoints on loopback.
A custom binding must preserve JSON-RPC message directions and per-request metadata. Specify framing, setup, cancellation, and failure handling. The spec recommends reusing stdio’s newline framing for reliable bidirectional byte streams such as Unix sockets or TCP.
Full explanation
MCP Server Development and Choosing Between Tools, Skills, and MCP
Study guide · CCDV-F
Read the full explanation