Skip to content

Commit 924cce9

Browse files
committed
Update roots.md
1 parent d9aae47 commit 924cce9

File tree

1 file changed

+15
-21
lines changed

1 file changed

+15
-21
lines changed

docs/specification/client/roots.md

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,21 @@ weight: 40
88
**Protocol Revision**: {{< param protocolRevision >}}
99
{{< /callout >}}
1010

11-
The Model Context Protocol (MCP) provides a standardized way for clients to expose filesystem roots to servers. Roots define the boundaries of where servers can operate within the filesystem, allowing them to understand which directories and files they have access to. Servers can request the list of roots from supporting clients and receive notifications when that list changes.
11+
The Model Context Protocol (MCP) provides a standardized way for clients to expose filesystem "roots" to servers. Roots define the boundaries of where servers can operate within the filesystem, allowing them to understand which directories and files they have access to. Servers can request the list of roots from supporting clients and receive notifications when that list changes.
1212

1313
## User Interaction Model
1414

15-
Roots in MCP are typically exposed through workspace or project configuration interfaces. A recommended implementation pattern is a workspace/project picker that allows users to select directories and files the server should have access to. This can be combined with automatic workspace detection from version control systems or project files.
15+
Roots in MCP are typically exposed through workspace or project configuration interfaces.
16+
17+
For example, implementations could offer a workspace/project picker that allows users to select directories and files the server should have access to. This can be combined with automatic workspace detection from version control systems or project files:
1618

1719
![Example of root selection interface](root-picker.png)
1820

19-
However, implementations are free to expose roots through any interface pattern that suits their needs - the protocol itself does not mandate any specific user interaction model.
21+
However, implementations are free to expose roots through any interface pattern that suits their needs&mdash;the protocol itself does not mandate any specific user interaction model.
2022

2123
## Capabilities
2224

23-
Clients that support roots MUST include a `roots` capability in their `ClientCapabilities` during initialization:
25+
Clients that support prompts **MUST** declare the `roots` capability during [initialization]({{< ref "/specification/basic/lifecycle#initialization" >}}):
2426

2527
```json
2628
{
@@ -32,13 +34,13 @@ Clients that support roots MUST include a `roots` capability in their `ClientCap
3234
}
3335
```
3436

35-
The `listChanged` property indicates whether the client supports notifications about changes to the root list.
37+
`listChanged` indicates whether the client will emit notifications when the list of roots changes.
3638

3739
## Protocol Messages
3840

3941
### Listing Roots
4042

41-
To retrieve available roots, servers send a `roots/list` request:
43+
To retrieve roots, servers send a `roots/list` request:
4244

4345
**Request:**
4446
```json
@@ -99,8 +101,8 @@ sequenceDiagram
99101

100102
A root definition includes:
101103

102-
- `uri`: Unique identifier for the root (currently restricted to `file://` URIs)
103-
- `name`: Optional human-readable name for display purposes
104+
- `uri`: Unique identifier for the root. This **MUST** be a `file://` URI in the current specification.
105+
- `name`: Optional human-readable name for display purposes.
104106

105107
Example roots for different use cases:
106108

@@ -131,7 +133,6 @@ Example roots for different use cases:
131133
Clients SHOULD return standard JSON-RPC errors for common failure cases:
132134

133135
- Client does not support roots: `-32601` (Method not found)
134-
- Access denied: `-32002`
135136
- Internal errors: `-32603`
136137

137138
Example error:
@@ -151,34 +152,27 @@ Example error:
151152

152153
## Security Considerations
153154

154-
1. Clients MUST:
155+
1. Clients **MUST**:
155156
- Only expose roots with appropriate permissions
156157
- Validate all root URIs to prevent path traversal
157158
- Implement proper access controls
158159
- Monitor root accessibility
159160

160-
2. Servers SHOULD:
161+
2. Servers **SHOULD**:
161162
- Handle cases where roots become unavailable
162163
- Respect root boundaries during operations
163164
- Validate all paths against provided roots
164165

165166
## Implementation Guidelines
166167

167-
1. Clients SHOULD:
168+
1. Clients **SHOULD**:
169+
- Prompt users for consent before exposing roots to servers
168170
- Provide clear user interfaces for root management
169-
- Support automatic root detection where applicable
170171
- Validate root accessibility before exposing
171172
- Monitor for root changes
172173

173-
2. Servers SHOULD:
174+
2. Servers **SHOULD**:
174175
- Check for roots capability before usage
175176
- Handle root list changes gracefully
176177
- Respect root boundaries in operations
177178
- Cache root information appropriately
178-
179-
## See Also
180-
181-
{{< cards >}}
182-
{{< card link="/basic/lifecycle" title="Lifecycle" icon="refresh" >}}
183-
{{< card link="/server/resources" title="Resources" icon="document" >}}
184-
{{< /cards >}}

0 commit comments

Comments
 (0)