Skip to content

Commit bb2a11f

Browse files
committed
Add required capabilities for resources
This commit introduces the concept of required capabilities for using resources in the MCP specification. It specifies that servers must include a 'resources' capability in their ServerCapabilities object during initialization. The commit also adds examples of server capabilities with and without subscription support, providing clear guidance for implementers on how to properly declare resource support.
1 parent 6d84d5b commit bb2a11f

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/spec/resources.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,35 @@ weight: 4
77

88
Resources enable servers to expose arbitrary data to clients in a structured way, specifically for providing context to language models. Clients can discover available resources, read their contents, and optionally subscribe to updates. Users may explicitly attach resources via the client UI, or clients can intelligently select appropriate resources to add to the context. Each resource is uniquely identified by a [URI](https://datatracker.ietf.org/doc/html/rfc3986).
99

10+
## Required Capabilities
11+
12+
To use resources, the server MUST include the `resources` capability in its `ServerCapabilities` object during the initialization process. The `resources` capability MAY include a `subscribe` field set to `true` if the server supports resource subscriptions.
13+
14+
Clients intending to use resources SHOULD check for the presence of the `resources` capability in the server's capabilities before attempting to use any resource-related methods. If the capability is not present, the client MUST NOT attempt to use resource-related methods, as the server does not support them.
15+
16+
Example of server capabilities with basic resource support:
17+
```json
18+
{
19+
"capabilities": {
20+
"resources": {}
21+
}
22+
}
23+
```
24+
25+
Example of server capabilities including resource support:
26+
27+
```json
28+
{
29+
"capabilities": {
30+
"resources": {
31+
"subscribe": true
32+
}
33+
}
34+
}
35+
```
36+
37+
In this example, the server supports both basic resource operations and subscriptions. If `subscribe` is omitted or set to `false`, the server only supports basic resource operations without subscriptions.
38+
1039
## Concepts
1140
### Resource
1241

0 commit comments

Comments
 (0)