swiftapplications

MCP on macOS

MCP transports on a Mac: stdio, Streamable HTTP and local sockets

When to use stdio or Streamable HTTP for an MCP server on macOS, why localhost HTTP servers must check the Origin header, and where Unix sockets fit.

Updated 8 October 2026 3 min read

The short answer

Use stdio for a local server one app launches: simplest, no port, no network. Use Streamable HTTP for a server several clients share or that runs remotely; on localhost, bind to 127.0.0.1 and validate the Origin header, as the MCP spec requires. Unix sockets aren’t an MCP transport, but a local app can sit behind a small stdio shim that talks to its socket.

stdio

The host starts your server as a child process and exchanges JSON-RPC over stdin and stdout. One client, one process, no port. It inherits the environment the host gives it, which is why keys passed as env vars end up there.

Streamable HTTP

One endpoint (for example /mcp) takes POST requests and may stream responses. It suits shared and remote servers, and needs authentication; the spec uses OAuth 2.1 for remote servers.

Local apps and Unix sockets

A Mac app that already runs in the background (a vault, a mail client) can expose a Unix socket and ship a tiny stdio shim: the MCP client launches the shim, and the shim forwards to the app. The app keeps the credentials and the approval UI; the client never sees either. Keep socket paths under 104 bytes (why).

The safe way to do this

MoltenRock Connect

One local MCP server for 30 business platforms

Connect holds every key; your agents read Stripe, Shopify and 28 more over MCP and never see one. On Stripe they can only propose, and you approve with Touch ID.

Get MoltenRock Connect

Questions developers ask

Should my local MCP server use stdio or HTTP?

stdio, unless several clients need to share it. It has no port to protect.

Is the SSE transport deprecated in MCP?

Yes. The HTTP+SSE transport was replaced by Streamable HTTP.

How do I secure a localhost MCP server?

Bind to 127.0.0.1, validate the Origin header, and require authentication.