MCPcopy Index your code
hub / github.com/codeaashu/claude-code / createNodeWsClient

Function createNodeWsClient

src/services/mcp/client.ts:436–447  ·  view source on GitHub ↗

* Create a ws.WebSocket client with the MCP protocol. * Bun's ws shim types lack the 3-arg constructor (url, protocols, options) * that the real ws package supports, so we cast the constructor here.

(
  url: string,
  options: Record<string, unknown>,
)

Source from the content-addressed store, hash-verified

434 * that the real ws package supports, so we cast the constructor here.
435 */
436async function createNodeWsClient(
437 url: string,
438 options: Record<string, unknown>,
439): Promise<WsClientLike> {
440 const wsModule = await import('ws')
441 const WS = wsModule.default as unknown as new (
442 url: string,
443 protocols: string[],
444 options: Record<string, unknown>,
445 ) => WsClientLike
446 return new WS(url, ['mcp'], options)
447}
448
449const IMAGE_MIME_TYPES = new Set([
450 'image/jpeg',

Callers 1

client.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected