diff --git a/tests/tools/test_mcp_tool.py b/tests/tools/test_mcp_tool.py index e9654ec74f5..c299e506d1a 100644 --- a/tests/tools/test_mcp_tool.py +++ b/tests/tools/test_mcp_tool.py @@ -1884,7 +1884,7 @@ class TestConfigurableTimeouts: server = MCPServerTask("test_srv") assert server.tool_timeout == _DEFAULT_TOOL_TIMEOUT - assert server.tool_timeout == 120 + assert server.tool_timeout == 300 def test_custom_timeout(self): """Server with timeout=180 in config gets 180.""" diff --git a/tools/mcp_tool.py b/tools/mcp_tool.py index 8b9200db9e4..db419196a47 100644 --- a/tools/mcp_tool.py +++ b/tools/mcp_tool.py @@ -17,7 +17,7 @@ Example config:: command: "npx" args: ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"] env: {} - timeout: 120 # per-tool-call timeout in seconds (default: 120) + timeout: 120 # per-tool-call timeout in seconds (default: 300) connect_timeout: 60 # initial connection timeout (default: 60) github: command: "npx" @@ -258,7 +258,7 @@ if _MCP_AVAILABLE and not _MCP_MESSAGE_HANDLER_SUPPORTED: # Constants # --------------------------------------------------------------------------- -_DEFAULT_TOOL_TIMEOUT = 120 # seconds for tool calls +_DEFAULT_TOOL_TIMEOUT = 300 # seconds for tool calls _DEFAULT_CONNECT_TIMEOUT = 60 # seconds for initial connection per server _MAX_RECONNECT_RETRIES = 5 _MAX_INITIAL_CONNECT_RETRIES = 3 # retries for the very first connection attempt diff --git a/website/docs/reference/mcp-config-reference.md b/website/docs/reference/mcp-config-reference.md index 44d0d4512a9..e7a35a5878b 100644 --- a/website/docs/reference/mcp-config-reference.md +++ b/website/docs/reference/mcp-config-reference.md @@ -54,8 +54,8 @@ mcp_servers: | `client_cert` | string or list | HTTP | mTLS client certificate. String = path to a PEM file containing cert + key. List `[cert, key]` = separate files. List `[cert, key, password]` = encrypted key | | `client_key` | string | HTTP | Path to the client private key, when `client_cert` is a string and the key is in a separate file | | `enabled` | bool | both | Skip the server entirely when false | -| `timeout` | number | both | Tool call timeout | -| `connect_timeout` | number | both | Initial connection timeout | +| `timeout` | number | both | Tool call timeout in seconds (default: `300`) | +| `connect_timeout` | number | both | Initial connection timeout in seconds (default: `60`) | | `supports_parallel_tool_calls` | bool | both | Allow tools from this server to run concurrently | | `tools` | mapping | both | Filtering and utility-tool policy | | `auth` | string | HTTP | Authentication method. Set to `oauth` to enable OAuth 2.1 with PKCE |