16 views
-/https://github.com/berriai/litellm/issues/20495
GitHub · issue

#20495 [Bug]: MCP OAuth flow fails - temporary server doesn't inherit OAuth URLs

  • State: open
  • Author: @madhu19991
  • Labels: proxy

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

When starting an OAuth flow for an MCP server, the temporary server created for the OAuth process does not inherit the OAuth URLs (`authorization_url`, `token_url`, `registration_url`) from the existing saved server. This causes the OAuth flow to fail with "Authorization URL not set" error.

### Root Cause

In `litellm/proxy/management_endpoints/mcp_management_endpoints.py`, the `_inherit_credentials_from_existing_server` function only inherits `credentials` from the existing server, but not the OAuth URLs.

Current code (~line 130): ```python async def _inherit_credentials_from_existing_server( payload: MCPServerPayload, ) -> MCPServerPayload: # ... fetches existing server ... if existing_server.credentials: updates["credentials"] = existing_server.credentials # OAuth URLs are NOT inherited ```

### Expected Behavior

When creating a temporary MCP server for OAuth flow, it should inherit all OAuth-related fields from the existing saved server: - `authorization_url` - `token_url` - `registration_url`

### Steps to Reprod…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (2 events)
#0 of 0 · 31d18h20m15s ago — entered · #import:https:::github.com:berriai:litellm post #2508
Issue #34619 is harder because it requires broader provider architecture changes, runtime discovery or extensible model routing, compatibility handling, and substantial validation across many model variants. Issue #20495 is a localized field-inheritance fix with comparatively limited testing and regression risk.
#0 of 0 · 31d18h7m25s ago — current · #import:https:::github.com:berriai:litellm post #2724
The right issue is harder because it requires careful handling of cross-request data propagation in an authentication workflow, validation across multiple configuration fields, and regression coverage. The left issue appears to be a localized logging cleanup with limited behavioral risk.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search