MCP tool timeout error even though tool calls succeed

This question originally came up in our Slack community and the thread has been consolidated here for long-term reference.

I’m seeing an issue where the agent reports a failure to the user, but the tool calls are actually succeeding.

The logs show McpError: Timed out for my Google Calendar tools, but the calendar events were still created successfully.

I tried setting timeout=30 in MCPServerHTTP, but still get the error.

There are two different timeout parameters:

  • timeout: Controls HTTP-level timeouts (connection, read/write)
  • client_session_timeout_seconds: Controls how long the MCP protocol waits for tool execution responses

For slow operations like Google Calendar API calls, you need both values set high enough:

mcp.MCPServerHTTP(
    mcp_url,
    timeout=30,
    client_session_timeout_seconds=30
)

The default client_session_timeout_seconds is 5 seconds, which may be too short for your needs.