The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix: set oauth2_flow when building MCPServer in _execute_with_mcp_client
joereynafeee689e878f
diff --git a/litellm/proxy/_experimental/mcp_server/rest_endpoints.py b/litellm/proxy/_experimental/mcp_server/rest_endpoints.pyindex 307caa2fbc8..298fe363425 100644--- a/litellm/proxy/_experimental/mcp_server/rest_endpoints.py+++ b/litellm/proxy/_experimental/mcp_server/rest_endpoints.py@@ -906,9 +906,11 @@ if MCP_AVAILABLE:client_id, client_secret, scopes = _extract_credentials(request)_oauth2_flow: Optional[Literal["client_credentials", "authorization_code"]] = (- "client_credentials"- if client_id and client_secret and request.token_url- else None+ request.oauth2_flow or (+ "client_credentials"+ if client_id and client_secret and request.token_url+ else None+ ))server_model = MCPServer(