66from pydantic import AnyHttpUrl
77
88from mcp .client .auth .oauth import (
9+ AccessToken ,
910 ClientMetadata ,
1011 DynamicClientRegistration ,
1112 OAuthClient ,
@@ -24,7 +25,30 @@ def client_metadata(self) -> ClientMetadata:
2425 response_types = ["code" ],
2526 )
2627
27- def save_client_information (self , metadata : DynamicClientRegistration ) -> None :
28+ @property
29+ def redirect_url (self ) -> AnyHttpUrl :
30+ return AnyHttpUrl ("https://client.example.com/callback" )
31+
32+ async def open_user_agent (self , url : AnyHttpUrl ) -> None :
33+ pass
34+
35+ async def client_registration (
36+ self , issuer : AnyHttpUrl
37+ ) -> DynamicClientRegistration | None :
38+ return None
39+
40+ async def store_client_registration (
41+ self , issuer : AnyHttpUrl , metadata : DynamicClientRegistration
42+ ) -> None :
43+ pass
44+
45+ def code_verifier (self ) -> str :
46+ return "test-code-verifier"
47+
48+ async def token (self ) -> AccessToken | None :
49+ return None
50+
51+ async def store_token (self , token : AccessToken ) -> None :
2852 pass
2953
3054
@@ -229,8 +253,5 @@ def test_build_discovery_url_with_various_formats(input_url, expected_discovery_
229253 # Create auth client with the given URL
230254 auth_client = OAuthClient (AnyHttpUrl (input_url ), MockOauthClientProvider ())
231255
232- # Call the method under test
233- discovery_url = auth_client ._build_discovery_url ()
234-
235256 # Assertions
236- assert discovery_url == AnyHttpUrl (expected_discovery_url )
257+ assert auth_client . discovery_url == AnyHttpUrl (expected_discovery_url )
0 commit comments