You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d98c856
Browse filesBrowse the repository at this point in the historyBrowse files
fix(filesystem): allow a client Root in its advertised form as well as its realpath
parseRootUri kept only the realpath of each client Root, so a request that
used the Root's own spelling (a symlinked directory, /tmp on macOS) was
refused. It now returns both forms and getValidRootDirectories admits both,
deduplicated, as resolveAllowedDirectories does for command-line
directories. validatePath still realpaths every request, so a symlink
inside a Root that points outside it stays refused.
Closes#5183
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>
A client Root is now allowed in the form the client advertised it as well as in its resolved form, as command-line directories already were. A request that names a path through a symlinked Root's own spelling (for example `/tmp/...` for a Root of `file:///tmp/...` on macOS) is no longer refused, and `list_allowed_directories` lists both forms. Every request is still resolved and checked against the resolved directory, so a symlink inside a Root that points outside it stays refused.
Copy file name to clipboardExpand all lines: src/filesystem/README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,8 @@ A client that connects with a 2025-era protocol version (the `initialize` handsh
31
31
32
32
Roots notified by Client to Server, completely replace any server-side Allowed directories when provided.
33
33
34
+
A Root reached through a symlink is allowed in both its advertised form and its resolved form, as a command-line directory is: a Root of `file:///tmp/project` on macOS allows `/tmp/project` and `/private/tmp/project`. Every requested path is still resolved and checked against the resolved directories, so a symlink inside a Root that points outside it is refused.
35
+
34
36
**Important**: If server starts without command-line arguments AND a 2025-era client doesn't support roots protocol, the server fails at initialization: it logs the reason to stderr, closes the connection and exits with status 1. A client that supports roots but provides none (or none that are valid) keeps the connection, with no allowed directories until it sends `roots/list_changed` with valid roots.
35
37
36
38
The 2026-07-28 protocol has no `initialize` handshake and no server-to-client `roots/list` request, so a 2026-07-28 client's roots are never asked for: the command-line directories are the whole allow-list. A server started with none answers every tool call on such a connection with an error saying so.
@@ -205,7 +207,7 @@ The server's directory access control follows this flow:
205
207
- List all directories the server is allowed to access
206
208
- No input required
207
209
- Returns:
208
-
- Directories that this server can read/write from
210
+
- Directories that this server can read/write from. A directory reached through a symlink is listed twice, in the form it was given and in its resolved form
0 commit comments