added streamable-http as a valid connection type in the constructTransport case statement
This commit is contained in:
parent
5503beb8b3
commit
fcc90c9947
1 changed files with 5 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|||
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
||||
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
||||
import { WebSocketClientTransport } from "@modelcontextprotocol/sdk/client/websocket.js";
|
||||
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
||||
|
||||
import {
|
||||
MCPConnectionStatus,
|
||||
|
|
@ -307,6 +308,10 @@ class MCPConnection {
|
|||
},
|
||||
requestInit: { headers: options.transport.requestOptions?.headers },
|
||||
});
|
||||
case "streamable-http":
|
||||
return new StreamableHTTPClientTransport(new URL(options.transport.url), {
|
||||
requestInit: { headers: options.transport.requestOptions?.headers },
|
||||
});
|
||||
default:
|
||||
throw new Error(
|
||||
`Unsupported transport type: ${(options.transport as any).type}`,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue