diff --git a/src/mcp/client/auth.py b/src/mcp/client/auth.py index 775fb0f6c..17d2558f7 100644 --- a/src/mcp/client/auth.py +++ b/src/mcp/client/auth.py @@ -131,7 +131,7 @@ def is_token_valid(self) -> bool: and self.current_tokens.access_token and (not self.token_expiry_time or time.time() <= self.token_expiry_time) ) - + def can_refresh_token(self) -> bool: """Check if token can be refreshed.""" return bool(self.current_tokens and self.current_tokens.refresh_token and self.client_info) @@ -546,6 +546,6 @@ async def async_auth_flow(self, request: httpx.Request) -> AsyncGenerator[httpx. logger.exception("OAuth flow error") raise - # Retry with new tokens - self._add_auth_header(request) - yield request + # Retry with new tokens + self._add_auth_header(request) + yield request