@@ -19,6 +19,10 @@ import {
19
19
SelectValue ,
20
20
} from "@/components/ui/select" ;
21
21
import { StdErrNotification } from "@/lib/notificationTypes" ;
22
+ import {
23
+ LoggingLevel ,
24
+ LoggingLevelSchema ,
25
+ } from "@modelcontextprotocol/sdk/types.js" ;
22
26
23
27
import useTheme from "../lib/useTheme" ;
24
28
import { version } from "../../../package.json" ;
@@ -39,6 +43,9 @@ interface SidebarProps {
39
43
setBearerToken : ( token : string ) => void ;
40
44
onConnect : ( ) => void ;
41
45
stdErrNotifications : StdErrNotification [ ] ;
46
+ logLevel : LoggingLevel ;
47
+ sendLogLevelRequest : ( level : LoggingLevel ) => void ;
48
+ loggingSupported : boolean ;
42
49
}
43
50
44
51
const Sidebar = ( {
@@ -57,6 +64,9 @@ const Sidebar = ({
57
64
setBearerToken,
58
65
onConnect,
59
66
stdErrNotifications,
67
+ logLevel,
68
+ sendLogLevelRequest,
69
+ loggingSupported,
60
70
} : SidebarProps ) => {
61
71
const [ theme , setTheme ] = useTheme ( ) ;
62
72
const [ showEnvVars , setShowEnvVars ] = useState ( false ) ;
@@ -290,6 +300,28 @@ const Sidebar = ({
290
300
: "Disconnected" }
291
301
</ span >
292
302
</ div >
303
+
304
+ { loggingSupported && connectionStatus === "connected" && (
305
+ < div className = "space-y-2" >
306
+ < label className = "text-sm font-medium" > Logging Level</ label >
307
+ < Select
308
+ value = { logLevel }
309
+ onValueChange = { ( value : LoggingLevel ) =>
310
+ sendLogLevelRequest ( value )
311
+ }
312
+ >
313
+ < SelectTrigger >
314
+ < SelectValue placeholder = "Select logging level" />
315
+ </ SelectTrigger >
316
+ < SelectContent >
317
+ { Object . values ( LoggingLevelSchema . enum ) . map ( ( level ) => (
318
+ < SelectItem value = { level } > { level } </ SelectItem >
319
+ ) ) }
320
+ </ SelectContent >
321
+ </ Select >
322
+ </ div >
323
+ ) }
324
+
293
325
{ stdErrNotifications . length > 0 && (
294
326
< >
295
327
< div className = "mt-4 border-t border-gray-200 pt-4" >
0 commit comments