Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/e2e/ui/tests/mcp/mcpServers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ test.describe("MCP Servers", () => {
await formModal.locator('input[id="url"]').fill("https://e2e-fake-mcp.test.local/mcp");

// Authentication: None
// The auth_type Form.Item has no label prop (create_mcp_server.tsx:795), so
// The auth_type Form.Item has no label prop (CreateMCPServer.tsx), so
// it can't be anchored by label text. Scope via the enclosing Collapse
// panel ("Authentication") instead — that anchor is stable even if the
// placeholder copy changes.
Expand Down
31 changes: 14 additions & 17 deletions ui/litellm-dashboard/eslint-suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,20 @@
"count": 1
}
},
"src/app/(dashboard)/mcp-servers/_components/CreateMCPServer.tsx": {
"max-lines": {
"count": 1
},
"no-nested-ternary": {
"count": 1
},
"no-restricted-imports": {
"count": 2
},
"react-hooks/set-state-in-effect": {
"count": 4
}
},
"src/app/(dashboard)/mcp-servers/_components/DcrBridgeToggle.tsx": {
"no-restricted-imports": {
"count": 1
Expand Down Expand Up @@ -900,23 +914,6 @@
"count": 1
}
},
"src/app/(dashboard)/mcp-servers/_components/create_mcp_server.tsx": {
"local/filename-pascal-case": {
"count": 1
},
"max-lines": {
"count": 1
},
"no-nested-ternary": {
"count": 1
},
"no-restricted-imports": {
"count": 2
},
"react-hooks/set-state-in-effect": {
"count": 4
}
},
"src/app/(dashboard)/mcp-servers/_components/index.tsx": {
"local/filename-pascal-case": {
"count": 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import * as networking from "@/components/networking";
import { setToken } from "@/utils/mcpTokenStore";
import CreateMCPServer from "./create_mcp_server";
import CreateMCPServer from "./CreateMCPServer";
import { selectAntOption } from "./testUtils";

vi.mock("@/components/networking", () => ({
Expand Down Expand Up @@ -86,7 +86,7 @@
}));

vi.mock("./mcp_connection_status", () => ({
default: ({ tools }: { tools?: any[] }) => (

Check warning on line 89 in ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/CreateMCPServer.test.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Unexpected any. Specify a different type
<div data-testid="mcp-connection-status" data-tool-count={tools?.length ?? 0} />
),
}));
Expand Down Expand Up @@ -242,7 +242,7 @@
});

// Leave auth value empty and submit
vi.mocked(networking.createMCPServer).mockResolvedValue({

Check warning on line 245 in ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/CreateMCPServer.test.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Object literal with 10 properties passed inline as an argument; assign it to a named variable first
server_id: "new-server-1",
server_name: "Test_Server",
alias: "Test_Server",
Expand Down Expand Up @@ -284,7 +284,7 @@
});

// Leave auth value empty and submit
vi.mocked(networking.createMCPServer).mockResolvedValue({

Check warning on line 287 in ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/CreateMCPServer.test.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Object literal with 10 properties passed inline as an argument; assign it to a named variable first
server_id: "new-server-1",
server_name: "Test_Server",
alias: "Test_Server",
Expand Down Expand Up @@ -328,7 +328,7 @@
const authInput = screen.getByPlaceholderText("Enter token or secret");
await user.type(authInput, "my-secret-key");

vi.mocked(networking.createMCPServer).mockResolvedValue({

Check warning on line 331 in ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/CreateMCPServer.test.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Object literal with 10 properties passed inline as an argument; assign it to a named variable first
server_id: "new-server-1",
server_name: "My_Server",
alias: "My_Server",
Expand Down Expand Up @@ -891,7 +891,7 @@

await selectAntOption("Authentication", "None");

vi.mocked(networking.createMCPServer).mockResolvedValue({

Check warning on line 894 in ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/CreateMCPServer.test.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Object literal with 10 properties passed inline as an argument; assign it to a named variable first
server_id: "new-server-1",
server_name: "No_Auth_Server",
alias: "No_Auth_Server",
Expand Down Expand Up @@ -973,7 +973,7 @@
const limitInput = screen.getByPlaceholderText("e.g. 10");
await user.type(limitInput, "5");

vi.mocked(networking.createMCPServer).mockResolvedValue({

Check warning on line 976 in ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/CreateMCPServer.test.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Object literal with 10 properties passed inline as an argument; assign it to a named variable first
server_id: "new-server-1",
server_name: "Limited_Server",
alias: "Limited_Server",
Expand Down Expand Up @@ -1026,7 +1026,7 @@
target: { value: "te-client-secret" },
});

vi.mocked(networking.createMCPServer).mockResolvedValue({

Check warning on line 1029 in ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/CreateMCPServer.test.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Object literal with 10 properties passed inline as an argument; assign it to a named variable first
server_id: "new-server-te",
server_name: "TE_Server",
alias: "TE_Server",
Expand Down Expand Up @@ -1112,7 +1112,7 @@
target: { value: "kid-1" },
});

vi.mocked(networking.createMCPServer).mockResolvedValue({

Check warning on line 1115 in ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/CreateMCPServer.test.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Object literal with 10 properties passed inline as an argument; assign it to a named variable first
server_id: "new-server-id-jag",
server_name: "IdJag_Server",
alias: "IdJag_Server",
Expand All @@ -1137,7 +1137,7 @@
expect(payload.auth_type).toBe("oauth2_id_jag");
// Leg 1 rides the shared token_exchange_endpoint column; leg 2 is ID-JAG specific.
expect(payload.token_exchange_endpoint).toBe("https://acme.okta.com/oauth2/v1/token");
expect(payload.credentials).toMatchObject({

Check warning on line 1140 in ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/CreateMCPServer.test.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Object literal with 4 properties passed inline as an argument; assign it to a named variable first
client_id: "id-jag-client",
id_jag_resource_token_endpoint: "https://jira.example.com/oauth2/token",
client_private_key: "-----BEGIN PRIVATE KEY-----\nabc\n-----END PRIVATE KEY-----",
Expand Down Expand Up @@ -1238,7 +1238,7 @@
fireEvent.click(screen.getByRole("button", { name: "Disable all tools" }));
});

vi.mocked(networking.createMCPServer).mockResolvedValue({

Check warning on line 1241 in ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/CreateMCPServer.test.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Object literal with 10 properties passed inline as an argument; assign it to a named variable first
server_id: "new-server-1",
server_name: "Locked_Down_Server",
alias: "Locked_Down_Server",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Skeleton } from "@/components/ui/skeleton";
import { cn } from "@/lib/cva.config";
import { fetchDiscoverableMCPServers } from "@/components/networking";
import { DiscoverableMCPServer, DiscoverMCPServersResponse } from "@/components/mcp_tools/types";
import { mcpLogoImg } from "./create_mcp_server";
import { mcpLogoImg } from "./CreateMCPServer";
import { resolveLogoSrc } from "@/lib/assetPaths";

interface MCPDiscoveryProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import NotificationsManager from "@/components/molecules/notifications_manager";
import { deleteMCPServer } from "@/components/networking";
import { MCPSubmissionsTab } from "./MCPSubmissionsTab";
import { MCPToolsetsTab } from "./MCPToolsetsTab";
import CreateMCPServer from "./create_mcp_server";
import CreateMCPServer from "./CreateMCPServer";
import MCPConnect from "./mcp_connect";
import MCPServerCard from "./MCPServerCard";
import { MCPServerView } from "./mcp_server_view";
Expand Down
Loading