part…
Building governance for MCP?
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
Since 2026-07-28 certain results carry mandatory cache hints (SEP-2549). They are the modern replacement for "ask every time" and the complement to list_changed notifications.
Servers MUST include ttlMs and cacheScope in the complete results of: server/discover, tools/list, prompts/list, resources/list, resources/templates/list, resources/read. input_required results are not cacheable.
Method + the parameters that affect the result (uri in read, cursor in listings). The client MUST NOT serve a cached response to a request with a different method or parameters. Results of MRTR retries (with inputResponses/requestState) MUST NOT be cached.
ttlMsInteger in milliseconds, analogous to Cache-Control: max-age. Rules: 0 → immediately stale; positive → fresh for that long from receipt; absent → assume 0 (older servers only); negative → ignore and treat as 0. The server MUST give ttlMs >= 0. It is a freshness hint, not a guarantee of immutability.
Freshness: now < t_received + ttlMs. Clients SHOULD NOT use the TTL as a polling interval; anyone who polls MUST apply jitter and backoff. They MAY refresh earlier if there are signs of change (e.g. an unknown-tool error) and MAY serve stale content if the refresh fails.
cacheScope| Value | Meaning |
|---|---|
"public" |
No user-specific data; any client, gateway or shared cache MAY store it and serve it to any user. |
"private" |
Private data; reusable only within the same authorisation context; MUST NOT be shared across different tokens. |
Guidance: public for listings that are identical for everyone; private for user-dependent resources/read or filtered listings.
A server MAY provide ttlMs without listChanged (TTL-based freshness only) or both (the notification invalidates immediately even if the TTL has not expired).
Each page is an independent cacheable response with its own TTL; there MAY be different TTLs per page; when one expires, it is refetched with its cursor; there is no consistency guarantee across pages (duplicates or gaps are possible); for a consistent snapshot, refetch from the start; invalid cursor → discard everything and start over. All pages of a list MUST have the same cacheScope.
A public on an authenticated endpoint means the response may end up shared across different authorisation contexts. Servers: cacheScope must reflect the actual visibility; they MUST apply access control per primitive and MUST NOT rely on cacheScope as access control.
public globally and private per authorisation context (key = method + params + token identity, never the raw token).ttlMs towards the server side and publish towards hosts your own ttlMs (less than or equal) and a cacheScope that is never laxer than the original.public.1. What must a client assume if ttlMs is missing?
Absence should only occur with older servers and is treated as 0.
2. Can a cacheScope private response be shared between two different access tokens?
A different token is a different context.
3. Is the result of an MRTR retry cached?
It depends on inputs that are not part of the cache key.
4. If notifications/tools/list_changed arrives while the cache is still fresh…
The notification acts as an immediate invalidation.