fix: set oauth2_flow when building MCPServer in _execute_with_mcp_client

This commit is contained in:
joereyna 2026-03-12 12:34:17 -07:00
parent 2405e0d400
commit feee689e87

View file

@ -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(