MCPcopy
hub / github.com/claude-code-best/claude-code / start

Method start

src/utils/mcpWebSocketTransport.ts:142–154  ·  view source on GitHub ↗

* Starts listening for messages on the WebSocket.

()

Source from the content-addressed store, hash-verified

140 * Starts listening for messages on the WebSocket.
141 */
142 async start(): Promise<void> {
143 if (this.started) {
144 throw new Error('Start can only be called once per transport.')
145 }
146 await this.opened
147 if (this.ws.readyState !== WS_OPEN) {
148 logForDiagnosticsNoPII('error', 'mcp_websocket_start_not_opened')
149 throw new Error('WebSocket is not open. Cannot start transport.')
150 }
151 this.started = true
152 // Unlike stdio, WebSocket connections are typically already established when the transport is created.
153 // No explicit connection action needed here, just attaching listeners.
154 }
155
156 /**
157 * Closes the WebSocket connection.

Callers

nothing calls this directly

Calls 1

logForDiagnosticsNoPIIFunction · 0.85

Tested by

no test coverage detected