Skip to content

[Minor-2] Caching semantics: CacheableResult + deterministic ordering #5685

Description

@Lang-Akshay

Part of #5677

Spec link: https://modelcontextprotocol.io/specification/draft/changelog
Comprised of: Minor change 3 (deterministic tools/list ordering) + Minor change 5 (CacheableResult — SEP-2549)

What the spec says

  • Results returned by tools/list, prompts/list, resources/list, resources/read, and resources/templates/list must include ttlMs and cacheScope via a new CacheableResult interface.
  • ttlMs is a freshness hint in milliseconds allowing clients to cache responses and reduce polling.
  • cacheScope ("public" or "private") controls whether shared intermediaries may cache the response.
  • Both fields complement — not replace — the existing listChanged notifications.
  • Servers SHOULD return tools from tools/list in a deterministic order to enable client-side caching and improve LLM prompt cache hit rates.

Gateway work

  • Add ttlMs/cacheScope to all applicable gateway responses with sensible, config-overridable per-endpoint defaults.
  • As a shared intermediary, honor upstream cacheScope: never place "private" results in shared cache tiers.
  • Aggregated responses: ttlMs = minimum across contributing upstreams; cacheScope = "private" if any contributor is private.
  • Guarantee stable, deterministic ordering in aggregated tool/prompt/resource lists (relevant to gateway prompt-cache friendliness too).

Acceptance criteria

  • All list/read responses carry valid CacheableResult fields.
  • "private" upstream results never enter shared cache tiers.
  • Repeated tools/list calls return byte-identical ordering absent registry changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CF-DATAPLANETasks related to the creation of new Data Plane for ContextForge.mcp-2026-07-28Issues related to compliance with MCP 2026-07-28rustRust programming

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions