From 62804e2f067d5bb6f86d9a5249ec5e1e8577eebc Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Mon, 16 Feb 2026 08:52:28 -0500 Subject: [PATCH] Add cache key identity note to middleware docs --- docs/servers/middleware.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/servers/middleware.mdx b/docs/servers/middleware.mdx index cea5d3c27..1c66fea33 100644 --- a/docs/servers/middleware.mdx +++ b/docs/servers/middleware.mdx @@ -431,6 +431,10 @@ mcp.add_middleware(ResponseCachingMiddleware( See [Storage Backends](/servers/storage-backends) for complete options. + +Cache keys are based on the operation name and arguments only — they do not include user or session identity. If your tools return user-specific data derived from auth context (e.g., headers or session state) rather than from the request arguments, you should either disable caching for those tools or ensure user identity is part of the tool arguments. + + ### Rate Limiting ```python