Skip to content

Commit 958b492

Browse files
committed
test: import Server from the public mcp.server surface; fix stale shim docstring
Use the public 'from mcp.server import Server' in tests/client/test_auth.py, matching __all__ and the sibling test files, and reword the _FirstChallenge docstring which still claimed the bearer middleware cannot emit scope= in its challenge (no longer true since the scope attribute fix).
1 parent cd22f04 commit 958b492

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

tests/client/test_auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
validate_authorization_response_iss,
3333
validate_metadata_issuer,
3434
)
35+
from mcp.server import Server
3536
from mcp.server.auth.provider import AccessToken
3637
from mcp.server.auth.routes import build_metadata
3738
from mcp.server.auth.settings import AuthSettings, ClientRegistrationOptions, RevocationOptions
38-
from mcp.server.lowlevel.server import Server
3939
from mcp.shared.auth import (
4040
AuthorizationCodeResult,
4141
OAuthClientInformationFull,

tests/interaction/auth/_harness.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,10 @@ class _FirstChallenge:
278278
"""ASGI shim that answers the first request to a path with 401 + a given WWW-Authenticate.
279279
280280
Subsequent requests pass through to the wrapped app. Used to make the initial 401 carry
281-
parameters (such as `scope=`) that the SDK's own bearer middleware cannot be configured
282-
to emit, so client behaviour driven by those parameters is reachable end to end. Reserve
283-
this pattern for behaviour the real server cannot be made to produce.
281+
a challenge shape the SDK's own bearer middleware cannot be configured to emit for the
282+
scenario under test (e.g. a `scope` differing from the configured `required_scopes`), so
283+
client behaviour driven by those parameters is reachable end to end. Reserve this pattern
284+
for behaviour the real server cannot be made to produce.
284285
"""
285286

286287
app: ASGIApp

0 commit comments

Comments
 (0)