-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
feat(MCP/UI): add OAuth flow selector on the MCP edit page #32298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tin-berri
merged 5 commits into
litellm_internal_staging
from
litellm_mcp_edit_flow_selector
Jul 7, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
608f4af
feat(ui): OAuth flow selector on the MCP edit page
tin-berri c88183d
fix(mcp): registry-to-table conversions must carry oauth2_flow
tin-berri a031073
docs(mcp): flag _resolve_oauth2_flow as security-sensitive in its doc…
tin-berri 92b6ecc
refactor(ui): extract oauth2FlowToFormValue helper for the MCP OAuth …
tin-berri e7a3d3b
feat(ui): surface and warn on an unset MCP oauth2_flow (server card +…
tin-berri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
ui/litellm-dashboard/src/components/mcp_tools/MCPServerCard.test.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import React from "react"; | ||
| import { render, screen } from "@testing-library/react"; | ||
| import { describe, it, expect, vi } from "vitest"; | ||
| import MCPServerCard from "./MCPServerCard"; | ||
| import type { MCPServer } from "./types"; | ||
|
|
||
| const baseServer: MCPServer = { | ||
| server_id: "srv-1", | ||
| server_name: "demo_server", | ||
| alias: "demo_server", | ||
| transport: "http", | ||
| url: "https://example.com/mcp", | ||
| auth_type: "oauth2", | ||
| } as MCPServer; | ||
|
|
||
| function renderCard(overrides: Partial<MCPServer>) { | ||
| render(<MCPServerCard server={{ ...baseServer, ...overrides } as MCPServer} onClick={vi.fn()} />); | ||
| } | ||
|
|
||
| describe("MCPServerCard OAuth flow indicator", () => { | ||
| it("shows the 'OAuth flow not set' badge for an oauth2 server with no oauth2_flow", () => { | ||
| renderCard({ auth_type: "oauth2", oauth2_flow: null }); | ||
| expect(screen.getByText("OAuth flow not set")).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it("does not show the badge once oauth2_flow is set (client_credentials)", () => { | ||
| renderCard({ auth_type: "oauth2", oauth2_flow: "client_credentials" }); | ||
| expect(screen.queryByText("OAuth flow not set")).not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it("does not show the badge once oauth2_flow is set (authorization_code)", () => { | ||
| renderCard({ auth_type: "oauth2", oauth2_flow: "authorization_code" }); | ||
| expect(screen.queryByText("OAuth flow not set")).not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it("does not show the badge for a non-oauth2 server", () => { | ||
| renderCard({ auth_type: "api_key", oauth2_flow: null }); | ||
| expect(screen.queryByText("OAuth flow not set")).not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it("does not show the badge for a delegate (PKCE passthrough) server", () => { | ||
| renderCard({ auth_type: "oauth2", oauth2_flow: null, delegate_auth_to_upstream: true }); | ||
| expect(screen.queryByText("OAuth flow not set")).not.toBeInTheDocument(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.