Skip to content

Implement SEP-2549: TTL for List Results #2802

Closed

Description

@localden

Tracking implementation of SEP-2549 for the 2026-07-28 MCP spec release.

Activity

  1. added
    enhancement
    on Jun 6, 2026
  2. MicroYui commented on Jun 9, 2026

    @MicroYui

    Hi @localden , I'd like to work on this.

    I took a first pass through the Python SDK implementation and this looks like a focused schema/types update rather than a client-side caching implementation. My current plan is:

    • add a CacheableResult protocol model in src/mcp/types/_types.py with ttl_ms: int serialized as ttlMs and cache_scope: Literal["public", "private"] serialized as cacheScope;
    • update ListToolsResult, ListPromptsResult, ListResourcesResult, ListResourceTemplatesResult, and ReadResourceResult to include the SEP-2549 fields;
    • re-export the new type from mcp.types;
    • add type/serialization tests covering both Python field names and JSON aliases, including validation for ttlMs >= 0 and allowed cacheScope values.

    I’ll keep the scope limited to exposing the cache hints in the protocol models, since SEP-2549 describes them as server-provided hints and does not require the SDK client to implement an actual cache.

  3. maxisbey commented on Jun 29, 2026

    @maxisbey
    Contributor

    The wire fields have been in the 2026 type set for a while; #3015 landed the remaining piece — an operator-facing cache_hints constructor map on Server/MCPServer with per-handler override, stamped onto cacheable results with the spec defaults (ttlMs: 0, cacheScope: "private"). Caching conformance scenarios pass with no expected-failure entries. Closing. (@MicroYui — thanks for the offer back in June; the types portion you scoped ended up landing through the broader 2026 types work, and the authoring layer via #3015.)

    AI Disclaimer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions