mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #23217] [CLOSED] feat(mcp): add configurable timeout for streamable http client #65946
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/23217
Author: @dkhachyan
Created: 3/30/2026
Status: ❌ Closed
Base:
dev← Head:tool-timeout📝 Commits (10+)
fe6783cMerge pull request #19030 from open-webui/devfc05e0aMerge pull request #19405 from open-webui/deve3faec6Merge pull request #19416 from open-webui/dev9899293Merge pull request #19448 from open-webui/dev140605eMerge pull request #19462 from open-webui/dev6f1486fMerge pull request #19466 from open-webui/devd95f533Merge pull request #19729 from open-webui/deva7271530.6.43 (#20093)6adde20Merge pull request #20394 from open-webui/devf9b0534Merge pull request #20522 from open-webui/dev📊 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.