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
14 changes: 7 additions & 7 deletions litellm/proxy/mcp_registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"name": "slack",
"title": "Slack",
"description": "Channel management, messaging, and Slack workspace integration",
"icon_url": "https://cdn.simpleicons.org/slack",
"icon_url": "/ui/assets/logos/slack.svg",
"category": "Communication",
"registry_url": null,
"transport": "stdio",
Expand Down Expand Up @@ -249,7 +249,7 @@
"name": "exa",
"title": "Exa",
"description": "Fast, intelligent web search and web crawling",
"icon_url": "https://cdn.simpleicons.org/exa",
"icon_url": "/ui/assets/logos/exa_ai.png",
"category": "Search",
"registry_url": "https://registry.modelcontextprotocol.io/servers/ai.exa%2Fexa",
"transport": "http",
Expand All @@ -262,7 +262,7 @@
"name": "tavily",
"title": "Tavily",
"description": "AI-optimized search engine for research and retrieval",
"icon_url": "https://cdn.simpleicons.org/tavily",
"icon_url": "/ui/assets/logos/tavily.png",
"category": "Search",
"registry_url": null,
"transport": "stdio",
Expand All @@ -288,7 +288,7 @@
"name": "playwright",
"title": "Playwright",
"description": "Browser automation and testing with Playwright",
"icon_url": "https://cdn.simpleicons.org/playwright",
"icon_url": "https://raw.githubusercontent.com/microsoft/playwright/2f6148bcd1a96ec687d55ce08645fc6315b1514e/packages/recorder/public/playwright-logo.svg",
"category": "Web & Browser",
"registry_url": null,
"transport": "stdio",
Expand All @@ -300,7 +300,7 @@
"name": "browserbase",
"title": "Browserbase",
"description": "Cloud browser automation and session management",
"icon_url": "https://cdn.simpleicons.org/browserbase",
"icon_url": "https://www.browserbase.com/favicon.svg",
"category": "Web & Browser",
"registry_url": null,
"transport": "stdio",
Expand All @@ -315,7 +315,7 @@
"name": "aws",
"title": "AWS",
"description": "Interact with Amazon Web Services resources and APIs",
"icon_url": "https://cdn.simpleicons.org/amazonaws",
"icon_url": "/ui/assets/logos/aws.svg",
"category": "Cloud",
"registry_url": null,
"transport": "stdio",
Expand Down Expand Up @@ -392,7 +392,7 @@
"name": "twilio",
"title": "Twilio",
"description": "Send SMS, make calls, and manage communication via Twilio",
"icon_url": "https://cdn.simpleicons.org/twilio",
"icon_url": "/ui/assets/logos/twilio.svg",
"category": "Communication",
"registry_url": null,
"transport": "stdio",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
import MCPDiscovery from "./mcp_discovery";
import { fetchDiscoverableMCPServers } from "@/components/networking";
import type { DiscoverableMCPServer } from "@/components/mcp_tools/types";
import { renderWithProviders } from "../../../../../tests/test-utils";
import { setServerRootPath } from "@/lib/serverRootPath";
import { existsSync, readFileSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";

vi.mock("@/components/networking", () => ({
fetchDiscoverableMCPServers: vi.fn(),
Expand Down Expand Up @@ -36,12 +41,53 @@
describe("MCPDiscovery", () => {
beforeEach(() => {
vi.clearAllMocks();
setServerRootPath("/");
vi.mocked(fetchDiscoverableMCPServers).mockResolvedValue({
servers: [githubServer, slackServer],
categories: ["Developer Tools", "Communication"],
});
});

it.each(["", "/litellm"])("should render available catalog logos under the %s server root", async (root) => {
const testDirectory = dirname(fileURLToPath(import.meta.url));
const registry = JSON.parse(
readFileSync(resolve(testDirectory, "../../../../../../../litellm/proxy/mcp_registry.json"), "utf8"),
) as { servers: DiscoverableMCPServer[] };
const expectedLogos = [
["exa", "/ui/assets/logos/exa_ai.png"],
["tavily", "/ui/assets/logos/tavily.png"],
["slack", "/ui/assets/logos/slack.svg"],
["twilio", "/ui/assets/logos/twilio.svg"],
[
"playwright",
"https://raw.githubusercontent.com/microsoft/playwright/2f6148bcd1a96ec687d55ce08645fc6315b1514e/packages/recorder/public/playwright-logo.svg",
],
["browserbase", "https://www.browserbase.com/favicon.svg"],
["aws", "/ui/assets/logos/aws.svg"],
] as const;
setServerRootPath(root);
vi.mocked(fetchDiscoverableMCPServers).mockResolvedValue({
servers: expectedLogos.map(([name]) => {
const server = registry.servers.find((entry) => entry.name === name)!;
return server;
}),
categories: [],
});

renderWithProviders(<MCPDiscovery {...defaultProps} />);

for (const [name, source] of expectedLogos) {
const server = registry.servers.find((entry) => entry.name === name)!;
if (source.startsWith("/ui/")) {
expect(existsSync(resolve(testDirectory, "../../../../../public", source.slice(4)))).toBe(true);
}
expect(await screen.findByRole("img", { name: server.title })).toHaveAttribute(
"src",
source.startsWith("/ui/") ? `${root}${source}` : source,
);
}
});

// Each category name renders twice: once as a filter pill (a button) and once
// as the heading of its group. Only the heading is not a button.
const groupHeading = (category: string) => screen.getAllByText(category).filter((el) => el.tagName !== "BUTTON");
Expand Down Expand Up @@ -114,7 +160,7 @@
render(<MCPDiscovery {...defaultProps} />);
await screen.findByText("GitHub");

const dialog = document.querySelector("[data-slot='dialog-content']");

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

View workflow job for this annotation

GitHub Actions / frontend-lint

Avoid direct Node access. Prefer using the methods from Testing Library

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

View workflow job for this annotation

GitHub Actions / frontend-lint

Avoid direct Node access. Prefer using the methods from Testing Library
const width = Array.from(dialog?.classList ?? []).filter((c) => c.includes("max-w-"));

expect(width).toContain("sm:max-w-[1000px]");
Expand All @@ -128,7 +174,7 @@
render(<MCPDiscovery {...defaultProps} />);
await screen.findByText("GitHub");

expect(document.querySelector("[data-slot='dialog-close']")).toHaveClass("absolute");

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

View workflow job for this annotation

GitHub Actions / frontend-lint

Avoid direct Node access. Prefer using the methods from Testing Library
expect(screen.getByRole("button", { name: "+ Custom Server" })).toHaveClass("mr-8");
});

Expand Down
Loading