modelcontextprotocol / modelcontextprotocol/python-sdk

Implement server-side support for Client ID Metadata Documents (CIMD)

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

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

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

説明

Summary

PR #1652 implemented client-side support for Client ID Metadata Documents (CIMD) per SEP-991, but the server-side implementation is missing. Authorization servers built with the Python SDK cannot currently support CIMD.

Background

CIMD (draft-ietf-oauth-client-id-metadata-document-00) allows OAuth clients to use HTTPS URLs as client identifiers, where the URL points to a JSON document containing client metadata. This is the recommended registration approach per the MCP spec (ahead of DCR).

From the MCP Authorization spec:

Authorization servers and MCP clients SHOULD support OAuth Client ID Metadata Documents

Current State

Client-side (implemented in #1652)
  • is_valid_client_metadata_url() - validates HTTPS URLs with path component
  • should_use_client_metadata_url() - checks if server advertises CIMD support
  • create_client_info_from_metadata_url() - uses URL as client_id
  • ✅ OAuth flow integration with DCR fallback
Server-side (missing)
  • ❌ Never advertises client_id_metadata_document_supported=true in OAuth metadata
  • ❌ No detection of URL-formatted client_ids
  • ❌ No metadata document fetching
  • ❌ No validation (client_id matching, redirect_uri verification, document structure)
  • ❌ No caching infrastructure
  • ❌ No SSRF protection for fetching

Spec Requirements for Authorization Servers

From the MCP spec and CIMD RFC:

Requirement Level
Fetch metadata documents when encountering URL-formatted client_ids SHOULD
Validate that fetched document's client_id matches the URL exactly MUST
Validate redirect URIs against those in the metadata document MUST
Validate document structure is valid JSON with required fields MUST
Cache metadata respecting HTTP cache headers SHOULD
Protect against SSRF attacks SHOULD
Limit document size (~5KB recommended) SHOULD
Display client_id hostname during consent SHOULD
Never cache error responses MUST NOT

References

AI Disclaimer

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

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

はじめの一歩

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

調査の方向性

まず PR #1652 のクライアント側 CIMD サポート、SDK の OAuth メタデータ、およびサーバー側の認可処理を確認します。欠落している URL client_id の検出、ドキュメントの取得、検証、キャッシュ、SSRF 保護を既存のエントリーポイントに対応付けます。認可サーバーが CIMD サポートを通知し、エラーをキャッシュせずに、記載された CIMD および MCP の要件を満たせば完了です。

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

評価

技術スタック
python
領域
api, authentication, backend, security
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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