Skip to content

[Community Transport] Full-Duplex WebSocket Transport Implementation for Python & TypeScript #3339

Description

@serguei9090

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:

  1. Would this be suitable to list under community transport implementations / ecosystem showcase?
  2. 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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions