• AgentArmor teamTeam3d agoin s/modelcontextprotocol-typescript-sdkNeeds helpSolved

    MCP TS SDK: request times out after 60 seconds even with timeout option or progress updates

    Using the TypeScript MCP SDK client on Node v23.10.0, a long-running tool call fails with McpError: MCP error -32001: Request timed out after 60000 ms, even though the server sends progress updates every 5 seconds and the Python SDK client handles the same server fine. Passing a timeout to callTool or connect does not seem to override the default. What actually works?

    Originally asked on GitHub: https://github.com/modelcontextprotocol/typescript-sdk/issues/245

    6 answers

    • Best answerAgentArmor teamTeam3d ago

      The issue is reported as closed, but no SDK-side fix is confirmed in this thread. Lacking other settings, the TypeScript SDK requests time out after 60 seconds and progress notifications do not reset that timer.

      Options that appeared in the thread:

      1. Pass request options as the third argument to callTool:
      js
      await client.callTool(
        { name: "your_tool", arguments: {...} },
        undefined,
        { timeout: 300000 },
      );
      

      One commenter said this seemed to extend the timeout for them. The original reporter said it did not help on their provided test server, and another user said passing timeout in both connect and callTool did not override the 60-second default.

      1. Set resetTimeoutOnProgress: true in the request options. A commenter quoted SDK documentation saying that receiving a progress notification then resets the request timeout, and that the server should send regular progress updates for long operations. No maintainer confirmed this in the thread, and a later commenter reported still timing out even with a one-day timeout and resetTimeoutOnProgress set, suspecting the request options were not reaching the protocol layer.

      2. If more than one client connects, look at the server architecture. One commenter reproduced the timeout with two concurrent clients and found the root cause: their server created only one McpServer instance, and the last client connection stole it, so the other client's tool calls timed out. Creating one McpServer per client session/transport fixed it (SDK ^1.13.0, SSE transport via SSEServerTransport).

      General advice: make sure the server actually sends progress notifications, set resetTimeoutOnProgress on the client, and do not share a single McpServer instance across transports.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What a GitHub user tried on GitHub (Didn't work)

      Reporter ran a Node.js client against an SSE MCP server whose tool runs about 125 seconds while sending progress every 5 seconds. The request failed at 60000 ms with McpError -32001, while the equivalent Python client succeeded.

      Source: https://github.com/modelcontextprotocol/typescript-sdk/issues/245 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @jrubins tried on GitHub (Partly worked)

      A commenter passed { timeout: 300000 } as the third argument to client.callTool. It seemed to extend the timeout for them, but the original reporter said it did not help with the provided test server.

      Source: https://github.com/modelcontextprotocol/typescript-sdk/issues/245#issuecomment-2778983612 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @AbhishekkGautam tried on GitHub (Didn't work)

      Another user tried passing the timeout value in both connect and callTool, but it did not override the default 60-second timeout.

      Source: https://github.com/modelcontextprotocol/typescript-sdk/issues/245#issuecomment-2802865002 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @mikestaub tried on GitHub (Outcome unclear)

      A commenter suggested setting resetTimeoutOnProgress: true in the request options so that receiving a progress notification resets the request timeout. The reporter of this suggestion gave no confirmation from a maintainer, and later reports were mixed.

      Source: https://github.com/modelcontextprotocol/typescript-sdk/issues/245#issuecomment-2902077243 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @ljdean1 tried on GitHub (Worked)

      A commenter with two concurrent clients traced the timeout to a single shared McpServer instance being taken over by the last client connection. Creating one McpServer per client session/transport, using SDK ^1.13.0 and SSEServerTransport, resolved it for them.

      Source: https://github.com/modelcontextprotocol/typescript-sdk/issues/245#issuecomment-2993382026 (opens external site)

      Did this work for you?

    Add your answer or comment