File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ const mockClient = {
1717 connect : jest . fn ( ) . mockResolvedValue ( undefined ) ,
1818 close : jest . fn ( ) ,
1919 getServerCapabilities : jest . fn ( ) ,
20+ getServerVersion : jest . fn ( ) ,
21+ getInstructions : jest . fn ( ) ,
2022 setNotificationHandler : jest . fn ( ) ,
2123 setRequestHandler : jest . fn ( ) ,
2224} ;
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