mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
parent
df081c02d6
commit
2ee38a5857
1 changed files with 2 additions and 0 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue