modelcontextprotocol / modelcontextprotocol/csharp-sdk

Add Granular Authorization Support to SSE ServerTools

Open
#483 7 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Currently it appears we can only add auth at the MapMcp level, which is good for securing the toolset, but is missing the granular control we enjoy in other web-based services.

Describe the solution you'd like
Something like .WithTools().RequireAuthorization(policy-name);

I appreciate the protocol itself may not currently have this specced out, but with the SSE aspect in the AspNetCore package maybe it's possible?

Given the potential for creating agents, it'd be a shame if limited security hindered adoption.

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 reviewing authorization at the MapMcp level and the SSE ServerTools entry points in the AspNetCore package. Determine whether per-tool RequireAuthorization(policy-name) can be supported by the protocol and server architecture. Done means a decided API design, enforced policy behavior for individual tools, and coverage for authorized and unauthorized requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, authorization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.