Skip to content

mcp: support per-resource cache policy for resources/read - #1202

Open
CocaineCong wants to merge 2 commits into
modelcontextprotocol:mainfrom
CocaineCong:feat/per-resource-cache-hint
Open

mcp: support per-resource cache policy for resources/read#1202
CocaineCong wants to merge 2 commits into
modelcontextprotocol:mainfrom
CocaineCong:feat/per-resource-cache-hint

Conversation

@CocaineCong

Copy link
Copy Markdown
Contributor

Fixes #1185

Desc: support per-resource cache policy for resources/read

Changes:

  • Add exported CacheHint{ TTLMs int, CacheScope string } type.
  • Add a CacheHint *CacheHint field to Resource and ResourceTemplate, tagged json:"-" so it never appears in resources/list or resources/templates/list.
  • readResource now applies the matched resource's/template's hint to the resources/read result via a new (*Cacheable).applyCacheHint.
  • Add UnitTest and passed.
  • Update docs/server.md.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcp: support per-resource cache policy for resources/read

1 participant