Transports: stdio and HTTP
MCP supports two transport mechanisms:
stdio — the server runs as a separate process on your machine and communication goes over standard input/output streams. No network overhead, so it is the fastest option. It typically serves a single client.
Streamable HTTP — client-to-server messages go over HTTP POST, and the server can use Server-Sent Events when streaming is needed. It is for remote servers and supports standard HTTP authentication: bearer tokens, API keys, custom headers. The official recommendation is to obtain tokens with OAuth. One server can serve many clients.
| Criterion | stdio | Streamable HTTP |
|---|---|---|
| Where the server runs | On your machine | Remotely (or on the local network) |
| Speed | Fastest — no network | Network latency applies |
| Authentication | Via environment variables | OAuth, bearer tokens, headers |
| Number of clients | Typically one | Many |
| Typical use | Local tools, filesystem, your own scripts | SaaS services, a central server for the team |
# stdio — a local process. Everything after `--` is the server command.
claude mcp add --transport stdio my-tools \
--env API_TOKEN=$MY_TOKEN \
-- node ./tools/mcp-server.js
# HTTP — a remote server
claude mcp add --transport http notion https://mcp.notion.com/mcp
# HTTP with an authentication header
claude mcp add --transport http internal-api https://mcp.internal.company/mcp \
--header "Authorization: Bearer $INTERNAL_TOKEN"Connection examples. The `--` separator matters: everything before it belongs to Claude, everything after it is the server's launch command.
The SSE transport is deprecated — new servers should use http (Streamable HTTP). Existing --transport sse connections still work but should not be chosen for a new integration.
The practical rule:
- Choose stdio when the server exposes things only your machine has (local files,
adb, a local database), or when you wrote it yourself and are still iterating. - Choose HTTP when the server is a central service for the team, when it fronts a SaaS product, or when authentication needs to be centralised.
When writing your own internal server you typically start with stdio and move to HTTP once the team needs it.
📚 Sources and documentation
- MCP transport layerofficialmodelcontextprotocol.io
- Claude Code MCP quickstartofficialcode.claude.com