modelcontextprotocol / modelcontextprotocol/php-sdk
[Client] Add OAuth 2.0 credential storage interface (TokenStorageInterface)
オープン
まだ誰も着手していません。
auth
Client
enhancement
improves spec compliance
- 主要言語
- PHP
- スター
- 1.6k
- フォーク
- 173
- 平均マージ
- 2日 49分
- マージ済み PR(30日)
- 23
説明
Context
Foundation for every OAuth flow on the client side. Without a storage abstraction we cannot persist access tokens, refresh tokens, registered client credentials, or PKCE verifiers across requests/sessions.
Scope
- Define
Mcp\Client\Auth\TokenStorageInterfacewith operations:getToken(string $resourceUrl): ?TokenSet,storeToken(string $resourceUrl, TokenSet $token): void,clearToken(string $resourceUrl): void, plus equivalents for registered client metadata. - Value object
TokenSet(access_token, refresh_token, expires_at, scope, token_type). - Default implementations:
InMemoryTokenStorage(ephemeral, per-process).Psr16TokenStorageadapter for PSR-16CacheInterface.
- Wire into
Client\Builder::setTokenStorage(...)(optional; defaults to in-memory).
Conformance scenarios unblocked
Prerequisite for all auth/* baseline scenarios.
Dependencies
None — must land first.
Acceptance
- Interface + value object + 2 storage adapters in
src/Client/Auth/. - Unit tests for both adapters.
- Builder method documented.
cc @soyuka
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Client\Builder と auth/* の baseline シナリオから始め、続いて src/Client/Auth/ の領域を調査します。Interface、TokenSet、両方の adapter、builder の配線、および unit test を、一覧にある操作と受け入れ条件に照らして確認します。optional な builder configuration とその documentation までカバーできれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- php
- 領域
- api, authentication
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100