Fix: Add connect_timeout parameter to get_mcp_tools method #3464
+61
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix: Add connect_timeout parameter to get_mcp_tools method
Summary
Fixes issue #3463 by adding an optional
connect_timeout
parameter to theget_mcp_tools
method in@CrewBase
. This allows users to configure connection timeouts when connecting to MCP servers, preventing timeout errors that were occurring with the default 30-second limit.Key Changes:
connect_timeout: Optional[int] = 30
parameter toget_mcp_tools()
methodOptional
to typing imports increw_base.py
connect_timeout
toMCPServerAdapter
constructorReview & Testing Checklist for Human
MCPServerAdapter(server_params, connect_timeout=timeout)
is the correct constructor signature (my tests use mocks so this wasn't verified locally)connect_timeout
only applies during first initialization. Verify this behavior is intuitive to usersget_mcp_tools()
without timeout parameter continues working unchangedRecommended Test Plan:
crew.get_mcp_tools()
without timeout parameter (should use 30s default)crew.get_mcp_tools(connect_timeout=60)
with custom timeoutNotes