mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[GH-ISSUE #20847] issue: MCP OAuth2.1 initial auth doesn't work when a tool is enabled by default for a model #57976
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 @Lemmons on GitHub (Jan 21, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20847
Check Existing Issues
Installation Method
Other
Open WebUI Version
v0.7.2
Ollama Version (if applicable)
No response
Operating System
EKS (Amazon Linux)
Browser (if applicable)
Chrome 143.0
Confirmation
README.md.Expected Behavior
If a user is not authenticated for a tool which is enabled by default for a given model, when the agent first attempts to use the tool, it will properly go through the OAuth2.1 workflow, prompting the user for auth and permissions, etc, in the same way it currently does when a user manually enables a tool for a given chat.
Actual Behavior
If a user is not authenticated for a tool which is enabled by default for a given model, when the agent first attempts to use the tool, the tool use fails with the message "Failed to connect to MCP server '{server-name}'". The mcp server is properly responding with a 401 and www-authenticate header, as specified by OAuth2.1, but OpenWebUI is failing to respond to that correctly by taking the user through the authentication process.
From what I can tell this only affects first time login. It appears that token refresh is working properly.
Steps to Reproduce
Logs & Screenshots
Additional Information
No response
@owui-terminator[bot] commented on GitHub (Jan 21, 2026):
🔍 Similar Issues Found
I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:
#20828 issue: OAuth2.1 MCP Tool Server Verification Error - Failed to connect to the tool server: 'coroutine' object is not iterable
by Lemmons • Jan 20, 2026 •
bug#20808 issue: mcp oauth 2.1 callback always ends in 401 not authenticated
by bk-lg • Jan 20, 2026 •
bug#19823 Issue: MCP with OAuth 2.1 Authorization/Token retrival is broken in v0.6.41
by mllab-nl • Dec 08, 2025 •
bug#19116 issue: MCP OAuth 2.1 client registration fails when policy_uri, client_uri, logo_uri or tos_uri are not set
by xqqp • Nov 11, 2025 •
bug#18010 issue: MCP OAuth 2.1 flow doesn't match standard (missing code_challenge and resource_url)
by hsuyuming • Oct 02, 2025 •
bugShow 3 more related issues
#19148 issue: Verify OAuth mcp server sends incorrect authorization header
by Oleg52 • Nov 12, 2025 •
bug#20291 issue: MCP Atlassian OAuth token refresh fails with "Constructor parameter should be str" in v0.6.43
by rolandscho • Dec 31, 2025 •
bug#20629 issue: MCP server response fails
by thrasher • Jan 12, 2026 •
bug💡 Tips:
This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
@tjbck commented on GitHub (Jan 21, 2026):
Thanks for flagging this issue. We may revisit this approach but for if the mcp server is using oauth2.1, it should NOT be set as a default tool. In our dev branch we've made it so that you're not able to set them as default tool. Also, open to discussion here!