fix(auth): match complete WWW-Authenticate parameters

Closed
TA
14d ago
+196-7

Summary

  • match WWW-Authenticate auth-param names only at parameter boundaries
  • prevent suffix matches such as error_scope satisfying scope
  • add regressions for scope and resource_metadata prefixed parameters

Test plan

  • uv run pytest tests/client/test_auth.py::TestWWWAuthenticate -q
  • uv run ruff check src/mcp/client/auth/utils.py tests/client/test_auth.py
  • uv run pyright src/mcp/client/auth/utils.py tests/client/test_auth.py
  • git diff --check

Related: https://github.com/modelcontextprotocol/python-sdk/issues/2902