mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 23:21:44 -05:00
[PR #24822] fix: interpolate template vars in MCP connection headers #115181
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/24822
Author: @JawafdehiBot
Created: 5/17/2026
Status: 🔄 Open
Base:
dev← Head:upstream/mcp-header-interpolation-v2📝 Commits (1)
829d294fix: interpolate template vars in MCP connection headers📊 Changes
1 file changed (+3 additions, -3 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+3 -3)📄 Description
Pull Request Checklist
devbranch. PRs targetingmainwill be immediately closed.devto ensure no unrelated commits (e.g. frommain) are included. Push updates to the existing PR branch instead of closing and reopening.Changelog Entry
Description
OpenWebUI middleware.py applies MCP connection custom headers directly without calling
get_custom_headers(), so template variables like{{USER_ID}}and{{USER_NAME}}are sent literally to MCP servers.Fixed
{{USER_ID}},{{USER_NAME}},{{CHAT_ID}},{{MESSAGE_ID}}) viaget_custom_headers()Additional Information
tools.pyfor OpenAPI tool serversContributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.