modelcontextprotocol / modelcontextprotocol/csharp-sdk

notifications/tools/list_changed handler apparently times out over Streamable HTTP

Open
#1,239 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted P3 ready for work
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

  1. Set up an ASP.NET MCP Server as shown in the samples.
  2. Have the server send sporadic notifications/tools/list_changed to all connected clients.
  3. Connect an MCP Client via Streamable HTTP as shown in the samples.
  4. 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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.