Switch RFC7523OAuthClientProvider warning to MCPDeprecationWarning (#2996)

This commit is contained in:
Marcelo Trylesinski 2026-06-26 15:27:57 +02:00 • committed by GitHub
commit cc596195bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,6 +20,7 @@ from mcp.shared.auth import (
OAuthMetadata,
OAuthToken,
)
from mcp.shared.exceptions import MCPDeprecationWarning
class MockTokenStorage:
@ -68,7 +69,7 @@ def rfc7523_oauth_provider(client_metadata: OAuthClientMetadata, mock_storage: M
return AuthorizationCodeResult(code="test_auth_code", state="test_state")
with warnings.catch_warnings():
warnings.simplefilter("ignore", DeprecationWarning)
warnings.simplefilter("ignore", MCPDeprecationWarning)
return RFC7523OAuthClientProvider(
server_url="https://api.example.com/v1/mcp",
client_metadata=client_metadata,