Skip to content

Commit 861c11b

Browse files
authored
Merge pull request #3200 from cliffhall/roots-is-optional
Everything server - Fix error when referring to roots
2 parents 9691b95 + 677f40a commit 861c11b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/everything/server/roots.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const roots: Map<string | undefined, Root[]> = new Map<
3030
*/
3131
export 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) {
@@ -48,7 +48,7 @@ export const syncRoots = async (server: McpServer, sessionId?: string) => {
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
);

0 commit comments

Comments
 (0)