Roots let a client tell a server which directories and files it considers relevant, so the server can focus its work there. Roots are informational guidance, not an access-control mechanism: the protocol does not enforce that servers stay within roots. Important: roots are deprecated as of protocol version 2026-07-28. New implementations should not adopt them, and existing ones should migrate to passing directories or files via tool parameters, resource URIs, or server configuration.
What you need
- The client workspace folders you want the server to see
- A note of whether the client declares the roots capability
- The server documentation, to see how it accepts a working directory
Step 1: List the roots the client exposes
Check the client lists only the folders the task needs, each as a file:// URI with a name. The server requests them with roots/list, and the client should ask for your consent before exposing them.
Step 2: Confirm the server respects the boundaries
Check the server validates paths against the roots it was given and handles the case where a root becomes unavailable. Because roots are guidance only, do not rely on them as the only control: set folder access in the server configuration too.
Step 3: Plan the migration off roots
For new work, pass the working directory as a tool parameter, a resource URI, or a server configuration value instead of using roots. Keep roots only for an existing setup that still needs them, and remove them when the replacement is in place.
Worked example: synthetic roots check for one project
The table below is a synthetic example. It shows the expected result of checking roots; no server was connected.
| Check | Observed | Result |
|---|---|---|
| Roots listed | file:///home/user/projects/myproject | One folder |
| Client consent | Asked before exposing | Pass |
| Server respects boundary | Validates paths | Pass |
| Migration plan | Tool parameter instead | Planned |
Expected result (UNTESTED). one project folder is listed as a root, the server validates paths, and the replacement is planned. This check was not run live; the table shows the expected result for the synthetic example.
Limits
- Roots are deprecated as of protocol version 2026-07-28 and remain in the specification for at least twelve months after that revision before they can be removed.
- Roots do not enforce access control; a server can read outside them unless the host enforces it.
- A root URI must be a file:// URI in the current specification.
- Clients must validate root URIs to prevent path traversal.
