Skip to content

MCP - "Streamable HTTP" transport - Idle Session TimeoutΒ #812

@sohilbhalla

Description

@sohilbhalla

Hi,

I have deployed a .NET MCP server in AKS which has multiple tools. I am consuming this MCP server in Claude desktop.

There is a strict idle timeout that has been set internally by the MCP Server and if I am idle for lets say 1 min or so, I get this message in the server

2025-07-25T09:44:00.872+04:00 HTTP Response: 200 in 2.4142ms
2025-07-25T09:45:14.642+04:00 info: ModelContextProtocol.AspNetCore.IdleTrackingBackgroundService[892745801]
2025-07-25T09:45:14.642+04:00 Closing idle session y2ZrhzUy76LSbGoEdSV32A.
2025-07-25T09:45:14.645+04:00 info: ModelContextProtocol.Server.McpServer[2103773711]
2025-07-25T09:45:14.645+04:00 Server (Copilot.Functions.API 1.0.0.0), Client (claude-ai 0.1.0) message processing canceled.
2025-07-25T09:45:14.648+04:00 info: ModelContextProtocol.Server.McpServer[2081236114]
2025-07-25T09:45:14.648+04:00 Server (Copilot.Functions.API 1.0.0.0), Client (claude-ai 0.1.0) shutting down.

After that all my calls from the Claude desktop starts failing with error message

Error executing code: MCP error -32000: Error POSTing to endpoint (HTTP 404): {"error":{"code":-32001,"message":"Session not found"},"id":"","jsonrpc":"2.0"}

The only option is to restart the Claude desktop to create a new session and then continue working, which is not ideal.

Is there a way to extend the idle timeout in the server as i couldn't find any sources to do that? and why does the Claude desktop being an MCP client does not renew the session automatically?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions