mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #20139] [CLOSED] feat(mcp-http): forward extra_params (meta) #41110
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/20139
Author: @FACyber-ops
Created: 12/23/2025
Status: ❌ Closed
Base:
dev← Head:feature/mcp-meta-info📝 Commits (7)
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/devb25bf1efeat(mcp-http): forward extra_params (meta)📊 Changes
3 files changed (+49 additions, -4 deletions)
View changed files
📝
backend/open_webui/utils/mcp/client.py(+4 -2)📝
backend/open_webui/utils/middleware.py(+21 -1)📝
src/lib/components/AddToolServerModal.svelte(+24 -1)📄 Description
Pull Request Checklist
devbranch.feat:prefix.Description
This PR adds an opt-in setting ("Enable Meta info") that forwards additional Open WebUI context to Streamable HTTP MCP requests so MCP servers can process richer information.
When enabled, the MCP request includes additional context fields such as:
__user____files____metadata____oauth_token__When disabled, behavior remains unchanged (no extra meta/context is forwarded).
Related discussion: https://github.com/open-webui/open-webui/discussions/19747
Motivation / Context
Streamable HTTP MCP setups currently lack access to certain Open WebUI context (e.g. files/user info), limiting what MCP servers can do with requests. This toggle makes context forwarding explicit and user-controlled.
How to test
Configure a Streamable HTTP MCP server/tool endpoint.-

In Open WebUI settings, enable "Enable Meta information".

Send a request that includes an attached file and/or requires user context.
Verify on the MCP server side that it receives the additional context (
__files__,__user__,__metadata__,__oauth_token__).Disable "Enable Meta info" again and verify the additional context is no longer sent.
Changelog Entry
Description
Added
__user__,__files__,__metadata__, and__oauth_token__to MCP.Fixed
Security
__oauth_token__is potentially sensitive and is only forwarded when the user enables "Enable Meta info".Additional Information
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.