File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export const roots: Map<string | undefined, Root[]> = new Map<
3030 */
3131export const syncRoots = async ( server : McpServer , sessionId ?: string ) => {
3232 const clientCapabilities = server . server . getClientCapabilities ( ) || { } ;
33- const clientSupportsRoots : boolean = clientCapabilities . roots !== undefined ;
33+ const clientSupportsRoots : boolean = clientCapabilities ? .roots !== undefined ;
3434
3535 // Fetch the roots list for this client
3636 if ( clientSupportsRoots ) {
@@ -41,14 +41,14 @@ export const syncRoots = async (server: McpServer, sessionId?: string) => {
4141 const response = await server . server . listRoots ( ) ;
4242 if ( response && "roots" in response ) {
4343 // Store the roots list for this client
44- roots . set ( sessionId , response . roots ) ;
44+ roots . set ( sessionId , response ? .roots ) ;
4545
4646 // Notify the client of roots received
4747 await server . sendLoggingMessage (
4848 {
4949 level : "info" ,
5050 logger : "everything-server" ,
51- data : `Roots updated: ${ response . roots . length } root(s) received from client` ,
51+ data : `Roots updated: ${ response ? .roots ? .length } root(s) received from client` ,
5252 } ,
5353 sessionId
5454 ) ;
You can’t perform that action at this time.
0 commit comments