modelcontextprotocol / modelcontextprotocol/csharp-sdk

Add support for multiple resources per MCP Authentication scheme

Open
#586 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-auth enhancement needs confirmation
Dominant language
C#
Stars
4.5k
Forks
814
Avg merge
9d 19h
Merged PRs (30d)
4

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading McpAuthenticationHandler and the authorization specification linked in the issue to understand how one resource is currently associated with each scheme. Then inspect IMcpServerBuilder, McpServerOptions, and ConfigureSessionOptions to compare configuration paths; done means supporting multiple resources and endpoints without breaking existing Streamable HTTP or SSE behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, authentication
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.