modelcontextprotocol / modelcontextprotocol/php-sdk
[Client] Add OAuth 2025-03-26 metadata backcompat fallback
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.6k
- Forks
- 173
- Avg merge
- 2d 49m
- Merged PRs (30d)
- 23
Description
Context
Older MCP servers (spec revision 2025-03-26) do not publish /.well-known/oauth-protected-resource. The client must fall back to discovering OAuth metadata directly from the MCP server origin's /.well-known/oauth-authorization-server and, if missing, from the issuer derived by URL convention.
Scope
- Order of operations when
WWW-Authenticatelacksresource_metadata:- Try
/.well-known/oauth-protected-resourceat MCP server origin. - Try
/.well-known/oauth-authorization-serverat MCP server origin. - Fall back to OIDC discovery (
/.well-known/openid-configuration).
- Try
- Track protocol revision negotiated during
initialize; only enable fallback chain when the server announced2025-03-26.
Conformance scenarios unblocked
auth/2025-03-26-oauth-metadata-backcompat, auth/2025-03-26-oauth-endpoint-fallback.
Dependencies
Blocked by: #317, #318.
Acceptance
- Unit tests covering all fallback branches.
- Conformance: 2 baseline scenarios pass.
cc @soyuka
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the PHP client’s initialize negotiation and its handling of WWW-Authenticate when resource_metadata is absent. Implement and test the ordered discovery branches for the MCP origin and issuer-derived URL, gated on revision 2025-03-26. Verify the unit-test branches and the auth/2025-03-26-oauth-metadata-backcompat and auth/2025-03-26-oauth-endpoint-fallback conformance scenarios after blockers #317 and #318 are resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, authentication
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100