fix: Add timeout configuration for MCP servers#741
Closed
ashwin-ranade wants to merge 12 commits intomainfrom
Closed
fix: Add timeout configuration for MCP servers#741ashwin-ranade wants to merge 12 commits intomainfrom
ashwin-ranade wants to merge 12 commits intomainfrom
Conversation
bbb5a58 to
841b6c1
Compare
Add configurable Istio VirtualService timeout for MCP servers to prevent 30-second default timeout errors on long-running operations. - MCP servers (passthrough forwarder with /mcp routes): 5-minute timeout - All other endpoints: explicit 30-second timeout (Istio default) Always sets an explicit timeout value to avoid YAML formatting issues.
14d78b5 to
fba49a5
Compare
Add request_timeout_seconds field to RunnableImageLike flavor to allow configurable Istio VirtualService timeout per endpoint. - Add request_timeout_seconds: Optional[int] field to RunnableImageLike - Add database column and migration - Update VirtualService logic to use configurable timeout instead of MCP detection heuristic - Defaults to 30s (Istio default) when not specified This allows any endpoint (not just MCP servers) to configure a custom timeout by setting request_timeout_seconds in their flavor config.
- Restore MCP server detection logic (passthrough forwarder + /mcp routes) - MCP servers: use request_timeout_seconds if set, otherwise 30s - Non-MCP servers: do nothing (empty string, use Istio default)
…ence request_timeout_seconds is a runtime configuration field that doesn't need to be persisted in the database. It can be set via API when creating/updating bundles but won't be stored in DB columns.
- Add MCP_TIMEOUT_SECONDS env var (defaults to 30s) - Remove request_timeout_seconds from RunnableImageLike model - Remove all database model changes and translation logic - MCP servers use MCP_TIMEOUT_SECONDS env var for timeout - Non-MCP servers use Istio default (no timeout set)
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.
Summary
This PR adds timeout configuration for MCP servers to prevent hanging requests and fix 30-second timeout errors.
Problem
MCP servers often have long-running operations that exceed the default 30-second Istio timeout, causing request failures.
Solution