From ce4303a602a26ade663137ed158e3f3fd80f576d Mon Sep 17 00:00:00 2001 From: Codex Date: Wed, 29 Apr 2026 15:32:28 +0000 Subject: [PATCH] Add MCP registry wizard preflight flow --- app/api/mcp/registries/assist/route.ts | 67 +++ app/api/mcp/registries/route.ts | 34 ++ app/api/mcp/registry/route.ts | 5 +- app/api/mcp/upload/route.ts | 50 +- app/components/McpConfigurationPanel.tsx | 632 +++++++++++++++-------- app/lib/mcpPreflightRepair.ts | 253 +++++++++ app/lib/mcpRegistryStore.ts | 94 ++++ tests/mcp-configuration-page-check.mjs | 43 +- 8 files changed, 955 insertions(+), 223 deletions(-) create mode 100644 app/api/mcp/registries/assist/route.ts create mode 100644 app/api/mcp/registries/route.ts create mode 100644 app/lib/mcpPreflightRepair.ts create mode 100644 app/lib/mcpRegistryStore.ts diff --git a/app/api/mcp/registries/assist/route.ts b/app/api/mcp/registries/assist/route.ts new file mode 100644 index 0000000..c4ccfe5 --- /dev/null +++ b/app/api/mcp/registries/assist/route.ts @@ -0,0 +1,67 @@ +import { NextResponse } from "next/server" + +const REQUEST_TIMEOUT_MS = Number.parseInt(process.env.MCP_REGISTRY_ASSIST_TIMEOUT_MS || "45000", 10) +const MODEL = process.env.MCP_PREFLIGHT_LLM_MODEL || process.env.OPENAI_MODEL || "gpt-4o-mini" +const BASE_URL = (process.env.MCP_PREFLIGHT_LLM_BASE_URL || process.env.OPENAI_BASE_URL || process.env.VLLM_BASE_URL || "http://localhost:8000/v1").replace(/\/+$/, "") + +function extractJsonObject(value: string) { + const trimmed = value.trim() + if (trimmed.startsWith("{")) return trimmed + const match = trimmed.match(/\{[\s\S]*\}/) + if (!match) throw new Error("registry assistant did not return JSON") + return match[0] +} + +export async function POST(request: Request) { + const controller = new AbortController() + const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS) + try { + const body = await request.json().catch(() => ({})) + const prompt = typeof body?.prompt === "string" ? body.prompt.trim() : "" + if (!prompt) throw new Error("registry prompt is required") + + const response = await fetch(`${BASE_URL}/chat/completions`, { + method: "POST", + signal: controller.signal, + headers: { + "Content-Type": "application/json", + ...(process.env.MCP_PREFLIGHT_LLM_API_KEY || process.env.OPENAI_API_KEY + ? { Authorization: `Bearer ${process.env.MCP_PREFLIGHT_LLM_API_KEY || process.env.OPENAI_API_KEY}` } + : {}), + }, + body: JSON.stringify({ + model: MODEL, + temperature: 0.1, + response_format: { type: "json_object" }, + messages: [ + { + role: "system", + content: "Convert a user's MCP registry description into JSON with name, baseUrl, and description. The baseUrl must be the registry origin/root, not the /v0/servers path. Return only JSON.", + }, + { + role: "user", + content: prompt, + }, + ], + }), + }) + const data = await response.json().catch(() => null) + if (!response.ok) throw new Error(data?.error?.message || data?.error || `registry assistant failed (${response.status})`) + const content = data?.choices?.[0]?.message?.content + if (typeof content !== "string" || !content.trim()) throw new Error("registry assistant returned an empty response") + const suggestion = JSON.parse(extractJsonObject(content)) + return NextResponse.json({ + suggestion: { + name: typeof suggestion?.name === "string" ? suggestion.name : "", + baseUrl: typeof suggestion?.baseUrl === "string" ? suggestion.baseUrl : "", + description: typeof suggestion?.description === "string" ? suggestion.description : "", + }, + model: MODEL, + }) + } catch (error) { + const message = error instanceof Error ? error.message : "Failed to assist registry setup" + return NextResponse.json({ error: message }, { status: /required/.test(message) ? 400 : 502 }) + } finally { + clearTimeout(timeout) + } +} diff --git a/app/api/mcp/registries/route.ts b/app/api/mcp/registries/route.ts new file mode 100644 index 0000000..9a7d47b --- /dev/null +++ b/app/api/mcp/registries/route.ts @@ -0,0 +1,34 @@ +import { NextResponse } from "next/server" +import { deleteMcpRegistry, listMcpRegistries, saveMcpRegistry } from "@/app/lib/mcpRegistryStore" + +export async function GET() { + try { + return NextResponse.json({ registries: await listMcpRegistries() }) + } catch (error) { + const message = error instanceof Error ? error.message : "Failed to load MCP registries" + return NextResponse.json({ error: message }, { status: 500 }) + } +} + +export async function POST(request: Request) { + try { + const body = await request.json().catch(() => ({})) + const action = typeof body?.action === "string" ? body.action : "save" + + if (action === "delete") { + const registryId = typeof body?.registryId === "string" ? body.registryId : "" + return NextResponse.json({ deleted: await deleteMcpRegistry(registryId), registries: await listMcpRegistries() }) + } + + const registry = await saveMcpRegistry({ + id: body?.id, + name: body?.name, + baseUrl: body?.baseUrl, + description: body?.description, + }) + return NextResponse.json({ registry, registries: await listMcpRegistries() }) + } catch (error) { + const message = error instanceof Error ? error.message : "Failed to update MCP registries" + return NextResponse.json({ error: message }, { status: /required|URL|delete/.test(message) ? 400 : 500 }) + } +} diff --git a/app/api/mcp/registry/route.ts b/app/api/mcp/registry/route.ts index 43eae0f..0dcde6f 100644 --- a/app/api/mcp/registry/route.ts +++ b/app/api/mcp/registry/route.ts @@ -1,7 +1,7 @@ import { NextResponse } from "next/server" import type { McpCatalogEntry } from "@/app/lib/mcpServerStore" -const REGISTRY_BASE_URL = process.env.MCP_REGISTRY_BASE_URL || "https://registry.modelcontextprotocol.io" +const DEFAULT_REGISTRY_BASE_URL = process.env.MCP_REGISTRY_BASE_URL || "https://registry.modelcontextprotocol.io" type RegistryArgument = { value?: string @@ -126,7 +126,8 @@ export async function GET(request: Request) { const requestUrl = new URL(request.url) const search = requestUrl.searchParams.get("search") || requestUrl.searchParams.get("q") || "" const limit = Math.max(1, Math.min(Number.parseInt(requestUrl.searchParams.get("limit") || "12", 10) || 12, 30)) - const registryUrl = new URL("/v0/servers", REGISTRY_BASE_URL) + const baseUrl = requestUrl.searchParams.get("baseUrl") || DEFAULT_REGISTRY_BASE_URL + const registryUrl = new URL("/v0/servers", baseUrl) registryUrl.searchParams.set("limit", String(limit)) registryUrl.searchParams.set("is_latest", "true") if (search.trim()) registryUrl.searchParams.set("search", search.trim()) diff --git a/app/api/mcp/upload/route.ts b/app/api/mcp/upload/route.ts index c51d096..6c4dffb 100644 --- a/app/api/mcp/upload/route.ts +++ b/app/api/mcp/upload/route.ts @@ -5,7 +5,8 @@ import os from "node:os" import path from "node:path" import { promisify } from "node:util" import { preflightMcpServer } from "@/app/lib/mcpPreflight" -import { installMcpServer, listMcpServers } from "@/app/lib/mcpServerStore" +import { repairUploadedMcpServerWithLlm, type McpPreflightRepairResult } from "@/app/lib/mcpPreflightRepair" +import { installMcpServer, listMcpServers, type McpServerInstall } from "@/app/lib/mcpServerStore" const execFileAsync = promisify(execFile) const HOME = process.env.HOME || "/tmp" @@ -295,6 +296,8 @@ export async function POST(request: Request) { const runtime = String(form.get("runtime") || "python3").trim() const entrypoint = String(form.get("entrypoint") || "server.py").trim() const entryMode = normalizeEntryMode(form.get("entryMode")) + const sandboxId = String(form.get("sandboxId") || "").trim() + const repairEnabled = String(form.get("repair") || "true") !== "false" const root = path.join(UPLOAD_DIR, id) if (!runtime) throw new Error("runtime command is required") @@ -311,7 +314,7 @@ export async function POST(request: Request) { const projectRoot = await resolveProjectRoot(root, entrypointPath) const bootstrap = await bootstrapUploadedServer(projectRoot, runtime, entrypoint) const launch = await launchCommandForUpload(projectRoot, bootstrap, entryMode, entrypoint, entrypointPath, parseLines(form.get("args"))) - const candidate = { + let candidate = { id, name, summary, @@ -322,7 +325,7 @@ export async function POST(request: Request) { tags: ["uploaded", "custom"], source: "custom", enabled: true, - } as const satisfies { + } satisfies { id: string name: string summary: string @@ -334,13 +337,51 @@ export async function POST(request: Request) { source: "custom" enabled: boolean } - const preflight = await preflightMcpServer({ + const installCandidate = (): McpServerInstall => ({ ...candidate, installedAt: new Date().toISOString(), updatedAt: new Date().toISOString(), accessMode: "disabled", allowedSandboxIds: [], }) + let preflight = await preflightMcpServer(installCandidate()) + let repair: McpPreflightRepairResult | null = null + + if (!preflight.ok && repairEnabled) { + try { + repair = await repairUploadedMcpServerWithLlm({ + uploadRoot: root, + projectRoot, + server: installCandidate(), + preflight, + dependencyLogs: bootstrap.logs, + sandboxId: sandboxId || null, + }) + if (repair.updatedServer) { + candidate = { + ...candidate, + command: repair.updatedServer.command, + args: repair.updatedServer.args, + env: repair.updatedServer.env, + } + } + if (repair.ok) { + preflight = await preflightMcpServer(installCandidate()) + } + } catch (error) { + repair = { + attempted: true, + ok: false, + provider: "openai-compatible", + model: process.env.MCP_PREFLIGHT_LLM_MODEL || process.env.OPENAI_MODEL || "", + baseUrl: process.env.MCP_PREFLIGHT_LLM_BASE_URL || process.env.OPENAI_BASE_URL || process.env.VLLM_BASE_URL || "", + summary: "LLM-assisted repair could not complete.", + changes: [], + error: error instanceof Error ? error.message : "MCP repair failed", + } + } + } + const server = await installMcpServer({ ...candidate, enabled: preflight.ok, @@ -357,6 +398,7 @@ export async function POST(request: Request) { logs: bootstrap.logs, }, preflight, + repair, ...(await listMcpServers()), }) } catch (error) { diff --git a/app/components/McpConfigurationPanel.tsx b/app/components/McpConfigurationPanel.tsx index cae5c2e..6a68f64 100644 --- a/app/components/McpConfigurationPanel.tsx +++ b/app/components/McpConfigurationPanel.tsx @@ -32,6 +32,14 @@ type McpResponse = { error?: string } +type McpRegistry = { + id: string + name: string + baseUrl: string + description: string + addedAt: string +} + type McpPreflightResult = { ok: boolean checkedAt: string @@ -47,6 +55,21 @@ type McpPreflightResult = { } } +type McpPreflightRepairResult = { + attempted: boolean + ok: boolean + provider: "openai-compatible" + model: string + baseUrl: string + summary: string + changes: Array<{ + type: "file" | "launch" + path?: string + summary: string + }> + error?: string +} + type McpSandbox = { id: string name: string @@ -63,6 +86,17 @@ function FieldLabel({ children }: { children: React.ReactNode }) { return } +function FieldHint({ children }: { children: React.ReactNode }) { + return ( + + ? + + ) +} + function parseLines(value: string) { return value .split(/\r?\n/) @@ -100,6 +134,8 @@ export default function McpConfigurationPanel({ sandboxes = [] }: McpConfigurati const [uploadRuntime, setUploadRuntime] = useState("python3") const [uploadEntryMode, setUploadEntryMode] = useState<"file" | "python-module" | "console-script">("file") const [uploadEntrypoint, setUploadEntrypoint] = useState("server.py") + const [uploadRepair, setUploadRepair] = useState(true) + const [repairSandboxId, setRepairSandboxId] = useState("") const [editingServerId, setEditingServerId] = useState(null) const [editorText, setEditorText] = useState("") const [registrySearch, setRegistrySearch] = useState("github") @@ -107,14 +143,25 @@ export default function McpConfigurationPanel({ sandboxes = [] }: McpConfigurati const [registryLoading, setRegistryLoading] = useState(false) const [registryPage, setRegistryPage] = useState(1) const [lastRegistrySearch, setLastRegistrySearch] = useState("") + const [registries, setRegistries] = useState([]) + const [selectedRegistryId, setSelectedRegistryId] = useState("") + const [registryName, setRegistryName] = useState("") + const [registryUrl, setRegistryUrl] = useState("") + const [registryDescription, setRegistryDescription] = useState("") + const [registryPrompt, setRegistryPrompt] = useState("") const [preflightResults, setPreflightResults] = useState>({}) + const [securityOpen, setSecurityOpen] = useState(true) + const [openSecurityServers, setOpenSecurityServers] = useState>({}) + const [repoOpen, setRepoOpen] = useState(true) const [catalogOpen, setCatalogOpen] = useState(false) const [customOpen, setCustomOpen] = useState(false) + const [wizardStep, setWizardStep] = useState<"basics" | "launch" | "upload" | "review">("basics") const installedIds = useMemo(() => new Set(servers.map((server) => server.id)), [servers]) const enabledCount = servers.filter((server) => server.enabled).length const configText = JSON.stringify(config, null, 2) const registryPageCount = Math.max(1, Math.ceil(registryResults.length / REGISTRY_PAGE_SIZE)) + const selectedRegistry = registries.find((registry) => registry.id === selectedRegistryId) || registries[0] || null const pagedRegistryResults = registryResults.slice( (registryPage - 1) * REGISTRY_PAGE_SIZE, registryPage * REGISTRY_PAGE_SIZE, @@ -123,12 +170,20 @@ export default function McpConfigurationPanel({ sandboxes = [] }: McpConfigurati async function load() { try { setLoading(true) - const response = await fetch("/api/mcp", { cache: "no-store" }) + const [response, registryResponse] = await Promise.all([ + fetch("/api/mcp", { cache: "no-store" }), + fetch("/api/mcp/registries", { cache: "no-store" }), + ]) const data = await response.json() as McpResponse + const registryData = await registryResponse.json() as { registries?: McpRegistry[]; error?: string } if (!response.ok) throw new Error(data.error || "Failed to load MCP configuration") + if (!registryResponse.ok) throw new Error(registryData.error || "Failed to load MCP registries") setCatalog(Array.isArray(data.catalog) ? data.catalog : []) setServers(Array.isArray(data.servers) ? data.servers : []) setConfig(data.config || { mcpServers: {} }) + const nextRegistries = Array.isArray(registryData.registries) ? registryData.registries : [] + setRegistries(nextRegistries) + setSelectedRegistryId((current) => current && nextRegistries.some((registry) => registry.id === current) ? current : nextRegistries[0]?.id || "") setMessage("") } catch (error) { setMessage(error instanceof Error ? error.message : "Failed to load MCP configuration") @@ -137,6 +192,74 @@ export default function McpConfigurationPanel({ sandboxes = [] }: McpConfigurati } } + async function saveRegistry() { + try { + setSaving(true) + const response = await fetch("/api/mcp/registries", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ name: registryName, baseUrl: registryUrl, description: registryDescription }), + }) + const data = await response.json() as { registry?: McpRegistry; registries?: McpRegistry[]; error?: string } + if (!response.ok || !data.registry) throw new Error(data.error || "Failed to save MCP registry") + const nextRegistries = Array.isArray(data.registries) ? data.registries : [] + setRegistries(nextRegistries) + setSelectedRegistryId(data.registry.id) + setRegistryName("") + setRegistryUrl("") + setRegistryDescription("") + setRegistryPrompt("") + setMessage(`${data.registry.name} registry added.`) + } catch (error) { + setMessage(error instanceof Error ? error.message : "Failed to save MCP registry") + } finally { + setSaving(false) + } + } + + async function deleteRegistry(registry: McpRegistry) { + try { + setSaving(true) + const response = await fetch("/api/mcp/registries", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ action: "delete", registryId: registry.id }), + }) + const data = await response.json() as { registries?: McpRegistry[]; error?: string } + if (!response.ok) throw new Error(data.error || "Failed to delete MCP registry") + const nextRegistries = Array.isArray(data.registries) ? data.registries : [] + setRegistries(nextRegistries) + setSelectedRegistryId((current) => current === registry.id ? nextRegistries[0]?.id || "" : current) + setRegistryResults([]) + setMessage(`${registry.name} registry deleted.`) + } catch (error) { + setMessage(error instanceof Error ? error.message : "Failed to delete MCP registry") + } finally { + setSaving(false) + } + } + + async function assistRegistry() { + try { + setSaving(true) + const response = await fetch("/api/mcp/registries/assist", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ prompt: registryPrompt || `${registryName} ${registryUrl}`.trim() }), + }) + const data = await response.json() as { suggestion?: Partial; error?: string } + if (!response.ok || !data.suggestion) throw new Error(data.error || "Failed to generate registry suggestion") + setRegistryName(data.suggestion.name || registryName) + setRegistryUrl(data.suggestion.baseUrl || registryUrl) + setRegistryDescription(data.suggestion.description || registryDescription) + setMessage("Registry fields drafted from the running LLM endpoint.") + } catch (error) { + setMessage(error instanceof Error ? error.message : "Failed to generate registry suggestion") + } finally { + setSaving(false) + } + } + async function postUpdate(body: Record, success: string) { try { setSaving(true) @@ -322,6 +445,16 @@ export default function McpConfigurationPanel({ sandboxes = [] }: McpConfigurati return `${preflight.diagnosis.summary}\n${preflight.error || "MCP tool discovery failed."}${causes}${fixes}` } + function summarizeRepair(repair?: McpPreflightRepairResult | null) { + if (!repair?.attempted) return "" + const changeSummary = repair.changes.length > 0 + ? `\nChanged: ${repair.changes.map((change) => change.path ? `${change.path}: ${change.summary}` : change.summary).join(" ")}` + : "" + const route = repair.model ? `\nRepair model: ${repair.model}` : "" + const error = repair.error ? `\nRepair error: ${repair.error}` : "" + return `\nLLM repair ${repair.ok ? "applied" : "did not apply changes"}: ${repair.summary}${changeSummary}${route}${error}` + } + async function preflightServer(server: McpServerInstall) { try { setSaving(true) @@ -357,6 +490,8 @@ export default function McpConfigurationPanel({ sandboxes = [] }: McpConfigurati form.set("entrypoint", uploadEntrypoint) form.set("args", customArgs) form.set("env", customEnv) + form.set("repair", uploadRepair ? "true" : "false") + if (repairSandboxId) form.set("sandboxId", repairSandboxId) if (uploadArchive) { form.set("archive", uploadArchive) } else { @@ -366,7 +501,7 @@ export default function McpConfigurationPanel({ sandboxes = [] }: McpConfigurati }) } const response = await fetch("/api/mcp/upload", { method: "POST", body: form }) - const data = await response.json() as McpResponse & { dependencyInstall?: { kind?: string; logs?: string[] }; preflight?: McpPreflightResult; server?: McpServerInstall } + const data = await response.json() as McpResponse & { dependencyInstall?: { kind?: string; logs?: string[] }; preflight?: McpPreflightResult; repair?: McpPreflightRepairResult; server?: McpServerInstall } if (!response.ok) throw new Error(data.error || "Failed to upload MCP server") setCatalog(Array.isArray(data.catalog) ? data.catalog : catalog) setServers(Array.isArray(data.servers) ? data.servers : []) @@ -382,7 +517,7 @@ export default function McpConfigurationPanel({ sandboxes = [] }: McpConfigurati const preflightNote = data.preflight ? `\nPreflight ${data.preflight.ok ? "passed" : "failed; server saved disabled"}.\n${summarizePreflight(data.preflight)}` : "" - setMessage(`${customName} uploaded. ${installKind === "generic" ? "No dependency bootstrap was needed." : `${installKind} dependencies bootstrapped${installLogCount > 0 ? ` with ${installLogCount} install step${installLogCount === 1 ? "" : "s"}` : ""}.`}${preflightNote}`) + setMessage(`${customName} uploaded. ${installKind === "generic" ? "No dependency bootstrap was needed." : `${installKind} dependencies bootstrapped${installLogCount > 0 ? ` with ${installLogCount} install step${installLogCount === 1 ? "" : "s"}` : ""}.`}${summarizeRepair(data.repair)}${preflightNote}`) } catch (error) { setMessage(error instanceof Error ? error.message : "Failed to upload MCP server") } finally { @@ -408,18 +543,22 @@ export default function McpConfigurationPanel({ sandboxes = [] }: McpConfigurati async function searchRegistry() { const query = registrySearch.trim() + if (!selectedRegistry) { + setMessage("Add an MCP Registry before searching.") + return + } try { setRegistryLoading(true) setRegistryResults([]) setRegistryPage(1) setLastRegistrySearch(query) - const params = new URLSearchParams({ search: query, limit: "24" }) + const params = new URLSearchParams({ search: query, limit: "24", baseUrl: selectedRegistry.baseUrl }) const response = await fetch(`/api/mcp/registry?${params}`, { cache: "no-store" }) const data = await response.json() if (!response.ok) throw new Error(data.error || "Failed to search MCP registry") const results = Array.isArray(data.results) ? data.results : [] setRegistryResults(results) - setMessage(results.length > 0 ? `Found ${results.length} registry server${results.length === 1 ? "" : "s"}.` : "No registry servers matched that search.") + setMessage(results.length > 0 ? `Found ${results.length} server${results.length === 1 ? "" : "s"} in ${selectedRegistry.name}.` : `${selectedRegistry.name} had no matches for that search.`) } catch (error) { setRegistryResults([]) setMessage(error instanceof Error ? error.message : "Failed to search MCP registry") @@ -475,224 +614,251 @@ export default function McpConfigurationPanel({ sandboxes = [] }: McpConfigurati
-
-

MCP Security

-

Control which installed MCP servers are available to sandboxes.

-
-
- {servers.length === 0 ? ( -
- Install an MCP server before configuring sandbox access. -
- ) : servers.map((server) => ( -
-
-
-
-

{server.name}

- - {server.enabled ? "enabled" : "disabled"} - -
-

{server.command} {server.args.join(" ")}

-
-
- - -
+ + {securityOpen && ( +
+ {servers.length === 0 ? ( +
+ Install an MCP server before configuring sandbox access.
- -
-
- Availability - -
-
- Allowed Sandboxes - {sandboxes.length === 0 ? ( -
- No sandboxes detected. -
- ) : ( -
- {sandboxes.map((sandbox) => ( - - ))} + + + {server.name} + + {server.enabled ? "enabled" : "disabled"} + + + {server.command} {server.args.join(" ")} + + {expanded ? "-" : "+"} + + + {expanded && ( +
+
+ + +
+
+
+ Availability + +
+
+ Allowed Sandboxes + {sandboxes.length === 0 ? ( +
No sandboxes detected.
+ ) : ( +
+ {sandboxes.map((sandbox) => ( + + ))} +
+ )} +
+
)}
-
-
- ))} -
-
- -
-
-
-

Registry Search

-

Search the Official MCP Registry and install compatible stdio or remote HTTP servers.

+ ) + })}
- - Open Registry - -
-
- setRegistrySearch(event.target.value)} - onKeyDown={(event) => { - if (event.key === "Enter") searchRegistry() - }} - placeholder="Search GitHub, Slack, filesystem, Postgres..." - className="field-control min-w-0 flex-1 px-3 py-2 text-sm" - /> - -
- {registryResults.length > 0 && ( - <> -
-

- Showing {((registryPage - 1) * REGISTRY_PAGE_SIZE) + 1}-{Math.min(registryPage * REGISTRY_PAGE_SIZE, registryResults.length)} of {registryResults.length} - {lastRegistrySearch ? ` for "${lastRegistrySearch}"` : ""} -

-
- - - {registryPage} / {registryPageCount} - - -
-
-
- {pagedRegistryResults.map((entry, index) => { - const installed = installedIds.has(entry.id) - return ( -
-
-
-

{entry.name}

-

{entry.summary}

-
- {entry.transport} -
-
- {entry.command} {entry.args.join(" ")} -
-
-

{entry.tags.join(" / ")}

- -
-
- ) - })} -
- )}
- {catalogOpen && ( -
- {catalog.map((entry) => { - const installed = installedIds.has(entry.id) - return ( -
-
-
-

{entry.name}

-

{entry.summary}

- {entry.websiteUrl && ( - - Setup Guide - - )} -
- {entry.transport} -
-
- {entry.command} {entry.args.join(" ")} -
-
-

{entry.tags.join(" / ")}

- + {repoOpen && ( +
+
+
+ Available Registries + {selectedRegistry && ( + Open + )} +
+ {registries.length === 0 ? ( +
+ Add an MCP Registry +
+ ) : ( +
+ {registries.map((registry) => { + const selected = registry.id === selectedRegistryId + return ( + + ) + })} +
+ )} + {selectedRegistry && ( + + )} +
+ +
+
+
+
Registry NameName shown in the registry selector.
+ setRegistryName(event.target.value)} placeholder="Company MCP Repo" className="field-control w-full px-3 py-2 text-sm" /> +
+
+
Registry URLRoot URL for a registry that exposes /v0/servers.
+ setRegistryUrl(event.target.value)} placeholder="https://registry.example.com" className="field-control w-full px-3 py-2 text-sm font-mono" /> +
+
+
LLM Registry AssistDescribe a registry and the running LLM endpoint drafts the fields.
+