Summary
Add WebSocket transport so mcp2cli can act as a persistent tool server that agents connect to for real-time tool discovery, schema introspection, and streamed results.
Motivation
- HTTP/SSE gives request-response access to remote MCP servers
- WebSocket enables persistent connections where agents attach once and stream tool calls bidirectionally
- Similar to how OpenAI Codex connects to tool servers -- agents get real-time discovery without pre-loading schemas
- Natural evolution toward the LXC gateway vision but accessible to any agent runtime
Proposed Behavior
mcp2cli serve --ws starts a WebSocket server
- Agents connect via
ws://localhost:<port>
- Over WS, agents can:
- Discover all registered services and tools (unified schema across all backends)
- Invoke tools with streamed results
- Subscribe to health/status events
- mcp2cli multiplexes across stdio, HTTP, and future backends transparently
Transport Evolution
| Transport |
Use Case |
Status |
| stdio |
Local MCP processes |
shipped |
| HTTP/SSE |
Remote servers, LXC gateway |
PR #1 |
| WebSocket |
Persistent agent attachment, streaming |
this issue |
Summary
Add WebSocket transport so mcp2cli can act as a persistent tool server that agents connect to for real-time tool discovery, schema introspection, and streamed results.
Motivation
Proposed Behavior
mcp2cli serve --wsstarts a WebSocket serverws://localhost:<port>Transport Evolution