← Back to Dashboard
1. The Stdio Transport2. Streamable HTTP & SSE3. Stateless Architecture & Discovery (Spec 2026-07-28)

Streamable HTTP & SSE

📚 Transport Layers⏱ 8 min⭐ 60 XP⌨ Hands-on lab

Remote Connections (Current Spec)

If you want to host an MCP Server in the cloud (e.g., on Vercel or AWS) so multiple clients can connect, use the transport patterns documented in the MCP docs and spec. A common production pattern is Streamable HTTP with structured request/response handling.

How it Works

  1. The Client connects to the Server's HTTP endpoint.
  2. The Server establishes an SSE connection to push events to the Client asynchronously.
  3. The Client sends requests to the Server via standard HTTP POST requests.

This allows a single cloud-hosted MCP Server to serve thousands of Clients independently.

import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
app.post("/mcp", async (req, res) => {
  const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: undefined });
  await server.connect(transport);
  await transport.handleRequest(req, res);
});
// Legacy SSE transport (deprecated - use StreamableHTTPServerTransport for new servers):
// import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js";
⌨ HANDS-ON LABListen to Streamable HTTP Event Stream
⭐ +150 XP

Connect to a remote MCP HTTP endpoint using curl to listen for Server-Sent Events.

1Connect to the SSE endpoint passing the text/event-stream header.
lab-sandbox — simulated environment
INFINITY LAB SANDBOX v2.6 — simulated shell
Type the command for the current objective. Helpers: "hint", "solution", "clear".
$
OBJECTIVE 1 / 1 — type "hint" if stuck
🧪 Knowledge Check
Press 1-4 to select1 of 3
Which transport is best for cloud-hosted MCP servers that handle many users?
stdio
WebSockets
Streamable HTTP (SSE)
TCP/IP Direct