MCPcopy Index your code
hub / github.com/modelcontextprotocol/python-sdk / protected

Function protected

tests/interaction/auth/test_bearer.py:47–52  ·  view source on GitHub ↗

A bearer-gated streamable-HTTP app (resource server only) on the in-process bridge.

()

Source from the content-addressed store, hash-verified

45
46@pytest.fixture
47async def protected() -> AsyncIterator[httpx.AsyncClient]:
48 """A bearer-gated streamable-HTTP app (resource server only) on the in-process bridge."""
49 server = Server("rs")
50 settings = auth_settings(required_scopes=[REQUIRED_SCOPE])
51 async with mounted_app(server, auth=settings, token_verifier=StaticTokenVerifier(TOKENS)) as (http, _):
52 yield http
53
54
55async def post_mcp(

Callers

nothing calls this directly

Calls 4

ServerClass · 0.90
auth_settingsFunction · 0.90
mounted_appFunction · 0.90
StaticTokenVerifierClass · 0.90

Tested by

no test coverage detected