mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
feat(mcp): add oauth2_token_exchange auth type enum and credential fields
Adds the new `oauth2_token_exchange` value to MCPAuth enum and MCPAuthType literal, plus `audience`, `token_exchange_endpoint`, and `subject_token_type` fields to MCPCredentials TypedDict to support RFC 8693 token exchange. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f5382ebac9
commit
140238e2b8
1 changed files with 18 additions and 0 deletions
|
|
@ -35,6 +35,7 @@ class MCPAuth(str, enum.Enum):
|
|||
basic = "basic"
|
||||
authorization = "authorization"
|
||||
oauth2 = "oauth2"
|
||||
oauth2_token_exchange = "oauth2_token_exchange"
|
||||
|
||||
|
||||
# MCP Literals
|
||||
|
|
@ -50,6 +51,7 @@ MCPAuthType = Optional[
|
|||
MCPAuth.basic,
|
||||
MCPAuth.authorization,
|
||||
MCPAuth.oauth2,
|
||||
MCPAuth.oauth2_token_exchange,
|
||||
]
|
||||
]
|
||||
|
||||
|
|
@ -91,6 +93,22 @@ class MCPCredentials(TypedDict, total=False):
|
|||
OAuth 2.0 scopes to request when exchanging the client credentials
|
||||
"""
|
||||
|
||||
audience: Optional[str]
|
||||
"""
|
||||
Target audience for OAuth 2.0 Token Exchange (RFC 8693)
|
||||
"""
|
||||
|
||||
token_exchange_endpoint: Optional[str]
|
||||
"""
|
||||
IDP token endpoint for OAuth 2.0 Token Exchange (RFC 8693)
|
||||
"""
|
||||
|
||||
subject_token_type: Optional[str]
|
||||
"""
|
||||
Subject token type for OAuth 2.0 Token Exchange (RFC 8693).
|
||||
Default: urn:ietf:params:oauth:token-type:access_token
|
||||
"""
|
||||
|
||||
|
||||
class MCPServerCostInfo(TypedDict, total=False):
|
||||
default_cost_per_query: Optional[float]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue