Skip to content

Websocket

Category: Mcp_client

Source: websocket.dart

WebSocket transport for MCP.

Connects to ws:// / wss:// URLs. Each frame is one JSON-RPC message — no extra framing needed since WebSocket preserves message boundaries.

The existing [WebSocketTransport] in glue_server already implements the wire layer for a server-side handle. This file is the client- side connection establishment (with optional bearer auth header) plus a thin wrapper that just exposes the transport via the same [JsonRpcTransport] interface.

Classes

McpWebSocketConnectError

Constructor

dart
const McpWebSocketConnectError(this.url, this.cause)

Properties

PropertyTypeDescription
urlUri
causeObject

Methods

String toString()

Released under the MIT License.