Skip to content

Conversation

@tennisleng
Copy link

Summary

Fixes #20272

The user-specified timeout parameter was not being propagated to the underlying transport clients (sse_client and streamablehttp_client), causing them to use their default timeouts (5s and 30s respectively) instead of the user's configured value.

Changes

  • Add sse_read_timeout parameter to BasicMCPClient.__init__() and with_oauth() with a default of 300 seconds (5 minutes)
  • Pass timeout and sse_read_timeout to sse_client() in _run_session()
  • Pass timeout and sse_read_timeout to streamablehttp_client() in _run_session()
  • Update docstrings to document the new parameter

Testing

Tested manually by:

  1. Creating a mock MCP server with a slow tool (40-second sleep)
  2. Calling the tool with timeout=60 - successfully completes
  3. Previously this would fail at 30s due to the default timeout in streamablehttp_client

Fixes run-llama#20272

The user-specified timeout parameter was not being passed to the
underlying transport clients (sse_client and streamablehttp_client),
causing them to use their default timeouts instead.

Changes:
- Add sse_read_timeout parameter to BasicMCPClient.__init__() and with_oauth()
- Pass timeout and sse_read_timeout to sse_client() in _run_session()
- Pass timeout and sse_read_timeout to streamablehttp_client() in _run_session()
- Update docstrings to document the new parameter
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Question]: Timeout not working for workflow & MCP-usage

1 participant