modelcontextprotocol / modelcontextprotocol/csharp-sdk
Custom filters
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.5k
- Forks
- 814
- Avg merge
- 9d 19h
- Merged PRs (30d)
- 4
Description
Is your feature request related to a problem? Please describe.
Cancellation token is throwing error which can be handled graceful way like described here
https://andrewlock.net/using-cancellationtokens-in-asp-net-core-mvc-controllers/
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc(options =>
{
options.Filters.Add<OperationCancelledExceptionFilter>();
});
}
}
Describe the solution you'd like
It would be nice to add custom filter
builder.Services.AddMcpServer(options =>
{
options.Filters.Add<OperationCancelledExceptionFilter>();
})
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
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 AddMcpServer options entry point and how cancellation exceptions are currently handled in the server pipeline. Define how a custom OperationCancelledExceptionFilter can be registered there and verify that cancellation is handled gracefully without producing the current error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100