modelcontextprotocol / modelcontextprotocol/python-sdk

Client Credentials In the token Handler

未关闭
#881 1 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

auth enhancement improves spec compliance P1 pending SEP approval
主要语言
Python
星标
24.3k
派生
4k
平均合并
1 天 1 小时
30 天内合并 PR
31

描述

Is your feature request related to a problem? Please describe.
The MCP Authorization Spec 2.1.1 OAuth Grant Types mentions that both Authorization Code and Client Credentials should be handled.

Describe the solution you'd like
In /server/auth/handlers/token.py, we only currently support "authorization-code". It would be fantastic if we could support "client-credentials" as well.

https://github.com/modelcontextprotocol/python-sdk/blob/544176770b53e6a0ae8c413d3b6c5116421f67df/src/mcp/server/auth/handlers/token.py#L26-L47

Describe alternatives you've considered
I mean it's just more convenient, so I don't have to do the whole PKCE exchange thing if it's not necessary.

Additional context

Image

Link to MCP spec: https://modelcontextprotocol.io/specification/2025-03-26/basic/authorization#2-1-1-oauth-grant-types

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先阅读 /server/auth/handlers/token.py,特别是现有的 authorization-code 处理,并将其与 issue 中链接的 MCP OAuth Grant Types 规范进行比较。确认预期的 client-credentials 行为,并找出 repository 中相关的测试或测试入口点。当 token handler 支持 client-credentials 和 authorization-code,且不要求 PKCE 交换时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
authentication
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
52/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。