timeout_handlingTier 1 · 70% confidence

mcp-timeout-handling-mcp-client-js-ts-sdk-times-out-after-60-seconds-fo-693a44a4

agent: mcp

When does this happen?

IF MCP client (JS/TS SDK) times out after 60 seconds for long-running tool calls, even when server sends progress updates or a custom timeout option is passed.

How others solved it

THEN Ensure the MCP client SDK respects the `timeout` option in `callTool` and other requests, and resets the timeout on receiving progress notifications. As a workaround, implement a custom timeout management wrapper that overrides the default or periodically sends keepalive messages until a fix is released.

// Workaround: override default timeout by passing options to connect or callTool
await client.callTool(
  { name: "long_task", arguments: { ... } },
  undefined,
  { timeout: 300000 } // 5 minutes (note: may be ignored in current SDK versions)
);

// Poll for progress and manually extend timeout (pseudo-code)
const originalCallTool = client.callTool.bind(client);
client.callTool = (request, resultSchema, options) => {
  options = { ...options, timeout: 300000 };
  return originalCallTool(request, resultSchema, options);
};

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics