modelcontextprotocol / modelcontextprotocol/csharp-sdk
Add support for multiple resources per MCP Authentication scheme
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 4.5k
- Forks
- 814
- Ø Merge
- 9 T. 19 Std.
- Gemergte PRs (30 T.)
- 4
Beschreibung
Currently, the McpAuthenticationHandler only supports responding with a single "resource" URI per scheme name as defined in https://www.rfc-editor.org/rfc/rfc9728.html. This means that you can only use OAuth for one of either the Streamable HTTP endpoint ("/") or the SSE endpoint ("/sse"), but not both. Technically, the new auth spec only applies to Streamable HTTP since that's the only HTTP transport defined in the 2025-06-18 spec and the 2025-03-26 spec for that matter, but the currently neither the server or the client code on the csharp-sdk treat SSE any differently than Streamable HTTP.
Furthermore, it be nice to be able to define multiple Streamable HTTP endpoints on different paths on a single HTTP server. However, this is something we should look at improving in general, since configuring the IMcpServerBuilder and/or McpServerOptions in the typical way doesn't allow multitenancy, and using ConfigureSessionOptions is a bit awkward.
https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, McpAuthenticationHandler und die im Issue verlinkte Autorisierungsspezifikation zu lesen, um zu verstehen, wie derzeit eine Ressource jedem Schema zugeordnet wird. Untersuche anschließend IMcpServerBuilder, McpServerOptions und ConfigureSessionOptions, um die Konfigurationspfade zu vergleichen; die Arbeit ist abgeschlossen, wenn mehrere Ressourcen und Endpunkte unterstützt werden, ohne das bestehende Streamable HTTP- oder SSE-Verhalten zu beeinträchtigen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp
- Bereich
- api, authentication
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100