Transports
Compare the stdio, web (SSE), streamable-http and cloudflare-worker transports and pick the right one for your MCP server.
By Harsha VardhanUpdated
Choose a transport with --transport (or -t). The default is stdio.
Generated servers speak MCP 2026-07-28 (stateless requests, server/discover) and keep serving 2025-era clients that open with initialize, using the MCP TypeScript SDK v2. The web (SSE) transport stays on the 2025-era protocol because the specification deprecates HTTP+SSE; prefer streamable-http for new deployments.
stdio#
Communicates with MCP clients over standard input and output. Ideal for local development and desktop clients that launch the server as a process. The server picks the protocol era from each connection's opening message.
openapi-mcp-generator -i ./openapi.json -o ./my-mcp
cd my-mcp && npm install && npm startweb (SSE)#
Launches an HTTP server built with Hono that uses Server-Sent Events for server-to-client messages and a REST endpoint for client-to-server messages. Supports multiple connections and serves the browser playground at /.
openapi-mcp-generator -i ./openapi.json -o ./my-mcp --transport=web --port=3000
cd my-mcp && npm install && npm run start:webstreamable-http#
Implements the MCP Streamable HTTP transport, also built with Hono:
- Stateless JSON-RPC over HTTP: every request gets a fresh server, so it scales behind any load balancer.
- Serves MCP 2026-07-28 and 2025-era clients. 2025-era clients run without sessions, and
GETandDELETEon the endpoint answer405. - Proper HTTP status codes, and the browser playground at
/.
openapi-mcp-generator -i ./openapi.json -o ./my-mcp --transport=streamable-http --port=3000
cd my-mcp && npm install && npm run start:httpcloudflare-worker#
Generates a complete Cloudflare Workers project that serves the MCP server over Streamable HTTP at /mcp, using createMcpHandler from @modelcontextprotocol/server.
- Stateless, and runs on the free Workers tier with no Durable Objects or KV. A fresh MCP server is created per request.
- Lean dependencies:
@modelcontextprotocol/serverand@cfworker/json-schema. - Uses the global
fetch, and validates arguments against the JSON Schema with no code generation and noeval. - Answers CORS on
/mcp, so browser-based MCP clients such as the hosted playground can reach it. Access is still controlled by theAuthorizationheader. - Serves the browser playground at
/.
See Deploy to Cloudflare Workers.
Comparison#
| Feature | stdio | web (SSE) | streamable-http | cloudflare-worker |
|---|---|---|---|---|
| Protocol | JSON-RPC over stdio | JSON-RPC over SSE | JSON-RPC over HTTP | Streamable HTTP at /mcp |
| Connection | Persistent | Persistent | Request/response | Request/response |
| Multiple clients | No | Yes | Yes | Yes |
| Browser compatible | No | Yes | Yes | Yes |
| Firewall friendly | No | Yes | Yes | Yes |
| Load balancing | No | Limited | Yes | Yes (edge) |
| Status codes | No | Limited | Full HTTP codes | Full HTTP codes |
| Browser playground | No | Yes | Yes | Yes |
| Hosting | Local | Self-hosted | Self-hosted | Cloudflare (serverless) |
Browser playground#
Servers generated for web, streamable-http and cloudflare-worker serve a playground at / (http://localhost:<port>/, or http://localhost:8787/ with npm run dev for a Worker). It lists the tools, builds a form for each one from its input schema, runs it and shows every JSON-RPC message. See Connect clients.
To stop serving it, for example in production:
- Node servers (
web,streamable-http): setMCP_PLAYGROUND=offin the environment or.env. - Workers: set the
MCP_PLAYGROUNDvar to"off"inwrangler.jsoncundervars.