File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -351,6 +351,7 @@ export function useConnection({
351
351
return ;
352
352
}
353
353
354
+ let lastRequest = "" ;
354
355
try {
355
356
// Inject auth manually instead of using SSEClientTransport, because we're
356
357
// proxying through the inspector server first.
@@ -564,7 +565,9 @@ export function useConnection({
564
565
}
565
566
566
567
if ( capabilities ?. logging && defaultLoggingLevel ) {
568
+ lastRequest = "logging/setLevel" ;
567
569
await client . setLoggingLevel ( defaultLoggingLevel ) ;
570
+ lastRequest = "" ;
568
571
}
569
572
570
573
if ( onElicitationRequest ) {
@@ -578,6 +581,17 @@ export function useConnection({
578
581
setMcpClient ( client ) ;
579
582
setConnectionStatus ( "connected" ) ;
580
583
} catch ( e ) {
584
+ if (
585
+ lastRequest === "logging/setLevel" &&
586
+ e instanceof McpError &&
587
+ e . code === ErrorCode . MethodNotFound
588
+ ) {
589
+ toast ( {
590
+ title : "Error" ,
591
+ description : `Server declares logging capability but doesn't implement method: "${ lastRequest } "` ,
592
+ variant : "destructive" ,
593
+ } ) ;
594
+ }
581
595
console . error ( e ) ;
582
596
setConnectionStatus ( "error" ) ;
583
597
}
You can’t perform that action at this time.
0 commit comments