@@ -19,6 +19,10 @@ import {
1919 SelectValue ,
2020} from "@/components/ui/select" ;
2121import { StdErrNotification } from "@/lib/notificationTypes" ;
22+ import {
23+ LoggingLevel ,
24+ LoggingLevelSchema ,
25+ } from "@modelcontextprotocol/sdk/types.js" ;
2226
2327import useTheme from "../lib/useTheme" ;
2428import { version } from "../../../package.json" ;
@@ -39,6 +43,9 @@ interface SidebarProps {
3943 setBearerToken : ( token : string ) => void ;
4044 onConnect : ( ) => void ;
4145 stdErrNotifications : StdErrNotification [ ] ;
46+ logLevel : LoggingLevel ;
47+ sendLogLevelRequest : ( level : LoggingLevel ) => void ;
48+ loggingSupported : boolean ;
4249}
4350
4451const Sidebar = ( {
@@ -57,6 +64,9 @@ const Sidebar = ({
5764 setBearerToken,
5865 onConnect,
5966 stdErrNotifications,
67+ logLevel,
68+ sendLogLevelRequest,
69+ loggingSupported,
6070} : SidebarProps ) => {
6171 const [ theme , setTheme ] = useTheme ( ) ;
6272 const [ showEnvVars , setShowEnvVars ] = useState ( false ) ;
@@ -290,6 +300,28 @@ const Sidebar = ({
290300 : "Disconnected" }
291301 </ span >
292302 </ 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+
293325 { stdErrNotifications . length > 0 && (
294326 < >
295327 < div className = "mt-4 border-t border-gray-200 pt-4" >
0 commit comments