From 2ee38a585758c51958736e5b2e87c94828af59bd Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Fri, 13 Feb 2026 11:06:17 -0800 Subject: [PATCH] feat(mcp): handle oauth2_token_exchange in MCP client auth headers Adds the oauth2_token_exchange case to _get_auth_headers() so the exchanged token is sent as a Bearer token to the MCP server. Co-Authored-By: Claude Opus 4.6 --- litellm/experimental_mcp_client/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/litellm/experimental_mcp_client/client.py b/litellm/experimental_mcp_client/client.py index 5e21ff9754f..0e099e8fcfa 100644 --- a/litellm/experimental_mcp_client/client.py +++ b/litellm/experimental_mcp_client/client.py @@ -211,6 +211,8 @@ class MCPClient: headers["Authorization"] = self._mcp_auth_value elif self.auth_type == MCPAuth.oauth2: headers["Authorization"] = f"Bearer {self._mcp_auth_value}" + elif self.auth_type == MCPAuth.oauth2_token_exchange: + headers["Authorization"] = f"Bearer {self._mcp_auth_value}" elif isinstance(self._mcp_auth_value, dict): headers.update(self._mcp_auth_value)