modelcontextprotocol / modelcontextprotocol/python-sdk

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

オープン
#1,265 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

auth bug P1 ready for work
主要言語
Python
スター
24.3k
フォーク
4k
平均マージ
1日 1時間
マージ済み PR(30日)
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. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず .well-known/oauth-protected-resource のレスポンスの実装箇所を特定し、その resourceauthorization_servers の値を、リンク先の MCP の正規化要件と比較します。末尾のスラッシュに関する想定動作を確認し、その後、レスポンスの値について、完了を検証できるようにテストカバレッジを特定するか追加します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
api, authentication
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。