modelcontextprotocol / modelcontextprotocol/php-sdk
[Client] Implement Dynamic Client Registration (RFC 7591) + pre-registered client support
未关闭
还没有人认领这个 Issue。
auth
Client
enhancement
improves spec compliance
- 主要语言
- PHP
- 星标
- 1.6k
- 派生
- 173
- 平均合并
- 2 天 49 分钟
- 30 天内合并 PR
- 23
描述
Context
When no client credentials are pre-configured and AS metadata advertises registration_endpoint, the client must POST client_metadata to register itself dynamically. When credentials are pre-provided via Builder, skip registration.
Scope
Mcp\Client\Auth\DynamicClientRegistrar:- POST
client_metadata(client_name, redirect_uris, grant_types, token_endpoint_auth_method, software_id, software_version) toregistration_endpoint. - Persist returned
client_id/client_secret/client_secret_expires_atviaTokenStorageInterface.
- POST
Client\Builder::setOAuthClient(string $clientId, ?string $clientSecret = null)for pre-registration.
Conformance scenarios unblocked
auth/pre-registration (and unblocks every other auth scenario by providing a client_id).
Dependencies
Blocked by: #318 (AS metadata gives registration_endpoint).
Acceptance
- Unit tests for registration request shape + pre-registration bypass.
- Conformance:
auth/pre-registrationpasses.
cc @soyuka
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
先从 #318 中的 AS 元数据工作开始,然后检查 Mcp\Client\Auth\DynamicClientRegistrar、Client\Builder 和 TokenStorageInterface。运行 auth/pre-registration 一致性场景,并为注册请求的结构和绕过预注册添加所请求的单元测试。完成标准是该场景通过且返回的凭据已持久化。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- php
- 领域
- api, authentication
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 52/100