[Auth] OAuth proxy / DCR facade for non-DCR providers (e.g. Entra ID + Claude Code)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- csharp
- Lĩnh vực
- authentication, backend-api-design, security
Hướng nghiên cứu
Bắt đầu bằng cách rà soát bề mặt xác thực trong ModelContextProtocol.AspNetCore và thiết kế FastMCP OAuthProxy/OIDCProxy được liên kết. Xác định facade DCR, việc chuyển tiếp callback, token factory, các cơ chế bảo vệ State và PKCE, OIDC discovery, cùng các ranh giới lưu trữ của IDataProtector/IDistributedCache; hoàn thành có nghĩa là Claude Code có thể xác thực thông qua proxy mà không để lộ upstream token.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- C#
- Star
- 4.6k
- Fork
- 817
- Merge trung bình
- 8 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/csharp-sdk
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
modelcontextprotocol/csharp-sdk#1867 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
modelcontextprotocol/csharp-sdk#1840 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
modelcontextprotocol/csharp-sdk#1836 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement needs confirmation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
modelcontextprotocol/csharp-sdk#678 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement needs confirmation P3 ready for work
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
modelcontextprotocol/csharp-sdk#515 · 6 bình luận · 3 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của modelcontextprotocol/csharp-sdk
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
builtbybel/CrapFixer#112 ·
-
area-ai untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
dotnet/extensions#7790 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Beginner Friendly T: Bugfix
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
space-wizards/space-station-14#46220 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
P2 testing
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area-Infrastructure-coreclr os-ios os-maccatalyst os-tvos untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
dotnet/runtime#134766 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày