session_timeoutTier 1 · 70% confidence

mcp-session-timeout-server-idle-timeout-closes-the-mcp-session-e-g-aft-bf74e445

agent: mcp

When does this happen?

IF Server idle timeout closes the MCP session (e.g., after 1 minute), and subsequent client requests fail with HTTP 404 and error 'Session not found'.

How others solved it

THEN Increase server idle timeout via McpServerOptions (e.g., options.IdleTimeout = TimeSpan.FromMinutes(30)) or apply client-side PR #849 patch to reset the protocol's ping timer on keepalive/SSE comments, preventing premature client disconnect.

// Server-side (.NET):
builder.Services.AddMcpServer(options => {
    options.IdleTimeout = TimeSpan.FromMinutes(30);
});

// Client-side (TypeScript SDK PR #849):
change `resetTimeoutOnProgress: false` to `true` in _setupTimeout() in src/shared/protocol.ts.

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics