Skip to content
GitHubDiscordThreads

MCP Transports

Featurestdiosse (Server-Sent Events)streamable-http
Bidirectional❌ No❌ No✅ Yes
ProtocolOS-level stdin/stdout over TCPHTTP (one-way stream over HTTP/1.1)HTTP (usually chunked transfer or HTTP/2/3)
Data FormatText (line-delimited), JSONJSON/Text (EventStream)Arbitrary bytes, JSON, binary, I/O streams
Latency🟢 Low (no network)🟡 Medium (HTTP overhead, server push model)🟢 Low-to-medium (depends on server impl)
Streaming Support⚠️ Simulated (by polling stdout)✅ Yes (server pushes tokens as events)✅ Yes (true duplex stream)
Transport Overhead🟢 Minimal🟡 Medium (HTTP headers, reconnection)🟡 Higher (duplex control, buffers)
Concurrency❌ Usually single process/thread✅ Supported with multiple HTTP connections✅ Natively concurrent
Error Handling❌ Basic (process exit codes)🟡 Limited (need to parse events)✅ Custom error/status codes possible
Tooling Complexity🟢 Simple subprocess🟡 Moderate (SSE client lib required)🔴 High (custom protocol or server code needed)
Server ImplementationCLI app or local executableWeb server with SSE supportCustom backend (e.g., FastAPI with async streams)
Ideal Use CaseLocal models or CLI toolsHosted LLMs with streaming (e.g., OpenAI)Agent/toolchain with rich, stateful interaction
Transport TypeIPC/OS process-basedUnidirectional HTTP streamBidirectional over HTTP
Compression Support❌ None⚠️ Limited (gzip encoding possible)✅ Full control over compression
Backpressure Handling❌ Minimal (buffer overflow risk)⚠️ Poor (SSE lacks flow control)✅ Good (can implement windowing/chunking)
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("Server1")
# start the server with default stdio transport
mcp.run(transport="stdio")
# start the server with streamable HTTP transport
mcp.run(transport="streamable-http")
# start the server with Server-Sent Events (SSE) transport
mcp.run(transport="sse") # http://127.0.0.1:8000/sse
from langchain_mcp_adapters.client import MultiServerMCPClient
client = MultiServerMCPClient(
{
"server1": {
"command": "python",
"args": ["server1.py"],
"transport": "stdio",
},
"server2": {
"url": "http://localhost:8000/mcp",
"transprot": "streamable_http"
},
"server3":{
"url": "http://localhost:8000/sse",
"transport": "sse"
}
}
)