Remove the deprecated RFC7523OAuthClientProvider (#3169)

This commit is contained in:
Max 2026-07-25 22:50:57 +01:00 • committed by GitHub
commit 7163d8263f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,11 +10,9 @@ from docs_src.oauth_clients import tutorial001, tutorial002
from mcp.client.auth import OAuthClientProvider, OAuthFlowError, OAuthRegistrationError, OAuthTokenError, TokenStorage
from mcp.client.auth.extensions.client_credentials import (
PrivateKeyJWTOAuthProvider,
RFC7523OAuthClientProvider,
static_assertion_provider,
)
from mcp.shared.auth import OAuthClientInformationFull, OAuthClientMetadata, OAuthToken
from mcp.shared.exceptions import MCPDeprecationWarning
# See test_index.py for why this is a per-module mark and not a conftest hook.
pytestmark = [pytest.mark.anyio, pytest.mark.filterwarnings("error::mcp.MCPDeprecationWarning")]
@ -104,16 +102,6 @@ async def test_the_one_more_provider_is_private_key_jwt() -> None:
assert provider.context.client_metadata.token_endpoint_auth_method == "private_key_jwt"
async def test_the_page_does_not_count_the_deprecated_provider() -> None:
"""Why the `!!! info` says *one* more provider: `RFC7523OAuthClientProvider` warns on construction."""
with pytest.warns(MCPDeprecationWarning, match="RFC7523OAuthClientProvider is deprecated"):
RFC7523OAuthClientProvider(
server_url="http://localhost:8001/mcp",
client_metadata=tutorial001.oauth.context.client_metadata,
storage=tutorial001.InMemoryTokenStorage(),
)
async def test_every_oauth_error_is_an_oauth_flow_error() -> None:
"""Catch `OAuthFlowError` and you have caught registration and token failures too."""
assert issubclass(OAuthRegistrationError, OAuthFlowError)