feat!: remove WebSocketClientTransport (#1783)

Co-authored-by: Konstantin Konstantinov <KKonstantinov@users.noreply.github.com>
This commit is contained in:
Felix Weinberger 2026-03-30 19:58:26 +01:00 • committed by GitHub
commit 045c62a1e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,13 +1,7 @@
import WebSocket from 'ws';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(global as any).WebSocket = WebSocket;
import express from 'express';
import { Client } from '../src/client/index.js';
import { SSEClientTransport } from '../src/client/sse.js';
import { StdioClientTransport } from '../src/client/stdio.js';
import { WebSocketClientTransport } from '../src/client/websocket.js';
import { Server } from '../src/server/index.js';
import { SSEServerTransport } from '../src/server/sse.js';
import { StdioServerTransport } from '../src/server/stdio.js';
@ -38,7 +32,7 @@ async function runClient(url_or_command: string, args: string[]) {
if (url?.protocol === 'http:' || url?.protocol === 'https:') {
clientTransport = new SSEClientTransport(new URL(url_or_command));
} else if (url?.protocol === 'ws:' || url?.protocol === 'wss:') {
clientTransport = new WebSocketClientTransport(new URL(url_or_command));
throw new Error('WebSocket URLs are no longer supported. Use http(s) or stdio instead.');
} else {
clientTransport = new StdioClientTransport({
command: url_or_command,