In roots.ts, clientCapabilites.roots and response.roots are optional.

Fixes #2818
This commit is contained in:
cliffhall
2026-01-10 17:40:58 -05:00
parent 7300631a5c
commit 677f40a38f

View File

@@ -41,7 +41,7 @@ export const syncRoots = async (server: McpServer, sessionId?: string) => {
const response = await server.server.listRoots();
if (response && "roots" in response) {
// Store the roots list for this client
roots.set(sessionId, response?.roots);
roots.set(sessionId, response.roots);
// Notify the client of roots received
await server.sendLoggingMessage(