A CLI tool to connect local stdio (standard input/output) to a remote WebSocket server.
mcp-ws is designed
8360
to be complementary to ws-mcp, which wraps stdio MCP servers with websockets. This tool provides the client-side functionality, allowing you to connect to those websocket servers from your terminal.
Unlike wscat, mcp-ws doesn't output prompts like > and < which can confuse MCP clients.
pip install mcp-wsuvx install mcp-wsmcp-ws wss://example.com/socketWith additional headers:
mcp-ws wss://example.com/socket --headers '{"Authorization": "Bearer token"}'
# or using the short form
mcp-ws wss://example.com/socket -H '{"Authorization": "Bearer token"}'Run the tool directly with UVX without installing it first:
uvx mcp-ws wss://example.com/socketWith additional headers:
uvx mcp-ws wss://example.com/socket --headers '{"Authorization": "Bearer token"}'- Clean bidirectional communication between stdio and websockets
- No confusing prompts or formatting that could interfere with MCP clients
- Asynchronous handling of input/output
- Proper error handling and connection management
# Clone the repository
git clone <repository-url>
cd mcp-ws
# Install dependencies
uv pip install -e .
# Run the application
python -m mcp_ws <websocket-url>This project is licensed under the MIT License - see the LICENSE file for details.