Skip to content

Transports

Overview

protomcp supports two transports, both implemented by the official MCP Go SDK. The transport determines how your MCP client connects to protomcp. Your server code is unaffected — it always communicates with protomcp via the same unix socket protocol.

Set the transport with --transport:

Terminal window
pmcp dev server.py --transport http --port 8080

stdio (default)

Flag: --transport stdio

Reads MCP requests from stdin, writes responses to stdout. The MCP client spawns protomcp as a child process and communicates over its standard I/O.

Use when: Your MCP client supports subprocess spawning (Claude Desktop, Cursor, most local clients).

Config:

{
"mcpServers": {
"mytools": {
"command": "pmcp",
"args": ["dev", "/path/to/server.py"]
}
}
}

No --host or --port needed. stdio is the simplest and most compatible option.


Streamable HTTP

Flag: --transport http

Runs an HTTP server using the official SDK’s StreamableHTTPHandler. Supports session management, multiple concurrent clients, and SSE-based streaming responses. This is the modern MCP HTTP transport that replaces the older SSE transport.

Use when:

  • Your MCP client connects over HTTP instead of spawning a subprocess
  • You need to handle multiple concurrent MCP clients
  • You’re running protomcp on a remote server
  • Load balancers or proxies are in the path
Terminal window
pmcp run server.py --transport http --host 0.0.0.0 --port 8080

MCP client config:

{
"mcpServers": {
"mytools": {
"url": "http://myserver:8080/mcp"
}
}
}

Compatibility matrix

TransportMCP clientsHot reloadMultiple clientsSession management
stdioClaude Desktop, Cursor, most localYesNo (one client)Single session
httpModern HTTP clientsYesYesPer-session via Mcp-Session-Id

Host and port flags

--host and --port only apply to the HTTP transport:

FlagDefaultDescription
--hostlocalhostAddress to bind
--port8080Port to bind

For local-only access, use the default localhost. For external access:

Terminal window
pmcp run server.py --transport http --host 0.0.0.0 --port 8080