[GH-ISSUE #24216] issue: MCP OAuth 2.1 (Static) fails with Google Gmail MCP server – discovery document not found when OAuth server differs from MCP server #107224

Closed
opened 2026-05-18 05:55:23 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @samuixx on GitHub (Apr 29, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24216

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

v0.9.2

Ollama Version (if applicable)

0.22.0

Operating System

Debian Trixie

Browser (if applicable)

Chrome

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

Open WebUI should support specifying a separate OAuth authorization server URL (e.g., https://accounts.google.com) independently from the MCP server URL. This is required for providers like Google where the MCP endpoint and OAuth endpoint are on different hosts.

Google's discovery document is available at: https://accounts.google.com/.well-known/openid-configuration

Suggested solution

Add an optional field (e.g., "OAuth Server URL" or "Authorization Server URL") in the External Tools OAuth 2.1 (Static) configuration that allows specifying the OAuth discovery endpoint separately from the MCP server URL. When not set, fall back to the current behavior of using the MCP server host.

This pattern is common with Google Workspace MCP servers (Gmail, Calendar, Drive, People API) which all use accounts.google.com for OAuth but have separate MCP endpoints.

Actual Behavior

When connecting to Google's official Gmail MCP server (https://gmailmcp.googleapis.com/mcp/v1) using OAuth 2.1 (Static), Open WebUI fails to complete the OAuth flow because it searches for the OAuth discovery document on the MCP server host itself.
Google separates the MCP server (gmailmcp.googleapis.com) from the OAuth authorization server (accounts.google.com). Open WebUI only has a single URL field and assumes both are the same host.

Steps to Reproduce

  1. Go to Admin Settings → Integration → Add Server
  2. Set Type: MCP (Streamable HTTP)
  3. Set URL: https://gmailmcp.googleapis.com/mcp/v1
  4. Set Auth: OAuth 2.1 (Static)
  5. Enter Client ID and Client Secret (from a Google Cloud Web Application OAuth client)
  6. Click "Register Client" → successfull
  7. Click "Connection test" → fails with discovery document error

Logs & Screenshots

Browser Log:
Failed to fetch OAuth 2.1 discovery document from [
'https://gmailmcp.googleapis.com/.well-known/oauth-authorization-server/mcp/v1',
'https://gmailmcp.googleapis.com/.well-known/openid-configuration/mcp/v1',
'https://gmailmcp.googleapis.com/mcp/v1/.well-known/openid-configuration',
'https://gmailmcp.googleapis.com/.well-known/oauth-authorization-server',
'https://gmailmcp.googleapis.com/.well-known/openid-configuration'
]

Additional Information

No response

Originally created by @samuixx on GitHub (Apr 29, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/24216 ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!). - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version v0.9.2 ### Ollama Version (if applicable) 0.22.0 ### Operating System Debian Trixie ### Browser (if applicable) Chrome ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior Open WebUI should support specifying a separate OAuth authorization server URL (e.g., https://accounts.google.com) independently from the MCP server URL. This is required for providers like Google where the MCP endpoint and OAuth endpoint are on different hosts. Google's discovery document is available at: https://accounts.google.com/.well-known/openid-configuration Suggested solution Add an optional field (e.g., "OAuth Server URL" or "Authorization Server URL") in the External Tools OAuth 2.1 (Static) configuration that allows specifying the OAuth discovery endpoint separately from the MCP server URL. When not set, fall back to the current behavior of using the MCP server host. This pattern is common with Google Workspace MCP servers (Gmail, Calendar, Drive, People API) which all use accounts.google.com for OAuth but have separate MCP endpoints. ### Actual Behavior When connecting to Google's official Gmail MCP server (https://gmailmcp.googleapis.com/mcp/v1) using OAuth 2.1 (Static), Open WebUI fails to complete the OAuth flow because it searches for the OAuth discovery document on the MCP server host itself. Google separates the MCP server (gmailmcp.googleapis.com) from the OAuth authorization server (accounts.google.com). Open WebUI only has a single URL field and assumes both are the same host. ### Steps to Reproduce 1. Go to Admin Settings → Integration → Add Server 2. Set Type: MCP (Streamable HTTP) 3. Set URL: https://gmailmcp.googleapis.com/mcp/v1 4. Set Auth: OAuth 2.1 (Static) 5. Enter Client ID and Client Secret (from a Google Cloud Web Application OAuth client) 6. Click "Register Client" → successfull 7. Click "Connection test" → fails with discovery document error ### Logs & Screenshots Browser Log: Failed to fetch OAuth 2.1 discovery document from [ 'https://gmailmcp.googleapis.com/.well-known/oauth-authorization-server/mcp/v1', 'https://gmailmcp.googleapis.com/.well-known/openid-configuration/mcp/v1', 'https://gmailmcp.googleapis.com/mcp/v1/.well-known/openid-configuration', 'https://gmailmcp.googleapis.com/.well-known/oauth-authorization-server', 'https://gmailmcp.googleapis.com/.well-known/openid-configuration' ] ### Additional Information _No response_
GiteaMirror added the bug label 2026-05-18 05:55:23 -05:00
Author
Owner

@tjbck commented on GitHub (May 8, 2026):

Addressed in dev.

<!-- gh-comment-id:4409933128 --> @tjbck commented on GitHub (May 8, 2026): Addressed in dev.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#107224