-
Notifications
You must be signed in to change notification settings - Fork 615
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.