You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
A server may expose both public static resources and tenant-specific resource templates. Today, assigning the correct ttlMs and cacheScope to each resources/read result requires receiving middleware—or the proposed DefaultCacheable callback in #1128—to inspect the request URI. That duplicates policy already known where the resource is registered.
Describe the solution you'd like
Allow direct resources and resource templates to declare a cache hint at registration. The matched resource's hint should apply only to its resources/read result, take precedence over the server default, and not appear in resources/list or resources/templates/list.
For example, a server could register static documentation as public and a tenant-backed template as private without central URI matching.
The TypeScript SDK already supports this through cacheHint on registerResource.
Describe alternatives you've considered
Receiving middleware works, but moves resource-specific policy away from registration.
mcp: add ServerOptions.DefaultCacheable #1128's server-level callback is useful for broad or request-dependent defaults, but registration-level policy would complement it for stable per-resource semantics.
Is your feature request related to a problem? Please describe.
A server may expose both public static resources and tenant-specific resource templates. Today, assigning the correct
ttlMsandcacheScopeto eachresources/readresult requires receiving middleware—or the proposedDefaultCacheablecallback in #1128—to inspect the request URI. That duplicates policy already known where the resource is registered.Describe the solution you'd like
Allow direct resources and resource templates to declare a cache hint at registration. The matched resource's hint should apply only to its
resources/readresult, take precedence over the server default, and not appear inresources/listorresources/templates/list.For example, a server could register static documentation as
publicand a tenant-backed template asprivatewithout central URI matching.The TypeScript SDK already supports this through
cacheHintonregisterResource.Describe alternatives you've considered
Additional context
Related: #1094 and #1128.