modelcontextprotocol / modelcontextprotocol/php-sdk
[Client] Implement Protected Resource Metadata discovery (RFC 9728)
まだ誰も着手していません。
- 主要言語
- PHP
- スター
- 1.6k
- フォーク
- 173
- 平均マージ
- 2日 49分
- マージ済み PR(30日)
- 23
説明
Context
Per the MCP authorization spec (2025-06-18+), an unauthenticated client receiving a 401 MUST parse WWW-Authenticate: Bearer resource_metadata="<url>", fetch the indicated /.well-known/oauth-protected-resource document, and use it to locate the authorization server.
Scope
Mcp\Client\Auth\ProtectedResourceMetadataDiscoverer:- Parse
WWW-Authenticateforresource_metadata. - GET the URL, parse JSON.
- Resolve
authorization_servers[],bearer_methods_supported,scopes_supported,resource(audience).
- Parse
- Validate
resourcematches the MCP server origin (defense-in-depth forauth/resource-mismatch, already passing).
Conformance scenarios unblocked
auth/metadata-default, auth/metadata-var1, auth/metadata-var2, auth/metadata-var3, auth/basic-cimd.
Dependencies
Blocked by: #316 (Bearer injection plumbs the 401 hook).
Acceptance
- Unit + integration tests against fixtures from the conformance fixtures dir.
- Conformance: 4 baseline scenarios above pass.
cc @soyuka
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
#316から始めて401フックを理解し、次にMcp\Client\Auth\ProtectedResourceMetadataDiscovererとconformance fixturesディレクトリを調査します。メタデータ検出のスコープを実装し、ユニットテストと統合テストのカバレッジを追加します。完了の条件は、記載されている4つのベースラインシナリオにパスし、resource-mismatchのバリデーションも引き続きパスすることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- php
- 領域
- api, authentication
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100