build: v1.89.0-rc.3 MCP cherry-picks + OAuth persist fix (deploy vehicle) - #30335
build: v1.89.0-rc.3 MCP cherry-picks + OAuth persist fix (deploy vehicle)#30335tin-berri wants to merge 7 commits into
Conversation
…the Tools page (#29867) * fix(ui): let non-creator users OAuth into OBO-mode MCP servers from the Tools page * fix(ui): clear OBO Tools-tab one-shot on navigate-back and gate on credential-status errors
…ware GET path (#29960) * fix(ui): load MCP tool configuration tools via the OBO/passthrough-aware GET path * fix(mcp): admin-only include_disabled_tools so the settings UI shows toggled-off tools * fix(ui): repopulate MCP server edit form when server data loads after mount (OAuth return) * fix(ui): persist MCP OAuth token on save and return to the Settings tab after authorize * fix(ui): scope MCP OAuth callback to the initiating form so create and edit flows don't cross-talk * fix(ui): derive OAuth-return Settings tab via lazy state init instead of setState-in-effect * Fix MCP OAuth edit token handling --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
…r server's token no longer leaks into the next add-server session (#30000) * fix(ui/mcp): reset OAuth hook state on modal close so a prior server's token no longer leaks into the next add-server session * fix(ui/mcp): clear in-flight OAuth guard on reset and reset form/tools on modal close so nothing leaks on a parent-driven dismiss
…ess check (#30041) * fix(mcp): honor team access-group grants in OAuth authorize/token access check * test(mcp): mock build_effective_auth_contexts in non-admin authorize tests for isolation
…ver edit The server config is already saved by updateMCPServer when the subsequent per-user token persist throws, so returning early without onSuccess(updated) left the edit form open and the parent list stale despite a committed change. Call onSuccess(updated) before returning so the UI matches DB state; the warning toast still replaces the success toast.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Greptile SummarySeven commits landing six MCP cherry-picks plus the follow-up OAuth persist fix. The changes span the full stack: Python backend (server delete cleans up credential rows, token-exchange stops fabricating a default
Confidence Score: 4/5Safe to merge; all changes are targeted MCP cherry-picks and a narrowly-scoped follow-up fix, each backed by new unit tests. All backend changes are well-tested and the logic is straightforward. The UI changes correctly handle the cross-form OAuth token routing, the OBO credential gate, and the post-redirect form-resync. The only notable gap is the duplicate
|
| Filename | Overview |
|---|---|
| litellm/proxy/_experimental/mcp_server/db.py | Extends delete_mcp_server to also purge litellm_mcpusercredentials rows alongside the existing litellm_mcpuserenvvars cleanup, using an independent try/except per table so a failure in one leg doesn't skip the other. |
| litellm/proxy/_experimental/mcp_server/discoverable_endpoints.py | Stops fabricating a default expires_in: 3600 when the upstream token provider omits it; now only forwards fields actually present in the provider's token response. |
| litellm/proxy/_experimental/mcp_server/rest_endpoints.py | Adds include_disabled_tools (admin-only) query param and apply_tool_filters flag threaded through to _get_tools_for_single_server, allowing the settings UI to fetch the full server catalog before allowlist filtering is applied. |
| litellm/proxy/management_endpoints/mcp_management_endpoints.py | Replaces a single get_allowed_mcp_servers call with iteration over build_effective_auth_contexts, so team-granted access that flows through a UI session token is correctly recognized in the authorize/token access check. |
| ui/litellm-dashboard/src/components/mcp_tools/mcp_server_edit.tsx | Adds flowSource discrimination to prevent the create form from consuming the edit form's OAuth result; persists OBO tokens to DB and passthrough tokens to sessionStorage on save; passes include_disabled_tools=true for the tool-config fetch; adds a form-resync guard for the post-OAuth-redirect blank-form bug. |
| ui/litellm-dashboard/src/components/mcp_tools/mcp_tools.tsx | Adds OBO credential-status check so users without a DB credential see an Authorize gate instead of a silent empty tool list; refactors passthrough header building into shared buildMcpPassthroughAuthHeader. |
| ui/litellm-dashboard/src/hooks/useMcpOAuthFlow.tsx | Adds flowSource field to stored flow state and a source-match guard in resumeOAuthFlow; adds a public reset() method to clear token/status/in-flight guard for reuse across sessions. |
| ui/litellm-dashboard/src/components/mcp_tools/mcp_servers.tsx | Reads a one-shot TOOLS_OAUTH_UI_STATE_KEY from sessionStorage on mount to restore the correct server's Tools tab after an OBO OAuth redirect; clears the key immediately and on handleBack. |
| ui/litellm-dashboard/src/components/mcp_tools/mcp_server_view.tsx | Adds isReturningFromEditOAuth helper to auto-select the Settings tab (index 2) on return from an edit-flow OAuth redirect; threads userID and initialTabIndex props. |
| ui/litellm-dashboard/src/components/mcp_tools/mcp_tool_configuration.tsx | Removes the internal useTestMCPConnection fallback; component now always renders parent-provided tool state, eliminating the dual-source-of-truth risk. |
| ui/litellm-dashboard/src/components/networking.tsx | Adds includeDisabledTools parameter to listMCPTools, appending include_disabled_tools=true to the query string when requested. |
| ui/litellm-dashboard/src/hooks/mcpOAuthUtils.ts | Exports TOOLS_OAUTH_UI_STATE_KEY constant for the OBO redirect-resume flow, mirroring the existing EDIT_OAUTH_UI_STATE_KEY pattern. |
| ui/litellm-dashboard/src/utils/mcpHeaderUtils.ts | Extracts buildMcpPassthroughAuthHeader helper that consolidates the alias-to-header-name logic used in multiple components. |
| ui/litellm-dashboard/src/hooks/useMcpOAuthFlow.test.tsx | New test file for the reset() method: verifies it clears token state and unblocks the in-flight guard for a subsequent exchange. |
| ui/litellm-dashboard/src/components/mcp_tools/mcp_server_edit.test.tsx | Extensive new test suites covering tool-list fetch (OBO vs passthrough, staged token), form-resync on post-redirect mount, and OAuth token persistence (OBO, passthrough, failure path). |
| tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py | Adds tests for include_disabled_tools admin-only enforcement and apply_tool_filters=False full-catalog behavior; updates existing stubs to include the new apply_tool_filters parameter. |
| tests/test_litellm/proxy/management_endpoints/test_mcp_management_endpoints.py | Adds a new test verifying that a team-access-group grant is recognized via build_effective_auth_contexts; patches the new mock into existing tests that previously lacked it. |
| tests/test_litellm/proxy/_experimental/mcp_server/test_discoverable_endpoints.py | Adds tests verifying that expires_in is omitted when the upstream provider omits it and forwarded unchanged when present. |
| tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_env_vars.py | New tests covering credential-row cleanup on server delete: success path, no-op for missing server, and independent-failure isolation between tables. |
Reviews (1): Last reviewed commit: "fix(ui/mcp): refresh parent on OAuth tok..." | Re-trigger Greptile
| import { TOOLS_OAUTH_UI_STATE_KEY } from "@/hooks/mcpOAuthUtils"; | ||
| import UserEnvVarsModal from "./UserEnvVarsModal"; | ||
| import { listMCPUserEnvVarStatus } from "../networking"; |
There was a problem hiding this comment.
This PR exports
EDIT_OAUTH_UI_STATE_KEY from mcp_server_edit.tsx so mcp_server_view.tsx can import it, but mcp_servers.tsx still defines its own local copy of the same string. If the key is ever renamed in mcp_server_edit.tsx, the local copy here won't be updated, silently breaking the edit-OAuth redirect-restore logic in this file.
| import { TOOLS_OAUTH_UI_STATE_KEY } from "@/hooks/mcpOAuthUtils"; | |
| import UserEnvVarsModal from "./UserEnvVarsModal"; | |
| import { listMCPUserEnvVarStatus } from "../networking"; | |
| import { TOOLS_OAUTH_UI_STATE_KEY } from "@/hooks/mcpOAuthUtils"; | |
| import { EDIT_OAUTH_UI_STATE_KEY } from "./mcp_server_edit"; | |
| import UserEnvVarsModal from "./UserEnvVarsModal"; | |
| import { listMCPUserEnvVarStatus } from "../networking"; |
Relevant issues
Build/deploy vehicle for the v1.89.0-rc.3 MCP cherry-picks plus the Greptile follow-up fix. These same commits already live directly on
patch/v1.89.0-rc.2; this PR exists so the litellm-ops componentized image build (which clonesrefs/pull/<N>/head) can build the full latest state including theonSuccessfix.Changes
Seven commits: the six MCP cherry-picks (#29867, #29951, #29960, #30000, #30041, #30141) plus
fix(ui/mcp): refresh parent on OAuth token persist failure during server editaddressing the Greptile P2 onmcp_server_edit.tsx.Type
🐛 Bug Fix