Timed out while waiting for response to ClientRequest. Waited 0:00:05 seconds

where i can adjust the timeout in MCP server, could find any reference except

however im using the following approach

assistant_agent = Agent(
name=“MCP Assistant”,
model=“gpt-4.1”,
model_settings=ModelSettings(
temperature=0.5, top_p=0.5, metadata={“source”:“mcp-assistant”}),
instructions=tool_instructions,
mcp_servers=mcp_servers
)

with trace(workflow_name=“Conversation”, group_id=uuid.uuid4().hex, disabled=True):
stream = Runner.run_streamed(
assistant_agent,
input_text,
max_turns=20,
previous_response_id=prev_id,
)

You Should do that in the initialisation of your MCP Server. Example:

from agents.mcp import MCPServerStdio

def order_server():
return MCPServerStdio(
name=“Name”,
client_session_timeout_seconds=30,
params={
“command”: “/opt/homebrew/bin/uv”,
“args”: [
“–directory”,
“/Users/XXXXXX/Desktop/XXX”,
“run”,
“XXXXX.py”
]
},
)