[Auth] OAuth proxy / DCR facade for non-DCR providers (e.g. Entra ID + Claude Code)
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- csharp
調査の方向性
まず、ModelContextProtocol.AspNetCore の認証サーフェスと、リンクされている FastMCP OAuthProxy/OIDCProxy の設計を確認します。DCR ファサード、callback の転送、token factory、State と PKCE の保護、OIDC discovery、および IDataProtector/IDistributedCache のストレージ境界を定義します。完了とは、Claude Code が upstream token を公開せずにプロキシ経由で認証できることです。
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem? Please describe.
Securing an MCP server with Entra ID is not workable when the connecting client is Claude Code. Entra ID doesn't support Dynamic Client Registration, and Claude Code has no app registration and no client_metadata_document_uri to offer, so there's no client_id to present and no supported registration path. Claude Code simply can't authenticate against an Entra-backed MCP server today.
This is distinct from #648 / PR #1402, which fix the resource= parameter bug for clients that already have a pre-registered client_id. That fix is necessary but not sufficient: our problem is upstream of it.
Describe the solution you'd like
A server-side OAuth proxy / DCR facade in ModelContextProtocol.AspNetCore, similar to what FastMCP (Python) ships as OAuthProxy / OIDCProxy. At a high level it would:
- Present a DCR-compliant surface to MCP clients: handle
POST /registerand return pre-registered credentials rather than attempting real DCR against the upstream provider - Handle callback forwarding: store the MCP client's dynamic redirect URI, use the server's fixed redirect URI with the upstream provider, and forward back to the client after token exchange
- Issue its own short-lived JWTs to MCP clients rather than forwarding the upstream token (token factory pattern), preventing token passthrough
- Encrypt and store upstream tokens server-side using
IDataProtectorandIDistributedCache - Support OIDC discovery: Entra exposes
/.well-known/openid-configuration, so endpoints should be auto-discoverable rather than manually configured
Describe alternatives you've considered
- External sidecar proxy (e.g.
mcp-auth-proxy): works, but adds ops complexity with no idiomatic .NET integration - Use a DCR-capable AS (Auth0, WorkOS): viable, but forces a third-party IdP dependency on teams already standardised on Entra
- Pre-registration + surfacing
client_idin PRM: only works for clients that support pre-registration or CIMD; Claude Code supports neither
Additional context
FastMCP's implementation is a useful reference for the security design: it includes confused deputy mitigation via state cookie binding, PKCE validation at both the client-to-proxy and proxy-to-upstream legs, and a token factory that ensures upstream tokens are never exposed to MCP clients.
- 主要言語
- C#
- スター
- 4.5k
- フォーク
- 814
- 平均マージ
- 9日 19時間
- マージ済み PR(30日)
- 4
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelcontextprotocol/csharp-sdk のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
modelcontextprotocol/csharp-sdk#1867 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
modelcontextprotocol/csharp-sdk#1840 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
modelcontextprotocol/csharp-sdk#1836 ·
-
enhancement needs confirmation
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
modelcontextprotocol/csharp-sdk#678 · コメント 1 件 ·
-
enhancement needs confirmation P3 ready for work
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
modelcontextprotocol/csharp-sdk#515 · コメント 6 件 · リアクション 3 件 ·
modelcontextprotocol/csharp-sdk の issue をすべて見る
似ている issue
-
effort:S P3 refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
nightscout/nocturne#1532 ·
-
core dependencies
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
C#/.NET Roslyn LSP オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
DotNetNext/SqlSugar#1458 ·