Replace httpx and httpx-sse with httpx2 (#2972)
Some checks failed
CI / checks (push) Has been cancelled
CI / all-green (push) Has been cancelled

Co-authored-by: Max Isbey <224885523+maxisbey@users.noreply.github.com>
This commit is contained in:
Marcelo Trylesinski 2026-07-14 18:05:08 +02:00 • committed by GitHub
commit 2713b53b12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,7 +10,7 @@ import secrets
import time
from urllib.parse import parse_qs, urlsplit
import httpx
import httpx2
from pydantic import AnyHttpUrl
from mcp.server.auth.provider import (
@ -49,14 +49,14 @@ class InMemoryTokenStorage:
class HeadlessOAuth:
"""Completes the authorize redirect in-process via the bound ``httpx`` client."""
"""Completes the authorize redirect in-process via the bound ``httpx2`` client."""
def __init__(self) -> None:
self.authorize_url: str | None = None
self._http: httpx.AsyncClient | None = None
self._http: httpx2.AsyncClient | None = None
self._result = AuthorizationCodeResult(code="", state=None)
def bind(self, http_client: httpx.AsyncClient) -> None:
def bind(self, http_client: httpx2.AsyncClient) -> None:
self._http = http_client
async def redirect_handler(self, authorization_url: str) -> None: