modelcontextprotocol / modelcontextprotocol/csharp-sdk
notifications/tools/list_changed handler apparently times out over Streamable HTTP
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.5k
- Forks
- 814
- Avg merge
- 9d 19h
- Merged PRs (30d)
- 4
Description
Describe the bug
Registering a handler of the notifications/tools/list_changed method (both via the McpClientOptions.Handlers.NotificationHandlers and via the McpSession.RegisterNotificationHandler(...) method) on a client that is connected to a server over Streamable HTTP works only for ca. 2-3 minutes after creation. If no notification is sent by the server for a longer time, the handler is no longer invoked. The problem does not happen while a debugger is attached.
I have validated that the notifications continue to be received by the MCP Inspector, when it is connected at the same time as my client.
I assume that an HTTP connection is being dropped somewhere along the way, but I haven't found the root cause yet.
Steps To Reproduce
- Set up an ASP.NET MCP Server as shown in the samples.
- Have the server send sporadic notifications/tools/list_changed to all connected clients.
- Connect an MCP Client via Streamable HTTP as shown in the samples.
- Launch both applications without a debugger attached
Expected behavior
Notifications are received for as long as the MCP connection persists, even if they happen rarely.
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 with the Streamable HTTP client setup in the samples and trace notification handling through McpClientOptions.Handlers.NotificationHandlers and McpSession.RegisterNotificationHandler(...). Reproduce the issue without a debugger, waiting more than 2–3 minutes after the last notification, and compare behavior with the MCP Inspector connected. Done means sporadic notifications/tools/list_changed continue to invoke the handler for the lifetime of the MCP connection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100