File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -314,8 +314,19 @@ export function useConnection({
314314 ) ;
315315 }
316316
317+ let capabilities ;
317318 try {
318319 await client . connect ( clientTransport ) ;
320+
321+ capabilities = client . getServerCapabilities ( ) ;
322+ const initializeRequest = {
323+ method : "initialize" ,
324+ } ;
325+ pushHistory ( initializeRequest , {
326+ capabilities,
327+ serverInfo : client . getServerVersion ( ) ,
328+ instructions : client . getInstructions ( ) ,
329+ } ) ;
319330 } catch ( error ) {
320331 console . error (
321332 `Failed to connect to MCP Server via the MCP Inspector Proxy: ${ mcpProxyServerUrl } :` ,
@@ -332,8 +343,6 @@ export function useConnection({
332343 }
333344 throw error ;
334345 }
335-
336- const capabilities = client . getServerCapabilities ( ) ;
337346 setServerCapabilities ( capabilities ?? null ) ;
338347 setCompletionsSupported ( true ) ; // Reset completions support on new connection
339348
You can’t perform that action at this time.
0 commit comments