File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -335,8 +335,19 @@ export function useConnection({
335335 ) ;
336336 }
337337
338+ let capabilities ;
338339 try {
339340 await client . connect ( clientTransport ) ;
341+
342+ capabilities = client . getServerCapabilities ( ) ;
343+ const initializeRequest = {
344+ method : "initialize" ,
345+ } ;
346+ pushHistory ( initializeRequest , {
347+ capabilities,
348+ serverInfo : client . getServerVersion ( ) ,
349+ instructions : client . getInstructions ( ) ,
350+ } ) ;
340351 } catch ( error ) {
341352 console . error (
342353 `Failed to connect to MCP Server via the MCP Inspector Proxy: ${ mcpProxyServerUrl } :` ,
@@ -353,8 +364,6 @@ export function useConnection({
353364 }
354365 throw error ;
355366 }
356-
357- const capabilities = client . getServerCapabilities ( ) ;
358367 setServerCapabilities ( capabilities ?? null ) ;
359368 setCompletionsSupported ( true ) ; // Reset completions support on new connection
360369
You can’t perform that action at this time.
0 commit comments