I’ve been trying to get both AgentSDK and the ChatGPT UI to connect to my own StreamableHTTP MCP server and run a long-running tool (let’s call this MandatoryTool) that takes more than five minutes.
Behavior in Agent SDK
I found that the timeout field in MCPServerStreamableHttp successfully extends the timeout—as long as the value is under five (?) minutes.
If MandatoryTool takes about 10 minutes and I set the timeout to something like 1 minute, I get the following timeout error, which makes sense.
{“name”:“tool_output”,“item”:{“type”:“tool_call_output_item”,“rawItem”:{“type”:“function_call_result”,“name”:“MandatoryTool”,“callId”:“call_jM2RMukc1zPcwpPWKu4i03Ss”,“status”:“completed”,“output”:{“type”:“text”,“text”:“An error occurred while running the tool. Please try again. Error: McpError: MCP error -32001: Request timed out”}},“agent”:{“name”:“GitMCP Assistant”},“output”:“An error occurred while running the tool. Please try again. Error: McpError: MCP error -32001: Request timed out”},“type”:“run_item_stream_event”}
However, if I set the timeout field to something longer (say 20 minutes), I still get the error below, which seems to occur five minutes after the MCP tool call.
{“name”:“tool_output”,“item”:{“type”:“tool_call_output_item”,“rawItem”:{“type”:“function_call_result”,“name”:“MandatoryTool”,“callId”:“call_wPTzf6UJeechStNpaKqHI4Sj”,“status”:“completed”,“output”:{“type”:“text”,“text”:“An error occurred while running the tool. Please try again. Error: TypeError: fetch failed”}},“agent”:{“name”:“GitMCP Assistant”},“output”:“An error occurred while running the tool. Please try again. Error: TypeError: fetch failed”},“type”:“run_item_stream_event”}
Behavior in ChatGPT UI
In the UI, I get the below error (according to the LLM) after 5 minutes.
( I assume this is not configurable? )
ConnectorClientServerError: 500: “Server returned 500: ‘Request timeout’”
Question
Is this five-minute error a known limitation, or is it a bug?
In some applications, it makes sense to design MCP tools in a more batch-like fashion—for example, generating a task ID and letting the backend monitor progress. But in chat-based interfaces (such as the ChatGPT UI), that pattern doesn’t work well, because it forces the user to repeatedly ask the LLM something like “Is your work done yet?”
I understand that OpenAI generally discourages long-running blocking operations, but this behavior places significant limits on the usability of MCP tools for cases where longer operations are unavoidable.
(Or maybe I’m simply doing something wrong!)