File tree Expand file tree Collapse file tree 4 files changed +13
-6
lines changed
Expand file tree Collapse file tree 4 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -79,9 +79,9 @@ const App = () => {
7979 const [ sseUrl , setSseUrl ] = useState < string > ( ( ) => {
8080 return localStorage . getItem ( "lastSseUrl" ) || "http://localhost:3001/sse" ;
8181 } ) ;
82- const [ transportType , setTransportType ] = useState < "stdio" | "sse" > ( ( ) => {
82+ const [ transportType , setTransportType ] = useState < "stdio" | "sse" | "streamable-http" > ( ( ) => {
8383 return (
84- ( localStorage . getItem ( "lastTransportType" ) as "stdio" | "sse" ) || "stdio"
84+ ( localStorage . getItem ( "lastTransportType" ) as "stdio" | "sse" | "streamable-http" ) || "stdio"
8585 ) ;
8686 } ) ;
8787 const [ logLevel , setLogLevel ] = useState < LoggingLevel > ( "debug" ) ;
Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ import {
3939
4040interface SidebarProps {
4141 connectionStatus : ConnectionStatus ;
42- transportType : "stdio" | "sse" ;
43- setTransportType : ( type : "stdio" | "sse" ) => void ;
42+ transportType : "stdio" | "sse" | "streamable-http" ;
43+ setTransportType : ( type : "stdio" | "sse" | "streamable-http" ) => void ;
4444 command : string ;
4545 setCommand : ( command : string ) => void ;
4646 args : string ;
@@ -111,7 +111,7 @@ const Sidebar = ({
111111 </ label >
112112 < Select
113113 value = { transportType }
114- onValueChange = { ( value : "stdio" | "sse" ) =>
114+ onValueChange = { ( value : "stdio" | "sse" | "streamable-http" ) =>
115115 setTransportType ( value )
116116 }
117117 >
@@ -121,6 +121,7 @@ const Sidebar = ({
121121 < SelectContent >
122122 < SelectItem value = "stdio" > STDIO</ SelectItem >
123123 < SelectItem value = "sse" > SSE</ SelectItem >
124+ < SelectItem value = "streamable-http" > Streamable HTTP</ SelectItem >
124125 </ SelectContent >
125126 </ Select >
126127 </ div >
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ import { getMCPServerRequestTimeout } from "@/utils/configUtils";
4242import { InspectorConfig } from "../configurationTypes" ;
4343
4444interface UseConnectionOptions {
45- transportType : "stdio" | "sse" ;
45+ transportType : "stdio" | "sse" | "streamable-http" ;
4646 command : string ;
4747 args : string ;
4848 sseUrl : string ;
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import {
1414} from "@modelcontextprotocol/sdk/client/stdio.js" ;
1515import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js" ;
1616import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js" ;
17+ import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js' ;
1718import express from "express" ;
1819import { findActualExecutable } from "spawn-rx" ;
1920import mcpProxy from "./mcpProxy.js" ;
@@ -94,6 +95,11 @@ const createTransport = async (req: express.Request): Promise<Transport> => {
9495
9596 console . log ( "Connected to SSE transport" ) ;
9697 return transport ;
98+ } else if ( transportType === "streamable - http ") {
99+ const transport = new StreamableHTTPClientTransport ( new URL ( query . url as string ) ) ;
100+ await transport . start ( ) ;
101+ console . log ( "Connected to Streamable HTTP transport" ) ;
102+ return transport ;
97103 } else {
98104 console . error ( `Invalid transport type: ${ transportType } ` ) ;
99105 throw new Error ( "Invalid transport type specified" ) ;
You can’t perform that action at this time.
0 commit comments