@@ -15,6 +15,7 @@ import {
1515 Root ,
1616 ServerNotification ,
1717 Tool ,
18+ LoggingLevel ,
1819} from "@modelcontextprotocol/sdk/types.js" ;
1920import React , { Suspense , useEffect , useRef , useState } from "react" ;
2021import { useConnection } from "./lib/hooks/useConnection" ;
@@ -91,6 +92,7 @@ const App = () => {
9192 ( localStorage . getItem ( "lastTransportType" ) as "stdio" | "sse" ) || "stdio"
9293 ) ;
9394 } ) ;
95+ const [ logLevel , setLogLevel ] = useState < LoggingLevel > ( "debug" ) ;
9496 const [ notifications , setNotifications ] = useState < ServerNotification [ ] > ( [ ] ) ;
9597 const [ stdErrNotifications , setStdErrNotifications ] = useState <
9698 StdErrNotification [ ]
@@ -412,6 +414,17 @@ const App = () => {
412414 await sendNotification ( { method : "notifications/roots/list_changed" } ) ;
413415 } ;
414416
417+ const sendLogLevelRequest = async ( level : LoggingLevel ) => {
418+ await makeRequest (
419+ {
420+ method : "logging/setLevel" as const ,
421+ params : { level } ,
422+ } ,
423+ z . object ( { } ) ,
424+ ) ;
425+ setLogLevel ( level ) ;
426+ } ;
427+
415428 return (
416429 < div className = "flex h-screen bg-background" >
417430 < Sidebar
@@ -430,6 +443,9 @@ const App = () => {
430443 setBearerToken = { setBearerToken }
431444 onConnect = { connectMcpServer }
432445 stdErrNotifications = { stdErrNotifications }
446+ logLevel = { logLevel }
447+ sendLogLevelRequest = { sendLogLevelRequest }
448+ loggingSupported = { ! ! serverCapabilities ?. logging || false }
433449 />
434450 < div className = "flex-1 flex flex-col overflow-hidden" >
435451 < div className = "flex-1 overflow-auto" >
0 commit comments