Add global and HTTP context server timeout settings#45378
Merged
probably-neb merged 8 commits intomainfrom Jan 5, 2026
Merged
Conversation
- Add global context_server_timeout setting (default 60000ms) - Add per-server timeout field to HTTP context server configuration - Implement timeout precedence: per-server > global > 60s default - Both Stdio and HTTP servers now support timeout configuration - Update ContextServer to pass timeout to HTTP transport - Document timeout settings with examples in default.json
- Fix URL construction in tests (use url::Url::parse instead of .into()) - Fix test assertions to properly call create_context_server - Add test_context_server_global_timeout: verifies global timeout setting - Add test_context_server_per_server_timeout_override: verifies per-server override - Add test_context_server_stdio_timeout: verifies stdio server timeout handling - All three tests now passing successfully
- Replace .unwrap() with .expect() for set_user_settings calls - Replace .unwrap() with .expect() for URL parsing in test setup - Provides descriptive panic messages if test setup fails - Follows Zed test patterns seen in project_tests.rs - All tests still passing
Contributor
rtfeldman
pushed a commit
that referenced
this pull request
Jan 5, 2026
### Closes - Maybe #38252 (there might be something going on with NPX too) - Also addresses #39021 (comment) ### Why Some more involved MCP servers timeout often, especially on first setup. I got tired of having to set timeouts manually per server. I also noticed a timeout could not be set for http context servers, which causes Context7 or GitHub's remote servers to timeout at 60s sometimes. ### Overview MCP Timeout Configuration Feature This PR adds additional configurable timeout settings for Model Context Protocol servers including a global timeout and the addition of timeouts for http servers, addressing issues where servers were timing out after a fixed 60 seconds regardless of user needs. **Key Features:** - **Global timeout setting** (`context_server_timeout`) - default timeout for all MCP servers (default: 60s, max: 10min) - **Per-server timeout overrides** - individual servers can specify custom timeouts via `timeout` field - **Precedence hierarchy** - per-server timeout > global timeout > default (60s) - **Automatic bounds checking** - enforces 10-minute maximum to prevent resource exhaustion - **Support for both transports** - works with stdio and HTTP-based context servers - **Comprehensive test coverage** - 3 new tests validating global, override, and stdio timeout behavior - **Full backward compatibility** - existing configurations work unchanged with sensible defaults ### Release Notes: - Added the ability to configure timeouts for context server tool calls. The new global `context_server_timeout` setting controls the default timeout (default is 60s, max: 10min). Additionally, per-server timeouts can be configured using the `timeout` field within servers defined in the `"context_servers" setting --------- Co-authored-by: Ben Kunkle <ben@zed.dev>
LivioGama
pushed a commit
to LivioGama/zed
that referenced
this pull request
Jan 20, 2026
…5378) ### Closes - Maybe zed-industries#38252 (there might be something going on with NPX too) - Also addresses zed-industries#39021 (comment) ### Why Some more involved MCP servers timeout often, especially on first setup. I got tired of having to set timeouts manually per server. I also noticed a timeout could not be set for http context servers, which causes Context7 or GitHub's remote servers to timeout at 60s sometimes. ### Overview MCP Timeout Configuration Feature This PR adds additional configurable timeout settings for Model Context Protocol servers including a global timeout and the addition of timeouts for http servers, addressing issues where servers were timing out after a fixed 60 seconds regardless of user needs. **Key Features:** - **Global timeout setting** (`context_server_timeout`) - default timeout for all MCP servers (default: 60s, max: 10min) - **Per-server timeout overrides** - individual servers can specify custom timeouts via `timeout` field - **Precedence hierarchy** - per-server timeout > global timeout > default (60s) - **Automatic bounds checking** - enforces 10-minute maximum to prevent resource exhaustion - **Support for both transports** - works with stdio and HTTP-based context servers - **Comprehensive test coverage** - 3 new tests validating global, override, and stdio timeout behavior - **Full backward compatibility** - existing configurations work unchanged with sensible defaults ### Release Notes: - Added the ability to configure timeouts for context server tool calls. The new global `context_server_timeout` setting controls the default timeout (default is 60s, max: 10min). Additionally, per-server timeouts can be configured using the `timeout` field within servers defined in the `"context_servers" setting --------- Co-authored-by: Ben Kunkle <ben@zed.dev>
LivioGama
pushed a commit
to LivioGama/zed
that referenced
this pull request
Jan 20, 2026
…5378) ### Closes - Maybe zed-industries#38252 (there might be something going on with NPX too) - Also addresses zed-industries#39021 (comment) ### Why Some more involved MCP servers timeout often, especially on first setup. I got tired of having to set timeouts manually per server. I also noticed a timeout could not be set for http context servers, which causes Context7 or GitHub's remote servers to timeout at 60s sometimes. ### Overview MCP Timeout Configuration Feature This PR adds additional configurable timeout settings for Model Context Protocol servers including a global timeout and the addition of timeouts for http servers, addressing issues where servers were timing out after a fixed 60 seconds regardless of user needs. **Key Features:** - **Global timeout setting** (`context_server_timeout`) - default timeout for all MCP servers (default: 60s, max: 10min) - **Per-server timeout overrides** - individual servers can specify custom timeouts via `timeout` field - **Precedence hierarchy** - per-server timeout > global timeout > default (60s) - **Automatic bounds checking** - enforces 10-minute maximum to prevent resource exhaustion - **Support for both transports** - works with stdio and HTTP-based context servers - **Comprehensive test coverage** - 3 new tests validating global, override, and stdio timeout behavior - **Full backward compatibility** - existing configurations work unchanged with sensible defaults ### Release Notes: - Added the ability to configure timeouts for context server tool calls. The new global `context_server_timeout` setting controls the default timeout (default is 60s, max: 10min). Additionally, per-server timeouts can be configured using the `timeout` field within servers defined in the `"context_servers" setting --------- Co-authored-by: Ben Kunkle <ben@zed.dev>
LivioGama
pushed a commit
to LivioGama/zed
that referenced
this pull request
Feb 15, 2026
…5378) ### Closes - Maybe zed-industries#38252 (there might be something going on with NPX too) - Also addresses zed-industries#39021 (comment) ### Why Some more involved MCP servers timeout often, especially on first setup. I got tired of having to set timeouts manually per server. I also noticed a timeout could not be set for http context servers, which causes Context7 or GitHub's remote servers to timeout at 60s sometimes. ### Overview MCP Timeout Configuration Feature This PR adds additional configurable timeout settings for Model Context Protocol servers including a global timeout and the addition of timeouts for http servers, addressing issues where servers were timing out after a fixed 60 seconds regardless of user needs. **Key Features:** - **Global timeout setting** (`context_server_timeout`) - default timeout for all MCP servers (default: 60s, max: 10min) - **Per-server timeout overrides** - individual servers can specify custom timeouts via `timeout` field - **Precedence hierarchy** - per-server timeout > global timeout > default (60s) - **Automatic bounds checking** - enforces 10-minute maximum to prevent resource exhaustion - **Support for both transports** - works with stdio and HTTP-based context servers - **Comprehensive test coverage** - 3 new tests validating global, override, and stdio timeout behavior - **Full backward compatibility** - existing configurations work unchanged with sensible defaults ### Release Notes: - Added the ability to configure timeouts for context server tool calls. The new global `context_server_timeout` setting controls the default timeout (default is 60s, max: 10min). Additionally, per-server timeouts can be configured using the `timeout` field within servers defined in the `"context_servers" setting --------- Co-authored-by: Ben Kunkle <ben@zed.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes
Why
Some more involved MCP servers timeout often, especially on first setup. I got tired of having to set timeouts manually per server. I also noticed a timeout could not be set for http context servers, which causes Context7 or GitHub's remote servers to timeout at 60s sometimes.
Overview
MCP Timeout Configuration Feature
This PR adds additional configurable timeout settings for Model Context Protocol servers including a global timeout and the addition of timeouts for http servers, addressing issues where servers were timing out after a fixed 60 seconds regardless of user needs.
Key Features:
context_server_timeout) - default timeout for all MCP servers (default: 60s, max: 10min)timeoutfieldRelease Notes:
context_server_timeoutsetting controls the default timeout (default is 60s, max: 10min). Additionally, per-server timeouts can be configured using thetimeoutfield within servers defined in the `"context_servers" setting