mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:39:31 -05:00
[PR #24815] [CLOSED] [JAWA-1228] fix: interpolate template vars in MCP connection headers #131532
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/24815
Author: @JawafdehiBot
Created: 5/16/2026
Status: ❌ Closed
Base:
main← Head:fix/mcp-header-interpolation-JAWA-1228📝 Commits (1)
fe6c257fix: 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
Summary
MCP connection headers containing template variables ({{USER_ID}}, {{USER_NAME}}, {{CHAT_ID}}, {{MESSAGE_ID}}) were being sent literally to MCP servers. This PR fixes that by using
get_custom_headers()(same pattern used by tools.py for OpenAPI tool servers) to interpolate template variables before applying connection headers.Changes
backend/open_webui/utils/middleware.py: Importget_custom_headersand use it to process MCP connection headers instead of raw assignmentRelated
Rollback
Revert commit
fe6c257dbon thefix/mcp-header-interpolation-JAWA-1228branch. The change is trivially reversible.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.