Skip to content

Commit 9483908

Browse files
authored
Merge pull request #5829 from maxxrdrgz/mcp-streamable-http
Mcp streamable http
2 parents c04ea42 + 1f29af4 commit 9483908

File tree

6 files changed

+38
-9
lines changed

6 files changed

+38
-9
lines changed

binary/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/context/mcp/MCPConnection.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
44
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
55
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
66
import { WebSocketClientTransport } from "@modelcontextprotocol/sdk/client/websocket.js";
7+
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
78

89
import {
910
MCPConnectionStatus,
@@ -335,6 +336,10 @@ class MCPConnection {
335336
},
336337
requestInit: { headers: options.transport.requestOptions?.headers },
337338
});
339+
case "streamable-http":
340+
return new StreamableHTTPClientTransport(new URL(options.transport.url), {
341+
requestInit: { headers: options.transport.requestOptions?.headers },
342+
});
338343
default:
339344
throw new Error(
340345
`Unsupported transport type: ${(options.transport as any).type}`,

core/index.d.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,17 @@ export interface SSEOptions {
11351135
requestOptions?: RequestOptions;
11361136
}
11371137

1138-
export type TransportOptions = StdioOptions | WebSocketOptions | SSEOptions;
1138+
export interface StreamableHTTPOptions {
1139+
type: "streamable-http";
1140+
url: string;
1141+
requestOptions?: RequestOptions;
1142+
}
1143+
1144+
export type TransportOptions =
1145+
| StdioOptions
1146+
| WebSocketOptions
1147+
| SSEOptions
1148+
| StreamableHTTPOptions;
11391149

11401150
export interface MCPOptions {
11411151
name: string;

core/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/vscode/config_schema.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3494,6 +3494,20 @@
34943494
}
34953495
},
34963496
"required": ["type", "url"]
3497+
},
3498+
{
3499+
"type": "object",
3500+
"properties": {
3501+
"type": {
3502+
"type": "string",
3503+
"enum": ["streamable-http"]
3504+
},
3505+
"url": {
3506+
"type": "string",
3507+
"format": "uri"
3508+
}
3509+
},
3510+
"required": ["type", "url"]
34973511
}
34983512
]
34993513
}

gui/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)