File tree 2 files changed +13
-2
lines changed 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ const mockClient = {
17
17
connect : jest . fn ( ) . mockResolvedValue ( undefined ) ,
18
18
close : jest . fn ( ) ,
19
19
getServerCapabilities : jest . fn ( ) ,
20
+ getServerVersion : jest . fn ( ) ,
21
+ getInstructions : jest . fn ( ) ,
20
22
setNotificationHandler : jest . fn ( ) ,
21
23
setRequestHandler : jest . fn ( ) ,
22
24
} ;
Original file line number Diff line number Diff line change @@ -335,8 +335,19 @@ export function useConnection({
335
335
) ;
336
336
}
337
337
338
+ let capabilities ;
338
339
try {
339
340
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
+ } ) ;
340
351
} catch ( error ) {
341
352
console . error (
342
353
`Failed to connect to MCP Server via the MCP Inspector Proxy: ${ mcpProxyServerUrl } :` ,
@@ -353,8 +364,6 @@ export function useConnection({
353
364
}
354
365
throw error ;
355
366
}
356
-
357
- const capabilities = client . getServerCapabilities ( ) ;
358
367
setServerCapabilities ( capabilities ?? null ) ;
359
368
setCompletionsSupported ( true ) ; // Reset completions support on new connection
360
369
You can’t perform that action at this time.
0 commit comments