modelcontextprotocol / modelcontextprotocol/python-sdk

Trailing slash in `.well-known/oauth-protected-resource` response may violate “Canonical Server URI” requirement

未關閉
#1,265 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

auth bug P1 ready for work
主要語言
Python
星號
24.3k
分支
4k
平均合併
1 天 1 小時
30 天內合併 PR
31

描述

Question

As I understand it, https://your-mcp.com/.well-known/oauth-protected-resource should return:

{
    "resource": "https://your-mcp.com",
    "authorization_servers": [
        "https://your-auth.com"
    ],
    "scopes_supported": [],
    "bearer_methods_supported": [
        "header"
    ]
}

However, it actually returns:

{
    "resource": "https://your-mcp.com/",
    "authorization_servers": [
        "https://your-auth.com/"
    ],
    "scopes_supported": [],
    "bearer_methods_supported": [
        "header"
    ]
}

Note the trailing / in both the resource and authorization_servers values.

According to the MCP spec’s “resource-parameter-implementation” section, I believe this violates the requirement for canonicalization:
https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization#resource-parameter-implementation

Is this a bug, or am I misunderstanding the requirement?

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先定位 .well-known/oauth-protected-resource 回應的實作,並將其 resourceauthorization_servers 值與連結的 MCP 正規化要求進行比較。確認預期的結尾斜線行為,然後為回應值找出或新增涵蓋範圍,以便驗證完成情況。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
api, authentication
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。