+
+ {(["basics", "launch", "upload", "review"] as const).map((step) => (
+ setWizardStep(step)}
+ className={`rounded-sm border px-3 py-2 text-xs font-mono uppercase tracking-wider ${wizardStep === step ? "border-[var(--nvidia-green)] bg-[var(--status-running-bg)] text-[var(--foreground)]" : "border-[var(--border-subtle)] bg-[var(--background)] text-[var(--foreground-dim)]"}`}
+ >
+ {step}
+
+ ))}
+
-
Name
+
Name Stable display name and default id for this MCP server.
setCustomName(event.target.value)} className="field-control w-full px-3 py-2 text-sm font-mono" />
-
Transport
+
Transport Use stdio for local commands, HTTP for remote streamable MCP endpoints.
setCustomTransport(event.target.value as McpTransport)} className="field-control w-full px-3 py-2 text-sm font-mono">
stdio
http
-
Summary
+
Summary Short note shown in the installed server list.
setCustomSummary(event.target.value)} className="field-control w-full px-3 py-2 text-sm" />
-
{customTransport === "http" ? "URL" : "Command"}
+
{customTransport === "http" ? "URL" : "Command"} {customTransport === "http" ? "Full remote MCP endpoint URL." : "Executable available to the controller, such as npx, uvx, node, or python."}
setCustomCommand(event.target.value)} placeholder={customTransport === "http" ? "https://mcp.example.com/mcp" : "npx, uvx, node, python"} className="field-control w-full px-3 py-2 text-sm font-mono" />
-
Args
+
Args One argument per line, passed to the command in order.
-
{customTransport === "http" ? "Headers" : "Env"}
+
{customTransport === "http" ? "Headers" : "Env"} KEY=value lines. HTTP entries become headers; stdio entries become environment variables.
-
Upload Runtime
+
Upload Runtime Runtime used to bootstrap uploaded bundles before preflight.
setUploadRuntime(event.target.value)} placeholder="python3, node, uv, uvx" className="field-control w-full px-3 py-2 text-sm font-mono" />
-
Upload Launch Mode
+
Upload Launch Mode How the uploaded server should start after dependencies are installed.
setUploadEntryMode(event.target.value as "file" | "python-module" | "console-script")} className="field-control w-full px-3 py-2 text-sm font-mono">
File
Python module
@@ -755,9 +933,35 @@ export default function McpConfigurationPanel({ sandboxes = [] }: McpConfigurati
-
Upload Entrypoint
+
Upload Entrypoint File path, Python module name, or installed console script to launch.
setUploadEntrypoint(event.target.value)} placeholder={uploadEntryMode === "python-module" ? "isaac_mcp_poc.server" : uploadEntryMode === "console-script" ? "isaac-mcp-poc" : "server.py, src/server.py, index.js"} className="field-control w-full px-3 py-2 text-sm font-mono" />
+
+
Preflight Repair When preflight fails, ask the running LLM endpoint for a bounded repair and run preflight again.
+
+ Use sandbox LLM on failed uploads
+ setUploadRepair(event.target.checked)}
+ className="h-4 w-4 accent-[var(--nvidia-green)]"
+ />
+
+
+
+
Repair Route Optional sandbox whose configured model should be used for repair assistance.
+
setRepairSandboxId(event.target.value)}
+ disabled={!uploadRepair}
+ className="field-control w-full px-3 py-2 text-sm font-mono"
+ >
+ Default controller model
+ {sandboxes.map((sandbox) => (
+ {sandbox.name}
+ ))}
+
+
- Install Custom Server
+ Install Server Command
Choose Directory
diff --git a/app/lib/mcpPreflightRepair.ts b/app/lib/mcpPreflightRepair.ts
new file mode 100644
index 0000000..8236279
--- /dev/null
+++ b/app/lib/mcpPreflightRepair.ts
@@ -0,0 +1,253 @@
+import { readdir, readFile, stat, writeFile } from "node:fs/promises"
+import path from "node:path"
+import { getSandboxInferenceConfig } from "./sandboxInferenceStore"
+import type { McpPreflightResult } from "./mcpPreflight"
+import type { McpServerInstall } from "./mcpServerStore"
+
+export type McpPreflightRepairChange = {
+ type: "file" | "launch"
+ path?: string
+ summary: string
+}
+
+export type McpPreflightRepairResult = {
+ attempted: boolean
+ ok: boolean
+ provider: "openai-compatible"
+ model: string
+ baseUrl: string
+ summary: string
+ changes: McpPreflightRepairChange[]
+ error?: string
+ updatedServer?: Pick
+}
+
+type RepairContext = {
+ uploadRoot: string
+ projectRoot: string
+ server: McpServerInstall
+ preflight: McpPreflightResult
+ dependencyLogs?: string[]
+ sandboxId?: string | null
+}
+
+type LlmRepairResponse = {
+ summary?: string
+ files?: Array<{ path?: string; content?: string; summary?: string }>
+ launch?: {
+ command?: string
+ args?: string[]
+ env?: Record
+ summary?: string
+ }
+}
+
+const MAX_CONTEXT_FILE_BYTES = Number.parseInt(process.env.MCP_PREFLIGHT_REPAIR_MAX_FILE_BYTES || String(40 * 1024), 10)
+const MAX_CONTEXT_FILES = Number.parseInt(process.env.MCP_PREFLIGHT_REPAIR_MAX_FILES || "18", 10)
+const MAX_REPAIR_FILE_BYTES = Number.parseInt(process.env.MCP_PREFLIGHT_REPAIR_MAX_OUTPUT_FILE_BYTES || String(512 * 1024), 10)
+const REQUEST_TIMEOUT_MS = Number.parseInt(process.env.MCP_PREFLIGHT_REPAIR_TIMEOUT_MS || "60000", 10)
+const DEFAULT_MODEL = process.env.MCP_PREFLIGHT_LLM_MODEL || process.env.OPENAI_MODEL || "gpt-4o-mini"
+const DEFAULT_BASE_URL = process.env.MCP_PREFLIGHT_LLM_BASE_URL || process.env.OPENAI_BASE_URL || process.env.VLLM_BASE_URL || "http://localhost:8000/v1"
+
+function cleanBaseUrl(value: string) {
+ return value.replace(/\/+$/, "")
+}
+
+function relativeInside(root: string, candidate: string) {
+ const fullPath = path.resolve(root, candidate)
+ if (fullPath !== root && !fullPath.startsWith(`${root}${path.sep}`)) {
+ throw new Error("repair path must stay inside the uploaded server")
+ }
+ return fullPath
+}
+
+function normalizeRepairPath(value: string) {
+ const normalized = path.posix.normalize(value.replace(/\\/g, "/")).replace(/^\/+/, "")
+ if (!normalized || normalized === "." || normalized.startsWith("../") || normalized.includes("/../")) {
+ throw new Error("repair file path must be relative to the uploaded server")
+ }
+ return normalized
+}
+
+function isLikelyUsefulFile(filePath: string) {
+ if (/(^|\/)(node_modules|\.venv|\.git|dist|build|__pycache__)(\/|$)/.test(filePath)) return false
+ return /\.(py|js|mjs|cjs|ts|json|toml|txt|md|yaml|yml)$/i.test(filePath)
+ || /(^|\/)(requirements\.txt|package\.json|pyproject\.toml)$/.test(filePath)
+}
+
+async function collectFiles(root: string, directory = root): Promise {
+ const entries = await readdir(directory, { withFileTypes: true }).catch(() => [])
+ const files: string[] = []
+ for (const entry of entries) {
+ const fullPath = path.join(directory, entry.name)
+ const relative = path.relative(root, fullPath).replace(/\\/g, "/")
+ if (entry.isDirectory()) {
+ if (/(^|\/)(node_modules|\.venv|\.git|dist|build|__pycache__)(\/|$)/.test(relative)) continue
+ files.push(...await collectFiles(root, fullPath))
+ } else if (entry.isFile()) {
+ if (!isLikelyUsefulFile(relative)) continue
+ files.push(relative)
+ }
+ }
+ return files
+}
+
+async function readContextFiles(root: string) {
+ const files = (await collectFiles(root)).slice(0, MAX_CONTEXT_FILES)
+ const context: Array<{ path: string; content: string; truncated: boolean }> = []
+ for (const file of files) {
+ const fullPath = relativeInside(root, file)
+ const stats = await stat(fullPath).catch(() => null)
+ if (!stats || stats.size > MAX_CONTEXT_FILE_BYTES * 2) continue
+ const content = await readFile(fullPath, "utf8").catch(() => "")
+ context.push({
+ path: file,
+ content: content.length > MAX_CONTEXT_FILE_BYTES ? content.slice(0, MAX_CONTEXT_FILE_BYTES) : content,
+ truncated: content.length > MAX_CONTEXT_FILE_BYTES,
+ })
+ }
+ return context
+}
+
+async function resolveRepairRoute(sandboxId?: string | null) {
+ if (sandboxId) {
+ const config = await getSandboxInferenceConfig(sandboxId)
+ const enabled = config.routes.filter((route) => route.enabled)
+ const primary = enabled.find((route) => route.id === config.primaryRouteId) || enabled[0]
+ if (primary?.model) {
+ return {
+ model: process.env.MCP_PREFLIGHT_LLM_MODEL || primary.model,
+ baseUrl: cleanBaseUrl(DEFAULT_BASE_URL),
+ }
+ }
+ }
+ return {
+ model: DEFAULT_MODEL,
+ baseUrl: cleanBaseUrl(DEFAULT_BASE_URL),
+ }
+}
+
+function extractJsonObject(value: string) {
+ const trimmed = value.trim()
+ if (trimmed.startsWith("{")) return trimmed
+ const match = trimmed.match(/\{[\s\S]*\}/)
+ if (!match) throw new Error("repair model did not return JSON")
+ return match[0]
+}
+
+async function requestRepairPlan(context: RepairContext, files: Awaited>) {
+ const route = await resolveRepairRoute(context.sandboxId)
+ const controller = new AbortController()
+ const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS)
+ try {
+ const response = await fetch(`${route.baseUrl}/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: route.model,
+ temperature: 0.1,
+ response_format: { type: "json_object" },
+ messages: [
+ {
+ role: "system",
+ content: [
+ "You repair uploaded Model Context Protocol stdio servers.",
+ "Return only JSON with optional files and launch keys.",
+ "Only modify files that are included in the context.",
+ "Do not invent dependencies unless required by the observed error.",
+ "Prefer minimal, runnable fixes that let MCP initialize and list tools.",
+ ].join(" "),
+ },
+ {
+ role: "user",
+ content: JSON.stringify({
+ server: {
+ command: context.server.command,
+ args: context.server.args,
+ envKeys: Object.keys(context.server.env || {}),
+ },
+ preflight: context.preflight,
+ dependencyLogs: context.dependencyLogs || [],
+ files,
+ expectedJson: {
+ summary: "short explanation",
+ files: [{ path: "relative/path.py", content: "complete replacement content", summary: "what changed" }],
+ launch: { command: context.server.command, args: context.server.args, env: context.server.env, summary: "optional launch change" },
+ },
+ }),
+ },
+ ],
+ }),
+ })
+ const data = await response.json().catch(() => null)
+ if (!response.ok) throw new Error(data?.error?.message || data?.error || `repair model request failed (${response.status})`)
+ const content = data?.choices?.[0]?.message?.content
+ if (typeof content !== "string" || !content.trim()) throw new Error("repair model returned an empty response")
+ return {
+ route,
+ plan: JSON.parse(extractJsonObject(content)) as LlmRepairResponse,
+ }
+ } finally {
+ clearTimeout(timeout)
+ }
+}
+
+function normalizeLaunch(server: McpServerInstall, launch?: LlmRepairResponse["launch"]) {
+ if (!launch || typeof launch !== "object") return null
+ const command = typeof launch.command === "string" && launch.command.trim() ? launch.command.trim() : server.command
+ const args = Array.isArray(launch.args)
+ ? launch.args.map((arg) => String(arg ?? "").trim()).filter(Boolean)
+ : server.args
+ const env = launch.env && typeof launch.env === "object" && !Array.isArray(launch.env)
+ ? Object.fromEntries(Object.entries(launch.env).map(([key, value]) => [key.trim(), String(value ?? "").trim()]).filter(([key]) => Boolean(key)))
+ : server.env
+ if (command === server.command && JSON.stringify(args) === JSON.stringify(server.args) && JSON.stringify(env) === JSON.stringify(server.env)) {
+ return null
+ }
+ return { command, args, env, summary: launch.summary || "Adjusted launch metadata." }
+}
+
+export async function repairUploadedMcpServerWithLlm(context: RepairContext): Promise {
+ const files = await readContextFiles(context.projectRoot)
+ const { route, plan } = await requestRepairPlan(context, files)
+ const changes: McpPreflightRepairChange[] = []
+
+ for (const file of Array.isArray(plan.files) ? plan.files : []) {
+ if (typeof file?.path !== "string" || typeof file?.content !== "string") continue
+ if (Buffer.byteLength(file.content, "utf8") > MAX_REPAIR_FILE_BYTES) {
+ throw new Error(`repair output for ${file.path} is too large`)
+ }
+ const relative = normalizeRepairPath(file.path)
+ if (!files.some((contextFile) => contextFile.path === relative)) {
+ throw new Error(`repair model tried to edit a file outside provided context: ${relative}`)
+ }
+ await writeFile(relativeInside(context.projectRoot, relative), file.content, { mode: 0o600 })
+ changes.push({ type: "file", path: relative, summary: file.summary || `Updated ${relative}` })
+ }
+
+ const launch = normalizeLaunch(context.server, plan.launch)
+ if (launch) {
+ changes.push({ type: "launch", summary: launch.summary })
+ }
+
+ return {
+ attempted: true,
+ ok: changes.length > 0,
+ provider: "openai-compatible",
+ model: route.model,
+ baseUrl: route.baseUrl,
+ summary: plan.summary || (changes.length > 0 ? "Applied LLM-assisted MCP repair." : "The repair model did not suggest changes."),
+ changes,
+ updatedServer: launch ? {
+ command: launch.command,
+ args: launch.args,
+ env: launch.env,
+ } : undefined,
+ }
+}
diff --git a/app/lib/mcpRegistryStore.ts b/app/lib/mcpRegistryStore.ts
new file mode 100644
index 0000000..25ff159
--- /dev/null
+++ b/app/lib/mcpRegistryStore.ts
@@ -0,0 +1,94 @@
+import { mkdir, readFile, writeFile } from "node:fs/promises"
+import path from "node:path"
+
+export type McpRegistry = {
+ id: string
+ name: string
+ baseUrl: string
+ description: string
+ addedAt: string
+}
+
+type StoreShape = {
+ registries: McpRegistry[]
+}
+
+const HOME = process.env.HOME || "/tmp"
+const STORE_DIR = process.env.NEMOCLAW_DASHBOARD_STATE_DIR || path.join(HOME, ".nemoclaw-dashboard")
+const STORE_PATH = path.join(STORE_DIR, "mcp-registries.json")
+
+export const DEFAULT_MCP_REGISTRY: McpRegistry = {
+ id: "official",
+ name: "Official MCP Registry",
+ baseUrl: process.env.MCP_REGISTRY_BASE_URL || "https://registry.modelcontextprotocol.io",
+ description: "The public Model Context Protocol registry.",
+ addedAt: "default",
+}
+
+function slugify(value: string) {
+ return value
+ .trim()
+ .toLowerCase()
+ .replace(/[^a-z0-9-]+/g, "-")
+ .replace(/^-+|-+$/g, "")
+ .slice(0, 64) || "mcp-registry"
+}
+
+function normalizeRegistry(input: Partial, existing?: McpRegistry | null): McpRegistry {
+ const name = typeof input.name === "string" && input.name.trim() ? input.name.trim() : existing?.name || "MCP Registry"
+ const rawUrl = typeof input.baseUrl === "string" && input.baseUrl.trim() ? input.baseUrl.trim() : existing?.baseUrl || ""
+ if (!rawUrl) throw new Error("registry URL is required")
+ const parsed = new URL(rawUrl)
+ parsed.pathname = parsed.pathname.replace(/\/+$/, "")
+ parsed.search = ""
+ parsed.hash = ""
+
+ return {
+ id: slugify(input.id || existing?.id || name),
+ name,
+ baseUrl: parsed.toString().replace(/\/+$/, ""),
+ description: typeof input.description === "string" ? input.description.trim() : existing?.description || "",
+ addedAt: existing?.addedAt || new Date().toISOString(),
+ }
+}
+
+async function readStore(): Promise {
+ try {
+ const raw = await readFile(STORE_PATH, "utf8")
+ const parsed = JSON.parse(raw)
+ return parsed && typeof parsed === "object" && Array.isArray(parsed.registries)
+ ? parsed
+ : null
+ } catch {
+ return null
+ }
+}
+
+async function writeStore(store: StoreShape) {
+ await mkdir(STORE_DIR, { recursive: true, mode: 0o700 })
+ await writeFile(STORE_PATH, JSON.stringify(store, null, 2), { mode: 0o600 })
+}
+
+export async function listMcpRegistries() {
+ const store = await readStore()
+ return store?.registries || [DEFAULT_MCP_REGISTRY]
+}
+
+export async function saveMcpRegistry(input: Partial) {
+ const store = await readStore() || { registries: [DEFAULT_MCP_REGISTRY] }
+ const id = slugify(input.id || input.name || "mcp-registry")
+ const existing = store.registries.find((registry) => registry.id === id)
+ const next = normalizeRegistry({ ...input, id }, existing)
+ const filtered = store.registries.filter((registry) => registry.id !== next.id)
+ store.registries = [next, ...filtered]
+ await writeStore(store)
+ return next
+}
+
+export async function deleteMcpRegistry(registryId: string) {
+ const id = slugify(registryId)
+ const store = await readStore() || { registries: [DEFAULT_MCP_REGISTRY] }
+ store.registries = store.registries.filter((registry) => registry.id !== id)
+ await writeStore(store)
+ return { id }
+}
diff --git a/tests/mcp-configuration-page-check.mjs b/tests/mcp-configuration-page-check.mjs
index a349468..8475e38 100644
--- a/tests/mcp-configuration-page-check.mjs
+++ b/tests/mcp-configuration-page-check.mjs
@@ -14,11 +14,15 @@ const uploadRoutePath = path.join(root, 'app/api/mcp/upload/route.ts')
const preflightRoutePath = path.join(root, 'app/api/mcp/preflight/route.ts')
const healthRoutePath = path.join(root, 'app/api/mcp/health/route.ts')
const registryRoutePath = path.join(root, 'app/api/mcp/registry/route.ts')
+const registriesRoutePath = path.join(root, 'app/api/mcp/registries/route.ts')
+const registriesAssistRoutePath = path.join(root, 'app/api/mcp/registries/assist/route.ts')
+const registryStorePath = path.join(root, 'app/lib/mcpRegistryStore.ts')
const brokerCapabilitiesRoutePath = path.join(root, 'app/api/mcp/broker/capabilities/route.ts')
const brokerCallRoutePath = path.join(root, 'app/api/mcp/broker/call/route.ts')
const sandboxMcpRoutePath = path.join(root, 'app/api/sandbox/[sandboxId]/mcp/route.ts')
const brokerUrlPath = path.join(root, 'app/lib/mcpBrokerUrl.ts')
const preflightLibPath = path.join(root, 'app/lib/mcpPreflight.ts')
+const preflightRepairLibPath = path.join(root, 'app/lib/mcpPreflightRepair.ts')
const middlewarePath = path.join(root, 'middleware.ts')
const panelPath = path.join(root, 'app/components/McpConfigurationPanel.tsx')
const helpPath = path.join(root, 'app/components/HelpPanel.tsx')
@@ -26,7 +30,7 @@ const sidebarPath = path.join(root, 'app/components/Sidebar.tsx')
const sandboxListPath = path.join(root, 'app/components/SandboxList.tsx')
const pagePath = path.join(root, 'app/page.tsx')
-const [storeSource, brokerStoreSource, brokerClientSource, manifestSource, privilegedFilesSource, routeSource, uploadRouteSource, preflightRouteSource, healthRouteSource, registryRouteSource, brokerCapabilitiesRouteSource, brokerCallRouteSource, sandboxMcpRouteSource, brokerUrlSource, preflightLibSource, middlewareSource, panelSource, helpSource, sidebarSource, sandboxListSource, pageSource] = await Promise.all([
+const [storeSource, brokerStoreSource, brokerClientSource, manifestSource, privilegedFilesSource, routeSource, uploadRouteSource, preflightRouteSource, healthRouteSource, registryRouteSource, registriesRouteSource, registriesAssistRouteSource, registryStoreSource, brokerCapabilitiesRouteSource, brokerCallRouteSource, sandboxMcpRouteSource, brokerUrlSource, preflightLibSource, preflightRepairLibSource, middlewareSource, panelSource, helpSource, sidebarSource, sandboxListSource, pageSource] = await Promise.all([
readFile(storePath, 'utf8'),
readFile(brokerStorePath, 'utf8'),
readFile(brokerClientPath, 'utf8'),
@@ -37,11 +41,15 @@ const [storeSource, brokerStoreSource, brokerClientSource, manifestSource, privi
readFile(preflightRoutePath, 'utf8'),
readFile(healthRoutePath, 'utf8'),
readFile(registryRoutePath, 'utf8'),
+ readFile(registriesRoutePath, 'utf8'),
+ readFile(registriesAssistRoutePath, 'utf8'),
+ readFile(registryStorePath, 'utf8'),
readFile(brokerCapabilitiesRoutePath, 'utf8'),
readFile(brokerCallRoutePath, 'utf8'),
readFile(sandboxMcpRoutePath, 'utf8'),
readFile(brokerUrlPath, 'utf8'),
readFile(preflightLibPath, 'utf8'),
+ readFile(preflightRepairLibPath, 'utf8'),
readFile(middlewarePath, 'utf8'),
readFile(panelPath, 'utf8'),
readFile(helpPath, 'utf8'),
@@ -108,6 +116,8 @@ assert.match(uploadRouteSource, /python-module/, 'MCP upload API must support Py
assert.match(uploadRouteSource, /console-script/, 'MCP upload API must support installed console script launch')
assert.match(uploadRouteSource, /resolveProjectRoot/, 'MCP upload API must find project manifests inside uploaded directories')
assert.match(uploadRouteSource, /preflightMcpServer/, 'MCP upload API must preflight uploaded server bundles')
+assert.match(uploadRouteSource, /repairUploadedMcpServerWithLlm/, 'MCP upload API must attempt bounded LLM repair when uploaded server preflight fails')
+assert.match(uploadRouteSource, /form\.get\("sandboxId"\)/, 'MCP upload API must accept a sandbox id so repair can mirror that sandbox LLM route')
assert.match(uploadRouteSource, /preflight-failed/, 'MCP upload API must mark failed preflight installs')
assert.match(uploadRouteSource, /installMcpServer/, 'MCP upload API must install uploaded server bundles')
assert.match(preflightRouteSource, /export async function POST/, 'MCP preflight API must expose a POST check endpoint')
@@ -115,6 +125,11 @@ assert.match(preflightRouteSource, /preflightMcpServer/, 'MCP preflight API must
assert.match(preflightLibSource, /listBrokerServerTools/, 'MCP preflight must validate servers through SDK tool discovery')
assert.match(preflightLibSource, /attempted relative import/, 'MCP preflight assistant must recognize Python package launch failures')
assert.match(preflightLibSource, /FastMCP/, 'MCP preflight assistant must recognize MCP SDK compatibility failures')
+assert.match(preflightRepairLibSource, /getSandboxInferenceConfig/, 'MCP preflight repair must reuse the selected sandbox inference profile when available')
+assert.match(preflightRepairLibSource, /chat\/completions/, 'MCP preflight repair must call an OpenAI-compatible chat endpoint')
+assert.match(preflightRepairLibSource, /response_format: \{ type: "json_object" \}/, 'MCP preflight repair must ask the model for structured JSON')
+assert.match(preflightRepairLibSource, /repair path must stay inside the uploaded server/, 'MCP preflight repair must confine edits to the uploaded server')
+assert.match(preflightRepairLibSource, /provided context/, 'MCP preflight repair must only edit files shown to the model')
assert.match(healthRouteSource, /listBrokerServerTools/, 'MCP health API must inspect server tools through the broker client')
assert.match(healthRouteSource, /enabledServers/, 'MCP health API must check enabled MCP servers')
assert.match(registryRouteSource, /registry\.modelcontextprotocol\.io/, 'MCP registry search should default to the official registry')
@@ -122,7 +137,16 @@ assert.match(registryRouteSource, /\/v0\/servers/, 'MCP registry search should c
assert.match(registryRouteSource, /normalizeRegistryEntry/, 'MCP registry search should normalize results into installable entries')
assert.match(registryRouteSource, /packageInstall/, 'MCP registry search should support package-backed stdio installs')
assert.match(registryRouteSource, /remoteInstall/, 'MCP registry search should support remote HTTP installs')
-assert.match(panelSource, /Install Custom Server/, 'MCP page must expose a custom server install action')
+assert.match(registryRouteSource, /searchParams\.get\("baseUrl"\)/, 'MCP registry search must accept a selected registry base URL')
+assert.match(registryStoreSource, /mcp-registries\.json/, 'MCP registries must persist to dashboard state')
+assert.match(registryStoreSource, /DEFAULT_MCP_REGISTRY/, 'MCP registries should start with the official registry before user changes')
+assert.match(registriesRouteSource, /listMcpRegistries/, 'MCP registries API must list registries')
+assert.match(registriesRouteSource, /saveMcpRegistry/, 'MCP registries API must save registries')
+assert.match(registriesRouteSource, /deleteMcpRegistry/, 'MCP registries API must delete registries')
+assert.match(registriesAssistRouteSource, /chat\/completions/, 'MCP registry assistant must use the running OpenAI-compatible LLM endpoint')
+assert.match(registriesAssistRouteSource, /response_format: \{ type: "json_object" \}/, 'MCP registry assistant must request structured JSON')
+assert.match(panelSource, /Install Server Command/, 'MCP page must expose a server command install action')
+assert.match(panelSource, /Server Install Wizard/, 'MCP page must present custom installation as a wizard')
assert.match(panelSource, /Upload Server/, 'MCP custom server accordion must support uploaded server bundles')
assert.match(panelSource, /Choose Directory/, 'MCP custom server upload must accept directories')
assert.match(panelSource, /Choose Archive/, 'MCP custom server upload must accept archives')
@@ -132,13 +156,24 @@ assert.match(panelSource, /uploadEntrypoint/, 'MCP custom server upload must col
assert.match(panelSource, /uploadEntryMode/, 'MCP custom server upload must collect a launch mode')
assert.match(panelSource, /Python module/, 'MCP custom server upload must expose Python module launch mode')
assert.match(panelSource, /Console script/, 'MCP custom server upload must expose console script launch mode')
+assert.match(panelSource, /uploadRepair/, 'MCP custom server upload must expose LLM repair controls')
+assert.match(panelSource, /repairSandboxId/, 'MCP custom server upload must let operators pick a sandbox LLM route for repair')
+assert.match(panelSource, /LLM repair/, 'MCP custom server upload must summarize LLM-assisted repair results')
+assert.match(panelSource, /FieldHint/, 'MCP server install wizard fields must include tooltips')
+assert.match(panelSource, /wizardStep/, 'MCP server install wizard must expose install workflow steps')
assert.match(panelSource, /preflightServer/, 'MCP page must let operators preflight installed servers')
assert.match(panelSource, /Preflight/, 'MCP page must show preflight controls and results')
assert.match(panelSource, /serverPayloadFromJson/, 'MCP page must parse edited server JSON')
assert.match(panelSource, /startEditingServer/, 'MCP installed server list must expose edit state')
assert.match(panelSource, /Server JSON/, 'MCP installed server editor must render an inline JSON file editor')
-assert.match(panelSource, /Registry Search/, 'MCP page must expose official registry search')
+assert.match(panelSource, /MCP Repo Search and Preconfigured Servers/, 'MCP page must combine repo search and preconfigured servers')
+assert.match(panelSource, /Available Registries/, 'MCP page must display available registries')
+assert.match(panelSource, /Add an MCP Registry/, 'MCP page must show an add-registry empty state')
+assert.match(panelSource, /Draft With LLM/, 'MCP page must let the running LLM draft registry fields')
+assert.match(panelSource, /Delete Selected Registry/, 'MCP page must allow deleting registries')
+assert.match(panelSource, /selectedRegistryId/, 'MCP page must track and highlight the selected registry')
assert.match(panelSource, /\/api\/mcp\/registry/, 'MCP page must query the registry search API')
+assert.match(panelSource, /\/api\/mcp\/registries/, 'MCP page must manage registry sources through the registry API')
assert.match(panelSource, /const REGISTRY_PAGE_SIZE = 4/, 'MCP registry search should page results four at a time')
assert.match(panelSource, /setRegistryResults\(\[\]\)/, 'MCP registry search should clear stale results before a new search')
assert.match(panelSource, /pagedRegistryResults/, 'MCP registry search should render paged results instead of the full result set')
@@ -146,6 +181,8 @@ assert.match(panelSource, /Preconfigured Servers/, 'MCP page should label catalo
assert.match(panelSource, /aria-expanded=\{catalogOpen\}/, 'MCP preconfigured servers should render as an accordion')
assert.match(panelSource, /aria-expanded=\{customOpen\}/, 'MCP custom server form should render as an accordion')
assert.match(panelSource, /MCP Security/, 'MCP page must expose sandbox access controls')
+assert.match(panelSource, /openSecurityServers/, 'MCP security must render installed servers as sub accordions')
+assert.match(panelSource, /aria-expanded=\{securityOpen\}/, 'MCP security must render as an accordion')
assert.match(panelSource, /Allow All/, 'MCP security must support allow-all access')
assert.match(panelSource, /Allow Only/, 'MCP security must support allow-list access')
assert.match(panelSource, /syncSandboxBrokerConfig/, 'MCP configuration grants must sync the sandbox broker config automatically')