feat(ui): dcr_bridge toggle for client-forwarded MCP auth modes - #32804
Conversation
Greptile SummaryAdds a "Gateway-hosted sign-in (DCR bridge)" toggle to the MCP server create and edit forms, surfacing the
Confidence Score: 5/5This is a UI-only change adding a single boolean toggle to two forms; it cannot affect backend behavior beyond what the admin explicitly submits. The change is well-scoped: a new self-gating component wired into two existing forms with explicit force-false guards on submit for all non-applicable auth types. Both forms have comprehensive test coverage across all auth-type branches, DOM-order assertions, and round-trip save scenarios. No existing tests were weakened. No files require special attention.
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/components/mcp_tools/DcrBridgeToggle.tsx | New self-gating component that renders the DCR bridge Switch inside a Form.Item; correctly guards with isClientForwardedTokenMode and seeds via initialValue. |
| ui/litellm-dashboard/src/components/mcp_tools/PassthroughAuthorizeSection.tsx | Adds dcrBridgeInitialChecked prop and inserts DcrBridgeToggle after the OAuth secret field; label copy updated to remove 'saved' qualifier (intentionally paired with PR #32752). |
| ui/litellm-dashboard/src/components/mcp_tools/create_mcp_server.tsx | Extracts dcr_bridge from form values and forces it explicitly true/false at submit time; passes dcrBridgeInitialChecked={true} to PassthroughAuthorizeSection so create defaults on. |
| ui/litellm-dashboard/src/components/mcp_tools/mcp_server_edit.tsx | Seeds dcr_bridge via Form initialValues from the stored Boolean; submit handler mirrors the delegate_auth_to_upstream/oauth_passthrough force-false pattern for non-client-forwarded modes. |
| ui/litellm-dashboard/src/components/mcp_tools/types.tsx | Adds dcr_bridge?: boolean |
| ui/litellm-dashboard/src/components/mcp_tools/create_mcp_server.test.tsx | Adds a full test suite covering toggle visibility per auth type, default-on create, explicit false on uncheck, force-false on mode switch, and DOM order; label text assertions updated to match the new copy. |
| ui/litellm-dashboard/src/components/mcp_tools/mcp_server_edit.test.tsx | Adds edit-form test suite covering stored-true/stored-null init, uncheck-then-save, force-false on auth type switch, and value preservation across client-forwarded mode switches. |
Reviews (5): Last reviewed commit: "Merge branch 'litellm_internal_staging' ..." | Re-trigger Greptile
b48750c to
47f33bd
Compare
|
Re-tested the DCR bridge toggle end-to-end on PR head The toggle now renders inside the bordered authorize box, between OAuth Client Secret and the Authorize & Fetch Tools button. All toggle behavior still passes.
Runtime assertions (re-run on 8b8a288)
MethodEach change was saved through the dashboard, reopened after save, and cross-checked with Devin session: https://app.devin.ai/sessions/f03da2725ec94d28b3facf766871b102 |
Render DcrBridgeToggle inside PassthroughAuthorizeSection, after the OAuth client ID/secret fields and just before the Authorize & Fetch Tools button, in both the create and edit flows. Also update the section copy to say a configured OAuth app is saved with the server, using the same wording as the credential lifecycle rework in #32752 so whichever PR lands second rebases cleanly
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
A plain optional label implies the field is persisted like any other form field; the qualifier was only there to contrast with the removed not-saved wording
|
@greptileai rereview |
|
bugbut run |
Relevant issues
Linear ticket
Part of LIT-4337 (the dashboard surface for the dcr_bridge server flag added in #32745)
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review)
Screenshots / Proof of Fix
Captured against a live PostgreSQL-backed proxy on port 4000 and the dashboard on port 3000. Before is merge-base
34602ff627575117f4c1bab9bbb1ba70f1d3286b; after is PR head8b8a28848cb57811751ea9671c9214b1f30cfe56. The toggle now sits inside the browser-only authorize box, after the OAuth client ID and secret fields and just before the Authorize & Fetch Tools button; those client fields now read plain(optional)(the earlier not-saved qualifier is gone)dcr_bridge=truetruefalseRuntime findings
Re-verified on PR head
8b8a28848cb57811751ea9671c9214b1f30cfe56after the toggle moved into the authorize box and the client-field labels changed:false -> true -> falsein its new location (API confirmeddcr_bridge=truethendcr_bridge=false)(optional)Separate backend update finding
An earlier recorded run saw two auth-type transitions return HTTP 500 from the MCP server update endpoint. Saving
auth_type=nonefailed even though the payload contained no client ID, client secret, or credentials and explicitly sentdcr_bridge=false. A later API Key to True Passthrough update also returned HTTP 500This PR changes dashboard code only. The UI sent the expected toggle values, and the force-clear behavior was verified with API Key as the non-client-forwarded mode, matching the PR's regression test. The backend root cause was not isolated in this test
Type
🆕 New Feature
Changes
Adds a per-server "Gateway-hosted sign-in (DCR bridge)" toggle to the MCP server create and edit forms, surfacing the dcr_bridge flag from #32745. The toggle renders only for the client-forwarded token modes (true_passthrough and oauth_delegate) via the existing isClientForwardedTokenMode helper, and is a self-gating component that renders nothing for any other auth type
On create the toggle defaults on, so an admin onboarding a client-forwarded server gets the DCR front door without extra steps; on edit it initializes from the server's stored value, so a server saved before this flag existed shows it off. In both forms the submitted payload carries an explicit boolean only when the field is shown, and forces false for any other auth type so a stale true is never persisted, matching the sibling delegate_auth_to_upstream and oauth_passthrough flags right next to it. This sidesteps the antd onFinish mounted-fields-only behavior by building the value from the submitted auth type rather than relying on the form store
A follow-up commit moves the toggle inside the browser-only authorize box, after the OAuth client ID and secret fields and just before the Authorize & Fetch Tools button, in both the create and edit forms; DOM-order regression tests in both suites pin that placement. The box copy now labels the OAuth client fields as plain (optional), since an unqualified form field reads as persisted; the previous not-saved qualifier is gone, the intro explains that a configured OAuth app is stored with the server, and the client ID hint keeps the original one-sentence note about upstreams without dynamic client registration, dropping only the stale browser-only clause. The intro matches #32752 (the dashboard-side persistence fix); #32752 should merge first since it is the change that actually persists those fields
The DcrBridgeToggle component mirrors the existing TruePassthroughWarning / PassthroughAuthorizeSection idiom (self-gate, then render), the type addition matches the neighboring optional fields, and the tests assert the render gating for each auth type, the create default, the edit initialization from stored value, and the exact payload key presence and value across mode switches
Link to Devin session: https://app.devin.ai/sessions/f03da2725ec94d28b3facf766871b102