modelcontextprotocol / modelcontextprotocol/python-sdk

Bug: validate_scope rejects client scopes when required scopes in None

オープン 初心者向け
#2,216 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

auth bug P2 ready for work
主要言語
Python
スター
24.3k
フォーク
4k
平均マージ
1日 1時間
マージ済み PR(30日)
31

説明

Initial Checks
Description

The validate_scope() function in the Python SDK incorrectly handles cases where there are no required scopes from the client. Instead of treating None as no restrictions, it interprets it as an empty list of allowed scopes. This causes scopes in the token to be rejected with InvalidScopeError, even if the client should be allowed to request them.

Example Code

Python & MCP Python SDK
1.26.0

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Python SDK 内の validate_scope を見つけ、値が None の場合に必須スコープがどのように処理されるかを追跡します。クライアントスコープが存在せず、トークンスコープが存在するケースを再現し、そのうえで有効なスコープが InvalidScopeError で拒否されなくなったことを確認し、この動作のテストカバレッジを追加します。

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

評価

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

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

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