Skip to content

Adhoc v1.88.0 backport: MCP OAuth/Tools fixes + allowlist update-500 fix (#29411) + card grid - #30136

Closed
tin-berri wants to merge 13 commits into
release/v1.88.0from
v1.88.0-adhoc
Closed

Adhoc v1.88.0 backport: MCP OAuth/Tools fixes + allowlist update-500 fix (#29411) + card grid#30136
tin-berri wants to merge 13 commits into
release/v1.88.0from
v1.88.0-adhoc

Conversation

@tin-berri

@tin-berri tin-berri commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Relevant issues

Adhoc backport branch off the v1.88.0 tag (base release/v1.88.0). It cherry-picks a set of already-merged MCP OAuth and Tools-tab fixes, plus a helm config mount and a slack token-lifetime fix, then adds the two dependencies those fixes turned out to need on this older base and the MCP servers card-grid UI.

What this is

v1.88.0-adhoc branches directly off v1.88.0 and carries these merged PRs as individual squash commits, in merge order:

A test(mcp): drop backported tests for features absent from v1.88.0 commit removes tests that git's conflict resolution pulled in from intermediate commits that are not part of this set (per-user env-var rotation from #28917, the MCP upstream-auth exception module from #28356). Those tests exercise code that does not exist on v1.88.0, so they cannot pass here; the genuine regression tests added by #29809 and #29960 stay and pass.

Added dependencies and UI

Two things were added on top because the cherry-picks above depend on them when applied to a base this old:

A small chore: gitignore ui/litellm-dashboard/out commit stops the generated Next.js build output from being committed.

Conflict handling

Several picks conflicted because these PRs were built on top of intermediate commits between v1.88.0 and staging that are not in this set. Each was resolved to the PR's own intent and verified: #29714 was a prettier-only divergence (#29622 is not in the set), so its mcp_tools.tsx is byte-identical to the PR and the isOAuth to isPassthrough switch is intact; #29809 keeps the resolve_valid_user_oauth_token refactor; #29867 keeps only its genuine TOOLS_OAUTH_UI_STATE_KEY import; #29960 keeps the full apply_tool_filters / include_disabled_tools behavior; and #29411 was merged so that both its allowlist logic and #29960's external-tools logic coexist.

Pre-Submission checklist

  • I have added meaningful tests
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

CI (LiteLLM team)

  • Branch creation CI run
    Link:
  • CI run for the last commit
    Link:
  • Merge / cherry-pick CI run
    Links:

Screenshots / Proof of Fix

Each backported commit corresponds one-to-one with an already-reviewed-and-merged PR; the linked PRs carry their own proof of fix. Fidelity of the backport was checked by comparing every original merge commit's changed-line set against its cherry-pick. Tests on this branch: the full MCP backend test directory passes, all MCP dashboard tests pass (including the new "enforces the allowlist when the user explicitly deselects every tool" test that covers the update-500 fix and the card-grid render), and tsc reports no new errors in any touched file.

Type

🐛 Bug Fix

Changes

Backport plus the dependencies the backport needs on v1.88.0, and a frontend-only card-grid for the MCP servers list.

tin-berri and others added 10 commits June 9, 2026 17:15
…9605)

* change deployment configs to include a litellm.cache for litellm-backend pod mirroring litellm-gateway pod

* omit backend annotations block when config and podAnnotations are both empty

* reuse gateway config/configmap for backend instead of separate backend config

---------

Co-authored-by: shin-berri <shin-laptop@berri.ai>
Co-authored-by: yuneng-jiang <yuneng@berri.ai>
Co-authored-by: Tin Chi Lo <tin@Tins-MBP.localdomain>
Co-authored-by: Tin Chi Lo <tin@Tins-MacBook-Pro.local>
#29714)

Interactive PKCE and OBO servers were mislabeled as M2M, so passthrough never showed the Authorize gate; classify by oauth2_flow + delegate_auth_to_upstream instead.
…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
The #29809 and #29960 cherry-picks landed onto v1.88.0, which predates the
per-user env-var rotation feature (#28917) and the MCP upstream-auth exception
module (#28356). Git's conflict resolution bundled those intermediate-commit
tests into the picked test files, where they fail against this base because the
code under test does not exist here (encrypt_value_helper, the env-var rotation
helper, and litellm.proxy._experimental.mcp_server.exceptions.MCPUpstreamAuthError).

Remove the leaked tests; the genuine regression tests added by #29809 (OBO
refresh-on-expiry) and #29960 (admin-only include_disabled_tools) stay and pass.
@greptile-apps

greptile-apps Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Too many files changed for review. (383 files found, 100 file limit)

Sameerlite and others added 2 commits June 10, 2026 10:34
…29411)

* fix(mcp): clear allowed_tools and tool overrides on MCP server edit

Send empty arrays/objects from the dashboard instead of null, coerce legacy
null payloads before Prisma, and stop auto-selecting all tools when the
stored allowlist is empty.

Co-authored-by: Cursor <cursoragent@cursor.com>

* style(mcp): simplify CRUD panel value ternary per review

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(mcp): enforce empty tool allowlist when cleared in dashboard

Set mcp_info.tool_allowlist_enforced on UI save so [] blocks all tools
while legacy servers with default [] remain unrestricted.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Fix legacy MCP tool allowlist edit state

* test(mcp): pin allowlist fields on mock server in tools test

MagicMock auto-attributes are truthy and trigger server_applies_tool_allowlist
after the empty-allowlist enforcement change.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(mcp): avoid locking legacy servers on quick edit save

Only set tool_allowlist_enforced when already enforced or the user
selected tools; skip allowlist fields on save for unrestricted servers;
do not auto-select all tools when editing legacy servers before load.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(mcp): type mcp_info base for allowlist flag read

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(mcp): use MCPInfo type for tool_allowlist_enforced in edit save

Co-authored-by: Cursor <cursoragent@cursor.com>

* Update ui/litellm-dashboard/src/components/mcp_tools/mcp_server_edit.tsx

Co-authored-by: veria-ai[bot] <224490171+veria-ai[bot]@users.noreply.github.com>

* Remove unused MCP allowlist variable

* Fix MCP legacy tool state display

* Fix legacy MCP tool allowlist saves

* fix(mcp): enforce allowlist when create flow deselects all tools

Track explicit allowlist interaction in the create form so deselecting
every tool persists tool_allowlist_enforced=true. Previously an empty
selection sent the flag as false with allowed_tools=[], which the proxy
treats as allow-all, contradicting the UI's 0 tools enabled state. This
mirrors the existing edit-flow handling.

* fix(mcp): enforce disallowed_tools on REST listing and keep restored tool selection on legacy edit

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: veria-ai[bot] <224490171+veria-ai[bot]@users.noreply.github.com>
Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
Card slice of #28917 with env-vars wiring stripped; no networking or migration
@tin-berri tin-berri changed the title Adhoc v1.88.0 backport: MCP OAuth/Tools fixes + helm + slack (9 PRs) Adhoc v1.88.0 backport: MCP OAuth/Tools fixes + allowlist update-500 fix (#29411) + card grid Jun 10, 2026
@tin-berri tin-berri closed this Jun 11, 2026
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.

2 participants