httpstdio
- Bun
.listen(...)(default long-running server) - a portable
app.handler()fetch function via runtime adapters (Cloudflare, Vercel, Node)
How transport selection works
listen(3000)defaults to HTTPlisten({ port: ... })defaults to HTTPlisten({ transport: "stdio" })forces stdiolisten({ transport: "http" })forces HTTP
HTTP in practice
The HTTP transport gives you:- a network endpoint at
/mcp - MCP
2026-07-28: stateless requests (no session),server/discover,Mcp-Method/Mcp-Namerouting headers, list cache hints, MRTRinput_required, andsubscriptions/listen - legacy versions: session-aware client communication with
Mcp-Session-Idand Inspector-styleGETSSE - an optional health endpoint when enabled
- transport debug logs with
debug: true
stdio in practice
The stdio transport gives you:- a local command-based integration path
- no network port
- one strict rule: keep stdout clean for MCP messages
- the same protocol versions as HTTP, including
server/discoverand MRTR on2026-07-28
Compatibility notes
The HTTP transport negotiates multiple MCP protocol versions. Prefer2026-07-28 for scalable, load-balanced deployments. Older clients that speak initialize + sessions continue to work.