diff --git a/src/filesystem/index.ts b/src/filesystem/index.ts index 79a7b2fe4c..7c021316df 100644 --- a/src/filesystem/index.ts +++ b/src/filesystem/index.ts @@ -14,6 +14,7 @@ import { z } from "zod"; import { minimatch } from "minimatch"; import { normalizePath, expandHome } from './path-utils.js'; import { getValidRootDirectories } from './roots-utils.js'; +import { fileURLToPath } from "url"; import { // Function imports formatSize, @@ -700,6 +701,11 @@ server.server.setNotificationHandler(RootsListChangedNotificationSchema, async ( try { // Request the updated roots list from the client const response = await server.server.listRoots(); + for (const root of response.roots) { + // console.error("root", fileURLToPath(root.uri)); + // fix windows url encode file:///d%3A/work/ + root.uri = fileURLToPath(root.uri); + } if (response && 'roots' in response) { await updateAllowedDirectoriesFromRoots(response.roots); }