modelcontextprotocol / modelcontextprotocol/csharp-sdk
Request for Sample: ASP.NET Core MCP Client with One Persisted Connection Per User Session
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.5k
- Forks
- 814
- Avg merge
- 9d 19h
- Merged PRs (30d)
- 4
Description
Request
Please create an official sample demonstrating how to implement an ASP.NET Core Web API that acts as an MCP client and maintains a persisted MCP connection per user per session. This sample should address:
- Managing unique MCP connections per user session (not as a server)
- Connection persistence & cleanup strategy
- Handling concurrency and avoiding message interleaving
- Support for critical MCP features (Elicitation, Tasks, Progress streams, etc.) that require a stable client↔server session
Why
Features like Elicitation, Tasks, and Progress in MCP require a long-lived, stable client-to-server session, which isn’t covered in the current samples (existing samples are either server-side or single-user/console apps). A sample showing this pattern will help teams implement full MCP compatibility in scalable web API scenarios.
If my assumption on the need for one connection per user per session is incorrect for these features, please clarify the recommended approach for handling MCP features that require stateful communication.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the repository's existing MCP client and server samples to identify the closest ASP.NET Core or session-handling entry points. Define how a persisted connection is scoped per user session, cleaned up, serialized for concurrency, and supports Elicitation, Tasks, and Progress. Done means an official sample demonstrates these behaviors and clarifies the recommended stateful approach.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100