MCP over stdio or Streamable HTTP: how a team's coding agents should connect
Every MCP server your coding agents use is reached over a transport. Most people pick whichever line the server's README shows first. For one developer that is fine. For a team, the transport decides some things you will
Every MCP server your coding agents use is reached over a transport. Most people pick whichever line the server's README shows first. For one developer that is fine. For a team, the transport decides some things you will care about later: whose account the server acts as, whether a config file can be committed, what happens when someone leaves, and where the record of what the agent did ends up.
The MCP specification (version 2025-11-25) defines two standard transports: stdio and Streamable HTTP. This post explains both from the transports page of the specification, then looks at them from the point of view of a team running Claude Code, Codex and Cursor.
stdio: the server is a subprocess of the agent
With stdio, the client launches the MCP server as a subprocess. They exchange newline-delimited JSON-RPC messages over the server's standard input and output, and the server may write logs to standard error.
What follows from that:
- It runs where the agent runs, as the agent's user. If Claude Code runs on your laptop, a stdio server it starts runs on your laptop, with your files, your environment and your network.
- Credentials come from the environment. The specification's authorization page says implementations using stdio should not follow its OAuth flow and should instead retrieve credentials from the environment. In practice that means an API key or token in an environment variable, or a CLI that is already signed in.
- It is installed per machine. Each person, or each agent machine, installs and updates the server binary or package.
- Its lifetime is the session's. The client starts it and stops it.
Streamable HTTP: the server is a service the agent calls
With Streamable HTTP, the server is an independent process that can handle many clients, reached at a single MCP endpoint such as https://example.com/mcp that accepts POST and GET. It can stream messages with Server-Sent Events. A server may assign a session id in an MCP-Session-Id header at initialization, which the client then sends on later requests.
What follows from that:
- It runs somewhere else. The agent's machine only needs to reach the endpoint.
- Sign-in can be per person. HTTP-based transports should follow the specification's authorization flow, which is OAuth. Each person signs in as themselves in the browser, and the client holds the token.
- Nothing to install on each machine beyond the client itself, and the server is updated in one place.
-
The specification asks servers for some care. Servers must validate the
Originheader, should bind to 127.0.0.1 when running locally, and should authenticate all connections.
What changes for a team
| Question | stdio | Streamable HTTP |
|---|---|---|
| Where does the server's code run? | On the agent's machine, as its user | On the server's host |
| How does it authenticate? | Credentials in the environment | OAuth sign-in per person (when the server supports authorization) |
| Can the client config be committed? | Only if it holds no secret | Usually, since the config is just a URL |
| What happens when someone leaves? | Revoke whatever key their environment held | Revoke their sign-in |
| Who updates it? | Every machine | The server's operator |
Three practical consequences:
Committed config is easier with HTTP. A project-level MCP config that points at a URL holds no secret, so it can live in the repository, and each person's client signs in as them. A stdio config that needs an API key in it cannot be committed, so each person keeps their own copy, and they drift.
A stdio server inherits the agent's reach. Whatever the agent's machine can read, a stdio server started by the agent can read. That is the strongest argument for running coding agents on their own machines rather than on laptops: a stdio server then runs next to the agent's checkout, not next to your SSH keys. Our post on running untrusted MCP servers in a microVM goes further into that.
Records differ. With HTTP, every call goes through a service that can record it per person. With stdio, the record is whatever the server and the client log on that machine.
Neither transport is better in general. stdio is the right choice when the server must act on the agent's own machine: its files, its processes, a CLI signed in there. HTTP is the right choice for shared services the whole team uses.
How Sandscale offers both
Sandscale's MCP server comes in both forms, and they are not identical. Our post on choosing between Sandscale's two MCP servers compares them tool by tool; in short:
-
Remote, over Streamable HTTP, at
https://mcp.sandscale.dev/mcp. Clients sign in with OAuth in the browser, and no secret goes in the config.sandscale mcp connectprints how to add it to Claude Code, Codex, Cursor, VS Code or Windsurf:
sandscale mcp connect codex
-
Local, over stdio:
sandscale mcp, which comes with the Sandscale CLI (1.4.1) and uses yoursandscale login. The CLI's help describes adding it to a coding tool as a stdio server with the commandsandscaleand the argumentmcp. For Claude Code, the Quickstart shows this form:
claude mcp add sandscale -- sandscale mcp
Either way, calls go through the same API, permissions, plan limits and audit log. For calls through the remote server, the audit log records the tool, the region, the outcome and the app, never the arguments.
A rule of thumb
- Shared services, one URL, everyone signs in as themselves: Streamable HTTP.
- Tools that must act on the agent's own machine: stdio, and put that agent on a machine of its own.
- Never commit a config file that contains a key, whichever transport it is for.
Originally published on the Sandscale blog.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.