Back to blog
November 16, 2026•21 views

MCP Transport stdio vs Streamable HTTP: Which One to Use (and When SSE Still Applies)

MCPModel Context ProtocolMCP transportstdioStreamable HTTPAI automationNode.jsdeveloper tutorial
MCP Transport stdio vs Streamable HTTP: Which One to Use (and When SSE Still Applies)

Every time I ship an MCP server for a client, the same question lands in my inbox within a week: "Why does this work locally but fall over when I deploy it?" Nine times out of ten the answer is the MCP transport. People build a working stdio server, hand it to a teammate, and then wonder why their web app can't talk to it. So let me lay out the MCP transport stdio vs streamable HTTP decision the way I actually make it on real projects, with code for both, and a straight answer on where SSE fits now.

I've built MCP servers that run as local subprocesses inside Claude Desktop and others that sit behind a Node.js API on AWS serving a whole team. The transport choice shaped the architecture, the auth model, and how much of my weekend I lost to debugging. Here's the short version first, then the detail.

TL;DR: the MCP transport decision at a glance

If the client and server live on the same machine, use stdio. If anything crosses a network boundary, use Streamable HTTP. SSE is legacy: it still works in older clients, but it's not where you should build anything new.

Factor stdio Streamable HTTP
Where it runs Local subprocess of the client Remote server over a network
Networking involved None HTTP/HTTPS
Typical clients Claude Desktop, CLI tools, IDE plugins Web apps, mobile apps, multi-user backends, CI
Auth model Inherits local process trust You must build it (tokens, OAuth, mTLS)
Multi-client support One client per process Many clients, one server
Scaling Scale by spawning processes Horizontal scaling, load balancers
Statefulness Naturally stateful per process Session-based, needs explicit handling
Latency Near zero (pipes) Network round trips
Deployment None, ships with the client Docker, Kubernetes, cloud hosting
Best for Developer tooling, desktop, local automation Products, teams, anything user-facing

That table is the whole article in miniature. The rest is the "why" and the "how", because the tradeoffs get sharp once you're past hello world.

First, a quick refresher on what a transport is in MCP

The Model Context Protocol separates the message format (JSON-RPC 2.0) from how those messages travel. The transport is just the pipe. The same tools/list, tools/call, and resources/read messages flow over either pipe. That separation is why you can often reuse your handler logic and swap only the transport layer.

The official spec defines two standard transports: stdio and Streamable HTTP. SSE (Server-Sent Events) was an earlier remote transport that's since been superseded. I'll get to SSE properly, because the migration traffic around it is real and the confusion is genuine.

stdio: the local workhorse

In the stdio transport, the client launches your MCP server as a subprocess and talks to it over the process's standard input and output. No sockets, no ports, no TLS. Just pipes.

The spec's guidance is blunt: clients should support stdio whenever possible. That's because it's the simplest possible thing that works for local tools.

What stdio looks like in Node.js

Here's a minimal stdio server. I'm using the official TypeScript SDK, which handles the JSON-RPC framing for you.

// server-stdio.js
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";

const server = new McpServer({ name: "weather-local", version: "1.0.0" });

server.tool(
  "get_forecast",
  { city: z.string() },
  async ({ city }) => {
    // your real logic here
    return {
      content: [{ type: "text", text: `Forecast for ${city}: 31C, humid.` }],
    };
  }
);

const transport = new StdioServerTransport();
await server.connect(transport);

Two rules I've learned the hard way:

  • Never write logs to stdout. stdout is the protocol channel. A stray console.log corrupts the stream and the client throws cryptic parse errors. Log to stderr instead, which is safe.
  • The process lives and dies with the client. If the client crashes, your server dies with it. That's a feature, not a bug, for local tools.

When stdio is the right call

  • Desktop clients like Claude Desktop, where the server is a bundled helper.
  • CLI and developer tooling where the user already has the runtime installed.
  • Local automation that touches the filesystem, local databases, or the user's machine.
  • Anything where you don't want to run infrastructure.

The killer advantage is trust inheritance. The server runs with the user's own permissions. There's no token to leak because there's no network to cross.

Streamable HTTP: the remote standard

Streamable HTTP is the transport for servers that live somewhere else. The client sends JSON-RPC messages via HTTP POST, and the server can respond either with a single JSON response or with an SSE stream for streaming multiple messages back. It supports sessions, resumability, and multiple concurrent clients.

This is the transport you reach for when the server is a product, not a local helper. If you want the full production picture, my guide to building a production MCP server in Next.js covers auth, tool schemas, observability, and deployment end to end.

What Streamable HTTP looks like in Node.js

Same tool, different pipe. Notice how little the handler logic changes.

// server-http.js
import express from "express";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
import { z } from "zod";

const app = express();
app.use(express.json());

function buildServer() {
  const server = new McpServer({ name: "weather-remote", version: "1.0.0" });
  server.tool(
    "get_forecast",
    { city: z.string() },
    async ({ city }) => ({
      content: [{ type: "text", text: `Forecast for ${city}: 31C, humid.` }],
    })
  );
  return server;
}

// One transport per session. Stateless mode is also supported.
const transports = new Map();

app.post("/mcp", async (req, res) => {
  const sessionId = req.headers["mcp-session-id"];
  let transport = sessionId ? transports.get(sessionId) : undefined;

  if (!transport) {
    transport = new StreamableHTTPServerTransport({
      sessionIdGenerator: () => crypto.randomUUID(),
      onsessioninitialized: (id) => transports.set(id, transport),
    });
    await buildServer().connect(transport);
  }

  await transport.handleRequest(req, res, req.body);
});

app.get("/mcp", async (req, res) => {
  const transport = transports.get(req.headers["mcp-session-id"]);
  if (!transport) return res.status(404).end();
  await transport.handleRequest(req, res);
});

app.listen(3000, () => console.error("MCP server on :3000"));

A few things I want you to notice, because they bite people:

  • Each session gets its own transport instance. If you reuse one transport across clients you'll get cross-talk and mysterious state bugs. I've seen this in production code more than once.
  • The session ID travels in the mcp-session-id header. Your load balancer needs to route by it (sticky sessions) or you need a shared session store. Round-robin across pods will break an active session.
  • handleRequest handles both the POST and the GET (SSE stream) cases. Don't reinvent the framing.

When Streamable HTTP is the right call

  • Web and mobile apps where the server is shared by many users.
  • Team or org-wide tools where one deployment serves everyone.
  • CI pipelines and cloud functions that need to call the server over the network.
  • Anything where you want centralized logging, rate limiting, and access control.

The cost is that you now own infrastructure: auth, CORS, session handling, scaling, and uptime. That's the real tradeoff, not the protocol details.

SSE: the deprecated transport, and when it still applies

SSE was the original remote transport. It worked, but it had structural problems: a long-lived connection per client, awkward bidirectional messaging, and no clean story for resumability. The protocol maintainers replaced it with Streamable HTTP, which folds the streaming behavior into a more flexible HTTP model with sessions and resumability built in. The spec's changelog documents the switch.

So, is SSE dead? For new builds, yes, treat it as deprecated. But it still applies in two situations:

  • You're integrating with an older client or SDK that only speaks SSE, and you can't upgrade it yet.
  • You're maintaining a server that predates the switch and a migration isn't worth the risk right now.

If you're starting fresh today, don't pick SSE. The migration path from SSE to Streamable HTTP is well-trodden and usually a smaller change than people fear. The framing differs, but your tool handlers stay put.

One naming note that trips up config files: different SDKs and adapters spell the transport differently. You'll see streamable_http, streamable-http, and streamableHttp in the wild. Check your client's config schema rather than guessing, because a wrong string silently fails to connect.

Migrating a stdio server to Streamable HTTP

This is the part most tutorials skip, and it's exactly where I get hired to help. You have a working stdio server and you need it reachable over the network. Here's the path I follow.

  1. Separate the server definition from the transport. Refactor your tools into a factory function like buildServer() above. This is the single most important step, because it lets one codebase serve both transports.
  2. Extract config and secrets. stdio servers often read local files or env vars. Move credentials to a proper secret store before the server leaves the machine.
  3. Add auth. stdio inherited trust. Streamable HTTP does not. Put a bearer token or OAuth in front of /mcp before you expose it. The spec's authorization guidance is the place to start.
  4. Handle sessions and scaling. Decide sticky sessions versus a shared store. Test with two clients hitting two pods.
  5. Keep stdio as a fallback if useful. You can ship both: stdio for local dev, Streamable HTTP for production. The factory makes this cheap.

That refactor into a factory is the difference between a two-hour migration and a two-week one. Do it first.

Security and ops: where the transports really diverge

This is the angle I wish existed when I started, so let me be specific.

stdio threat model

The server runs as the user, with the user's permissions. The main risks are the server doing something destructive with that access (think filesystem deletes, shell commands) and supply-chain risk from dependencies. There's no network attack surface, but there's also no isolation. If a tool can run shell commands, treat that server like any other code you'd run locally.

Streamable HTTP threat model

Now you have a network endpoint. That means:

  • Auth is mandatory, not optional. An unauthenticated MCP endpoint is an open door to your tools.
  • CORS matters if browsers call it. Lock down origins.
  • Rate limiting protects you from abuse and runaway loops.
  • Input validation on every tool argument, because the caller is no longer the user's own process.
  • Logging and audit trails, so you can see who called what.

For ops, Streamable HTTP introduces the usual distributed-systems concerns: session affinity, health checks, horizontal scaling, and graceful shutdowns that don't drop active sessions. stdio has none of that because there's no fleet, just a subprocess.

Two adjacent reads worth your time: my NIST cybersecurity guide for solopreneurs covers what to demand from whoever builds this for you, and Agent Skills Drift shows how to version and test tool definitions so your automation doesn't silently break after a deploy.

Which transport should you pick?

My rule, refined over a lot of client work: follow the network boundary. If the client and server share a machine, stdio. If they don't, Streamable HTTP. Don't overthink it beyond that.

A few concrete scenarios:

Scenario Transport Why
Claude Desktop helper for a founder's laptop stdio Local, no infra, inherits trust
Internal web dashboard for a team Streamable HTTP Shared endpoint, auth, logging
Mobile app calling AI tools Streamable HTTP Network, many users
CI job that runs checks Streamable HTTP Ephemeral, remote
Developer CLI that reads local repos stdio Filesystem access, local
Product feature with per-user data Streamable HTTP Access control, multitenancy

If you're building for a business in Dhaka, Sydney, or Toronto and the tools touch customer data, that last row is almost always your answer. The moment multiple users share a server, you need the network transport and the auth that comes with it. That's a real architectural decision, not a detail to defer.

And if you're weighing whether to buy a one-off script or a reusable, MCP-compatible integration, read MCP as the USB-C for AI tools before you sign anything.

FAQ

Q: Is SSE deprecated in MCP?

A: Yes, for new development. The protocol replaced SSE with Streamable HTTP, which handles streaming, sessions, and resumability more cleanly. SSE still works in older clients and existing servers, so you'll see it in the wild, but don't start new projects on it.

Q: Can one MCP server support both stdio and Streamable HTTP?

A: Yes, and I recommend it. Refactor your tools into a buildServer() factory and connect it to whichever transport you need. You get stdio for local dev and Streamable HTTP for production from a single codebase.

Q: Why does my stdio server break when I add logging?

A: Because stdout is the protocol channel. A console.log writes plain text into the JSON-RPC stream and corrupts it. Send logs to stderr instead, and the client will stay happy.

Q: Do I need auth for a Streamable HTTP MCP server?

A: Always, if it's reachable over a network. stdio inherits the user's local trust, but an HTTP endpoint is open to anyone who can reach it. Add a bearer token or OAuth, lock down CORS, and validate every tool argument.

Wrapping up

The MCP transport stdio vs streamable HTTP question comes down to one thing: does a network boundary exist between your client and server? If not, stdio is simpler and safer by default. If it does, Streamable HTTP is the standard, and you should budget real time for auth, sessions, and scaling. SSE is legacy, so migrate when you can.

If you're building an MCP server or AI automation for your business and want the transport and security decisions right the first time, that's exactly the kind of work I do. You can reach out through the contact page on this site and we'll figure out whether stdio, Streamable HTTP, or a hybrid fits your setup.

Frequently asked questions

Is SSE deprecated in MCP?

Yes, for new development. The Model Context Protocol replaced SSE with Streamable HTTP, which handles streaming, sessions, and resumability more cleanly. SSE still works in older clients and existing servers, so you'll encounter it, but don't start new projects on it.

Can one MCP server support both stdio and Streamable HTTP?

Yes, and it's the setup I recommend. Refactor your tools into a buildServer() factory and connect it to whichever transport you need. You get stdio for local dev and Streamable HTTP for production from a single codebase.

Why does my stdio MCP server break when I add logging?

Because stdout is the protocol channel. A console.log writes plain text into the JSON-RPC stream and corrupts it, causing cryptic parse errors in the client. Send logs to stderr instead.

Do I need authentication for a Streamable HTTP MCP server?

Always, if it's reachable over a network. stdio inherits the user's local process trust, but an HTTP endpoint is open to anyone who can reach it. Add a bearer token or OAuth, lock down CORS, and validate every tool argument before exposing it.

Which MCP transport should I use for a multi-user web app?

Streamable HTTP. Any time multiple users share one server, you need the network transport plus auth, session handling, and rate limiting. stdio is for local, single-user tools where the server runs as a subprocess of the client.

Share this post

Native Web Share is available on mobile, so that share sheet includes Instagram and any other app you have installed.

Let's Connect

Get In Touch

Let's build something premium together.

Contact info

Follow me
Chat on WhatsApp