Skip to content

chore(release): cherry-pick MCP fixes onto v1.89.0-rc.2 toward rc.3 - #30329

Merged
tin-berri merged 6 commits into
patch/v1.89.0-rc.2from
litellm_v1.89.0-rc.3_mcp_patches
Jun 13, 2026
Merged

chore(release): cherry-pick MCP fixes onto v1.89.0-rc.2 toward rc.3#30329
tin-berri merged 6 commits into
patch/v1.89.0-rc.2from
litellm_v1.89.0-rc.3_mcp_patches

Conversation

@tin-berri

Copy link
Copy Markdown
Contributor

Relevant issues

Cherry-picks of merged MCP fixes from litellm_internal_staging onto the patch/v1.89.0-rc.2 release branch, toward v1.89.0-rc.3.

Linear ticket

Pre-Submission checklist

  • My PR's scope is as isolated as possible; it only solves 1 specific problem (cherry-picks toward the next rc)

Changes

These six commits cherry-pick cleanly (no manual conflict resolution) onto rc.2, in the same order they were merged to staging:

  1. fix(mcp): let non-creator users OAuth into OBO-mode MCP servers from the Tools page #29867 fix(mcp): let non-creator users OAuth into OBO-mode MCP servers from the Tools page
  2. fix(mcp): mirror upstream token lifetime instead of forcing a 1h OBO expiry #29951 changing expires_in default to use actual slack return details
  3. fix(mcp): load MCP tool configuration tools via the OBO/passthrough-aware GET path #29960 fix(mcp): load MCP tool configuration tools via the OBO/passthrough-aware GET path
  4. fix(ui/mcp): reset OAuth state on create-server modal close so a prior server's token no longer leaks into the next add-server session #30000 fix(ui/mcp): reset OAuth state on create-server modal close so a prior server's token no longer leaks into the next add-server session
  5. fix(mcp): allow team access-group grants in OAuth authorize/token access check #30041 fix(mcp): allow team access-group grants in OAuth authorize/token access check
  6. fix(mcp): drop orphaned per-user credential rows when an MCP server is deleted #30141 fix(mcp): drop orphaned per-user credential rows when an MCP server is deleted

Each original PR carried its own tests; those tests come along with the cherry-picks.

Type

🐛 Bug Fix

tin-berri and others added 6 commits June 12, 2026 17:23
…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
@greptile-apps

greptile-apps Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Six targeted MCP bug fixes cherry-picked from staging onto the v1.89.0-rc.2 branch: OAuth session isolation between create/edit forms, expires_in passthrough from upstream token responses, config-view tool loading via the OBO/passthrough-aware GET path, OAuth state reset on modal close, team access-group grant enforcement in the authorize/token flow, and orphaned per-user credential row cleanup when a server is deleted.

  • Backend fixes (db.py, discoverable_endpoints.py, rest_endpoints.py, mcp_management_endpoints.py): credential rows are now deleted alongside env-var rows on server delete; expires_in is forwarded verbatim from upstream (not defaulted to 3600); an include_disabled_tools admin-only flag exposes the full tool catalog for config purposes; team access-group grants are resolved through build_effective_auth_contexts in the OAuth authorize/token check.
  • Frontend fixes (mcp_server_edit.tsx, mcp_tools.tsx, useMcpOAuthFlow.tsx, create_mcp_server.tsx): the edit form now fetches tools via the GET path with include_disabled_tools=true and persists OAuth tokens on save; OBO servers show an Authorize gate in the Tools tab when no DB credential exists; a flowSource discriminator prevents cross-form OAuth callback consumption; form/tool/OAuth state is fully reset when the create-server modal closes.

Confidence Score: 5/5

All six fixes are narrowly scoped, each carries dedicated unit tests, and no change touches the critical API request path or auth layer in a way that could break existing callers.

Each cherry-pick addresses a concrete, isolated bug (token leakage, wrong expires_in, stale orphan rows, missing team grants, wrong GET path for tool config) and is accompanied by tests that directly exercise the fixed behaviour. The backend changes are additive or constrained to best-effort cleanup paths that cannot turn a success into a failure. The frontend OAuth state reset and flowSource discriminator are well-covered by the new hook and component tests.

mcp_server_edit.tsx — the early return on OAuth credential-persistence failure (flagged in the prior review thread) means onSuccess is not called when the DB write fails after a successful server update; worth a follow-up once that thread is resolved.

Important Files Changed

Filename Overview
litellm/proxy/_experimental/mcp_server/db.py Expands server-delete cleanup to also drop per-user credential rows (litellm_mcpusercredentials) independently of env-var cleanup, with the loop ensuring each table is tried even if the other fails.
litellm/proxy/_experimental/mcp_server/discoverable_endpoints.py Fixes expires_in handling: omits the field when upstream omits it (non-expiring tokens like Slack without rotation) instead of fabricating a 1-hour TTL.
litellm/proxy/_experimental/mcp_server/rest_endpoints.py Adds admin-only include_disabled_tools query param that bypasses the allowlist filter so the config UI can see and toggle disabled tools; enforced server-side to PROXY_ADMIN only.
litellm/proxy/management_endpoints/mcp_management_endpoints.py Fixes OAuth authorize/token access check to expand UI session into per-team contexts via build_effective_auth_contexts, making team access-group grants visible to the check.
ui/litellm-dashboard/src/hooks/useMcpOAuthFlow.tsx Adds flowSource discriminator so only the form that initiated the redirect (create vs edit) processes the returned OAuth callback; adds reset() to clear token state on modal close.
ui/litellm-dashboard/src/components/mcp_tools/create_mcp_server.tsx Resets OAuth flow, form fields, and tool list when the modal closes (including parent-controlled dismissals), preventing prior authorization state from leaking into the next add-server session.
ui/litellm-dashboard/src/components/mcp_tools/mcp_server_edit.tsx Major rework: adds OBO/passthrough-aware tool fetching via GET+include_disabled_tools, OAuth token persistence on save, and a syncedServerIdRef to repopulate the form when server data arrives after mount. An early return on credential-persistence failure does not call onSuccess (flagged in prior review thread).
ui/litellm-dashboard/src/components/mcp_tools/mcp_tools.tsx Adds OBO auth gate: queries per-user credential status before listing tools, showing an Authorize button when no credential row exists and a refetch on success. Refactors passthrough header logic into the shared buildMcpPassthroughAuthHeader helper.

Reviews (2): Last reviewed commit: "fix(mcp): drop orphaned per-user credent..." | Re-trigger Greptile

Comment thread ui/litellm-dashboard/src/components/mcp_tools/mcp_server_edit.tsx
@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
litellm/proxy/_experimental/mcp_server/db.py 0.00% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

@tin-berri
tin-berri merged commit 465ab30 into patch/v1.89.0-rc.2 Jun 13, 2026
50 of 51 checks passed
@tin-berri
tin-berri deleted the litellm_v1.89.0-rc.3_mcp_patches branch June 13, 2026 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant