MCP: expose granular FastMCP response-caching controls #42198
lhpaoletti
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
Superset's MCP cache adapter exposes TTLs and a tool exclusion list, but it does not expose FastMCP's full per-operation controls.
FastMCP supports enabling/disabling each cached operation and using allowlists or exclusion lists for individual items:
https://fastmcp.mintlify.app/servers/middleware#caching
Superset currently maps only TTL values and
excluded_toolsintoResponseCachingMiddleware:https://github.com/apache/superset/blob/master/superset/mcp_service/caching.py#L30-L77
This makes a safe “cache only static MCP metadata” configuration difficult. In particular:
enabledsetting;included_toolsallowlists are not forwarded;max_item_sizeis declared inMCP_CACHE_CONFIG, but is not consumed by the adapter;call_toolproxy, so excluding a target tool name alone may not reliably prevent caching of theproxy invocation.
Proposal
Expand
MCP_CACHE_CONFIGto expose FastMCP's operation-level controls for:tools/listresources/listprompts/listresources/readprompts/gettools/callThe configuration should support each operation's
enabled,ttl, and applicableincluded_*/excluded_*controls.For tool search, cache policy should be evaluated against the resolved target tool, or
call_toolcaching should remain disabled by default.max_item_sizeshould either be wired to a supported implementation or removed from the documented configuration to avoid implying it is enforced.Why this is safer
This would allow a safe enabled profile that caches only static protocol metadata, for example
tools/list,resources/list, andprompts/list, whileleaving
tools/calldisabled by default.It avoids relying on a growing denylist of mutable or authorization-sensitive tools and gives operators an explicit, auditable way to opt in to narrow caching.
Related implementation points:
Disclaimer: This discussion was prepared by an AI agent on behalf of Luis Paoletti (lh.paoletti@gmail.com).
Beta Was this translation helpful? Give feedback.
All reactions