Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions docs/specification/draft/schema.mdx

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions docs/specification/draft/server/discover.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The request carries no body parameters beyond the standard `_meta`:
## Response

The server replies with its supported protocol versions, capabilities, and
identity:
identity. This operation supports [caching](/specification/draft/server/utilities/caching).

```json
{
Expand All @@ -50,7 +50,9 @@ identity:
"name": "ExampleServer",
"version": "1.0.0"
},
"instructions": "This server provides weather and resource utilities."
"instructions": "This server provides weather and resource utilities.",
"ttlMs": 3600000,
"cacheScope": "public"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/specification/draft/server/prompts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ per-request input, not connection state.
### Listing Prompts

To retrieve available prompts, clients send a `prompts/list` request. This operation
supports [pagination](/specification/draft/server/utilities/pagination).
supports [pagination](/specification/draft/server/utilities/pagination) and [caching](/specification/draft/server/utilities/caching).

**Request:**

Expand Down
7 changes: 4 additions & 3 deletions docs/specification/draft/server/resources.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ per-request input, not connection state.
### Listing Resources

To discover available resources, clients send a `resources/list` request. This operation
supports [pagination](/specification/draft/server/utilities/pagination).
supports [pagination](/specification/draft/server/utilities/pagination) and [caching](/specification/draft/server/utilities/caching).

**Request:**

Expand Down Expand Up @@ -124,7 +124,8 @@ supports [pagination](/specification/draft/server/utilities/pagination).

### Reading Resources

To retrieve resource contents, clients send a `resources/read` request:
To retrieve resource contents, clients send a `resources/read` request. This operation
supports [caching](/specification/draft/server/utilities/caching).

**Request:**

Expand Down Expand Up @@ -173,7 +174,7 @@ Alternatively, if the scheme of `uri` is `https://`, clients may fetch the resou
Resource templates allow servers to expose parameterized resources using
[URI templates](https://datatracker.ietf.org/doc/html/rfc6570). Arguments may be
auto-completed through [the completion API](/specification/draft/server/utilities/completion).
This operation supports [pagination](/specification/draft/server/utilities/pagination).
This operation supports [pagination](/specification/draft/server/utilities/pagination) and [caching](/specification/draft/server/utilities/caching).

**Request:**

Expand Down
2 changes: 1 addition & 1 deletion docs/specification/draft/server/tools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ are included in model context.
### Listing Tools

To discover available tools, clients send a `tools/list` request. This operation supports
[pagination](/specification/draft/server/utilities/pagination).
[pagination](/specification/draft/server/utilities/pagination) and [caching](/specification/draft/server/utilities/caching).

**Request:**

Expand Down
6 changes: 3 additions & 3 deletions docs/specification/draft/server/utilities/caching.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ title: Caching

<div id="enable-section-numbers" />

The Model Context Protocol (MCP) supports caching on list and
resource read results. This allows clients to cache responses and reduce unnecessary re-fetching.
The Model Context Protocol (MCP) supports caching for some results. This allows clients to cache responses and reduce unnecessary re-fetching.
Caching is complementary to [change notifications](#interaction-with-notifications)&mdash;both
mechanisms can coexist.

## Cacheable Results

Servers MUST include caching hints on results returned by the following operations:

- `server/discover`
- `tools/list`
Comment thread
CaitieM20 marked this conversation as resolved.
- `prompts/list`
- `resources/list`
Expand All @@ -23,7 +23,7 @@ Servers MUST include caching hints on results returned by the following operatio

Cacheable Results in MCP use two fields to provide caching hints to clients:

- The <b>Time-to-live (TTL) Field</b>,`ttlMs`, indicates how long the client MAY consider the result fresh.
- The <b>Time-to-live (TTL) Field</b>,`ttlMs`, is an integer value in milliseconds specifying how long the client MAY consider the result fresh.
- The <b>Cache Scope Field</b>,`cacheScope`, indicates the intended scope of the cached response, either `"public"` or `"private"`.

### Time-to-Live (TTL) Field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
"name": "ExampleServer",
"version": "1.0.0"
},
"instructions": "This server provides weather and resource utilities. Prefer `get_weather` for forecast lookups."
"instructions": "This server provides weather and resource utilities. Prefer `get_weather` for forecast lookups.",
"ttlMs": 3600000,
"cacheScope": "public"
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"serverInfo": {
"name": "ExampleServer",
"version": "1.0.0"
}
},
"ttlMs": 3600000,
"cacheScope": "public"
}
}
17 changes: 16 additions & 1 deletion schema/draft/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion schema/draft/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ export interface DiscoverRequest extends JSONRPCRequest {
*
* @category `server/discover`
*/
export interface DiscoverResult extends Result {
export interface DiscoverResult extends CacheableResult {
/**
* MCP Protocol Versions this server supports. The client should choose a
* version from this list for use in subsequent requests.
Expand Down
Loading