mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #23222] [CLOSED] feat(mcp): add configurable timeout for streamable http client #50139
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/23222
Author: @dkhachyan
Created: 3/30/2026
Status: ❌ Closed
Base:
dev← Head:tool-timeout-dev📝 Commits (1)
6072ca4feat(mcp): add configurable timeout for streamable http client📊 Changes
2 files changed (+20 additions, -3 deletions)
View changed files
📝
backend/open_webui/env.py(+11 -0)📝
backend/open_webui/utils/mcp/client.py(+9 -3)📄 Description
Pull Request Description
Title
feat: Make timeout for streamablehttp_client configurable via env var
Description
This PR adds a new environment variable
MCP_STREAMABLE_HTTP_CLIENT_TIMEOUTthat allows users to configure the HTTP client timeout for the MCP streamable HTTP client. Previously, the timeout was not configurable, This enables users to adjust the timeout based on their network conditions and MCP server response times.Changed
MCP_STREAMABLE_HTTP_CLIENT_TIMEOUTenvironment variable inbackend/open_webui/env.pycreate_insecure_httpx_client()inbackend/open_webui/utils/mcp/client.pyto use the environment variable as the default timeout when no explicit timeout is providedUsage
Set the environment variable to configure the HTTP client timeout (in seconds):
If not set, the timeout defaults to
None(httpx will use its default timeout behavior).Files Modified
backend/open_webui/env.py- Added new environment variable parsingbackend/open_webui/utils/mcp/client.py- Updated to use configurable timeoutAdditional Information
Nonewhich preserves existing behavior🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.