Practical OAuth implementation for production
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 文档
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
- 技术栈
- csharp
调研方向
首先查看 samples/ProtectedMcpServer 和 tests/ModelContextProtocol.TestOAuthServer,然后阅读 issue #648 以及 AuthorizationServers 元数据的使用方式。为 remote MCP servers 记录一条实用的生产环境身份验证路径,包括是否支持现有提供商,以及 samples 中哪些部分仅用于教学。完成的标准是:指南能够回答实现相关的问题,而不要求读者自行推断协议细节。
由索引模型根据 Issue 内容生成。
描述
For building a production-ready remote MCP server with OAuth authentication, what is a practical way to implement the authentication part?
So far all the examples I've checked have comments like "not for production use" and often contain code implementing low-level details of some security protocols. For example, the ProtectedMcpServer sample seem to depend on the TestOAuthServer, which basically implements an OAuth server from scratch, including things like token encryption, encoding etc. This is very useful for educational purposes, but probably not very practical for building a real application.
It's also possible to point the AuthorizationServers metadata to an existing auth provider (Microsoft/Google/etc.), but seems like even that doesn't work well with some providers due to issues like https://github.com/modelcontextprotocol/csharp-sdk/issues/648, and it's not clear whether those issues might actually be by design due to incorrect usage.
So, as of today, how should someone building a real world MCP server go about authentication? Is their best bet to build an OAuth server from scratch just like the samples show? Or is there a better re-usable solution, ideally an existing authentication service that is well supported and works smoothly with MCP scenarios?
- 主要语言
- C#
- 星标
- 4.5k
- 派生
- 814
- 平均合并
- 9 天 19 小时
- 30 天内合并 PR
- 4
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/csharp-sdk 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
modelcontextprotocol/csharp-sdk#1867 ·
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
modelcontextprotocol/csharp-sdk#1840 · 1 条评论 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
modelcontextprotocol/csharp-sdk#1836 ·
维护者通常 2 天内回复
-
enhancement needs confirmation
难度 2/5 1-3 小时 新手友好度 64/100
modelcontextprotocol/csharp-sdk#678 · 1 条评论 ·
维护者通常 2 天内回复
-
enhancement needs confirmation P3 ready for work
难度 2/5 1-3 小时 新手友好度 68/100
modelcontextprotocol/csharp-sdk#515 · 6 条评论 · 3 个 reaction ·
维护者通常 2 天内回复
查看 modelcontextprotocol/csharp-sdk 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
microsoft/onnxruntime-genai#2633 ·
维护者通常 1 天内回复
-
python triage
难度 2/5 1-3 小时 新手友好度 85/100
microsoft/semantic-kernel#14491 ·
维护者通常 2 天内回复
-
area:jobads-cv FE mvp P3
难度 2/5 1-3 小时 新手友好度 88/100
klasolsson81/jobbliggaren#1878 ·
维护者通常 1 天内回复
-
bug help wanted
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
SubtitleEdit/subtitleedit#15331 · 2 条评论 ·
维护者通常 1 天内回复