Summary
I have built and open-sourced an end-to-end WebSocket transport implementation for the Model Context Protocol in both Python and TypeScript, along with a transparent stdio-to-websocket bridge CLI:
🔗 Repository: https://github.com/serguei9090/mcp-websocket-transport
Motivation & Context
While standard I/O (\stdio) is ideal for local desktop integrations and HTTP with SSE serves one-way streaming, distributed environments (Docker containers, remote servers, microservices, and browser-based agents) benefit greatly from a native, persistent, low-latency, full-duplex WebSocket transport.
Key Features & Architecture
- Dual SDK Support:
- Python: \mcp-websocket-transport\ (built on top of official Python MCP SDK, FastMCP, and \websockets). Available on PyPI.
- TypeScript: \mcp-websocket-transport\ (built on top of @modelcontextprotocol/sdk\ and \ws). Available on npm.
- Universal Desktop Host Bridge (\mcp-ws-bridge):
- A transparent stdio-to-websocket pipe CLI that allows existing desktop MCP hosts (Claude Desktop, Cursor, LM Studio, Antigravity) to connect to remote or containerized WebSocket servers without changing host code.
- RFC-Style Specification:
- Includes a formal protocol specification document covering handshake framing, reconnection logic, ping/pong heartbeats, and error recovery.
- Docker & Multi-Language Testing:
- Includes Docker Compose orchestration and automated test suites (\pytest\ and \�un test).
Community Feedback & Next Steps
I’d love to get the core team and community's feedback on the implementation:
- Would this be suitable to list under community transport implementations / ecosystem showcase?
- Are there any protocol alignment nuances or edge cases you'd recommend refining for potential standard reference?
Thank you for building such an incredible protocol!
Summary
I have built and open-sourced an end-to-end WebSocket transport implementation for the Model Context Protocol in both Python and TypeScript, along with a transparent stdio-to-websocket bridge CLI:
🔗 Repository: https://github.com/serguei9090/mcp-websocket-transport
Motivation & Context
While standard I/O (\stdio) is ideal for local desktop integrations and HTTP with SSE serves one-way streaming, distributed environments (Docker containers, remote servers, microservices, and browser-based agents) benefit greatly from a native, persistent, low-latency, full-duplex WebSocket transport.
Key Features & Architecture
Community Feedback & Next Steps
I’d love to get the core team and community's feedback on the implementation:
Thank you for building such an incredible protocol!