From a1ec57f98161e48ab8b3291375a1f00bf898475a Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Fri, 13 Feb 2026 11:05:40 -0800 Subject: [PATCH] feat(mcp): add MCP_TOKEN_EXCHANGE_CACHE_MAX_SIZE constant Sets cache max size to 500 for token exchange (higher than client_credentials since it's per-user). Co-Authored-By: Claude Opus 4.6 --- litellm/constants.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/litellm/constants.py b/litellm/constants.py index 88c57d3ce4c..6f11462cf5c 100644 --- a/litellm/constants.py +++ b/litellm/constants.py @@ -105,6 +105,11 @@ MCP_OAUTH2_TOKEN_CACHE_MIN_TTL = int( os.getenv("MCP_OAUTH2_TOKEN_CACHE_MIN_TTL", "10") ) +# MCP OAuth2 Token Exchange (OBO) Defaults +MCP_TOKEN_EXCHANGE_CACHE_MAX_SIZE = int( + os.getenv("MCP_TOKEN_EXCHANGE_CACHE_MAX_SIZE", "500") +) + LITELLM_UI_ALLOW_HEADERS = [ "x-litellm-semantic-filter", "x-litellm-semantic-filter-tools",