diff --git a/src/mcp/client/session_group.py b/src/mcp/client/session_group.py index a430533b3..a77dc7a1e 100644 --- a/src/mcp/client/session_group.py +++ b/src/mcp/client/session_group.py @@ -154,7 +154,6 @@ async def __aexit__( for exit_stack in self._session_exit_stacks.values(): tg.start_soon(exit_stack.aclose) - @property def sessions(self) -> list[mcp.ClientSession]: """Returns the list of sessions being managed.""" diff --git a/src/mcp/server/auth/routes.py b/src/mcp/server/auth/routes.py index b12199f21..d588d78ee 100644 --- a/src/mcp/server/auth/routes.py +++ b/src/mcp/server/auth/routes.py @@ -153,12 +153,8 @@ def build_metadata( client_registration_options: ClientRegistrationOptions, revocation_options: RevocationOptions, ) -> OAuthMetadata: - authorization_url = AnyHttpUrl( - str(issuer_url).rstrip("/") + AUTHORIZATION_PATH - ) - token_url = AnyHttpUrl( - str(issuer_url).rstrip("/") + TOKEN_PATH - ) + authorization_url = AnyHttpUrl(str(issuer_url).rstrip("/") + AUTHORIZATION_PATH) + token_url = AnyHttpUrl(str(issuer_url).rstrip("/") + TOKEN_PATH) # Create metadata metadata = OAuthMetadata( diff --git a/tests/client/test_auth.py b/tests/client/test_auth.py index 781ec2129..2edaff946 100644 --- a/tests/client/test_auth.py +++ b/tests/client/test_auth.py @@ -359,7 +359,8 @@ def test_has_valid_token_valid(self, oauth_provider, oauth_token): assert oauth_provider._has_valid_token() - def test_has_valid_token_expired(self, oauth_provider, oauth_token): + @pytest.mark.anyio + async def test_has_valid_token_expired(self, oauth_provider, oauth_token): """Test token validation with expired token.""" oauth_provider._current_tokens = oauth_token oauth_provider._token_expiry_time = time.time() - 3600 # Past expiry @@ -810,7 +811,8 @@ def test_scope_priority_no_client_metadata_scope( # No scope should be set since client metadata doesn't have explicit scope assert "scope" not in auth_params - def test_scope_priority_no_scope(self, oauth_provider, oauth_client_info): + @pytest.mark.anyio + async def test_scope_priority_no_scope(self, oauth_provider, oauth_client_info): """Test that no scope parameter is set when no scopes specified.""" oauth_provider.client_metadata.scope = None oauth_provider._client_info = oauth_client_info