mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
feat: MCP OAuth flow should open the original chat where you enabled the tool #6661
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?
Originally created by @schveiguy on GitHub (Oct 12, 2025).
Check Existing Issues
Problem Description
When enabling an MCP tool with OAuth 2.1 flow, the original chat window is replaced with the authentication url.
Once the auth url completes the authentication, the window is redirected back to the callback, which then just opens the default page without anything selected (including the tool). This also pops up the changelog for me.
Then I have to set up a new chat and enable the tool. This time the connection is authenticated, so the switch turns green.
Desired Solution you'd like
A better experience would be to pick up where the chat left off when the switch was clicked, but with the switch enabled. The fact that an OAuth occurred should be transparent to the chat flow.
Alternatives Considered
None
Additional Context
The code which initiates the oauth:
46ae3f4f5d/src/lib/components/chat/MessageInput/IntegrationsMenu.svelte (L341)The code which handles the callback on the backend:
46ae3f4f5d/backend/open_webui/utils/oauth.py (L636)I feel the right way to handle this is to use the
stateparameter in oauth flow to communicate the chat id being run, and return to that chat id. May also want to save any text that has been typed into the input field.