MCP transports

MCP is transport-agnostic. The protocol works the same whether you're talking to a local subprocess over stdin or to a remote HTTPS endpoint. Picking the right transport matters for performance and security.

stdio, local subprocess

The client spawns the server as a child process and talks to it over stdin/stdout. Messages are newline-delimited JSON.

When to use:

Pros:

Cons:

SSE. Server-Sent Events

The client opens an HTTP connection to the server; the server streams events back. Good for remote servers that want long-lived bidirectional-ish communication.

When to use:

Pros:

Cons:

HTTP, request/response

Plain stateless HTTP. The client sends a JSON-RPC request, the server responds. No streaming.

When to use:

Pros:

Cons:

Decision matrix

If the server is… Use transport
On your machine, for your use onlystdio
Hosted, serving one user (you)SSE or HTTP
Hosted, serving a teamSSE (for streaming) or HTTP (simpler)
Serverless (Lambda, Cloudflare Workers)HTTP

Mixing transports

Clients can connect to many servers, each over a different transport. Claude Code happily talks to local stdio servers (git, filesystem) and remote HTTP/SSE servers (Notion, Gmail) at the same time.