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:
pmcp dev server.py --transport http --port 8080stdio (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
pmcp run server.py --transport http --host 0.0.0.0 --port 8080MCP client config:
{ "mcpServers": { "mytools": { "url": "http://myserver:8080/mcp" } }}Compatibility matrix
| Transport | MCP clients | Hot reload | Multiple clients | Session management |
|---|---|---|---|---|
| stdio | Claude Desktop, Cursor, most local | Yes | No (one client) | Single session |
| http | Modern HTTP clients | Yes | Yes | Per-session via Mcp-Session-Id |
Host and port flags
--host and --port only apply to the HTTP transport:
| Flag | Default | Description |
|---|---|---|
--host | localhost | Address to bind |
--port | 8080 | Port to bind |
For local-only access, use the default localhost. For external access:
pmcp run server.py --transport http --host 0.0.0.0 --port 8080