Bootstrap uploaded MCP server dependencies

This commit is contained in:
Codex
2026-04-28 20:35:22 +00:00
parent 56d8b88a37
commit 077c44b94d
3 changed files with 128 additions and 5 deletions
+4 -2
View File
@@ -316,7 +316,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
const data = await response.json() as McpResponse & { dependencyInstall?: { kind?: string; logs?: string[] } }
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 : [])
@@ -324,7 +324,9 @@ export default function McpConfigurationPanel({ sandboxes = [] }: McpConfigurati
setUploadFiles([])
setUploadPaths([])
setUploadArchive(null)
setMessage(`${customName} uploaded.`)
const installKind = data.dependencyInstall?.kind || "generic"
const installLogCount = data.dependencyInstall?.logs?.filter(Boolean).length || 0
setMessage(`${customName} uploaded. ${installKind === "generic" ? "No dependency bootstrap was needed." : `${installKind} dependencies bootstrapped${installLogCount > 0 ? ` with ${installLogCount} install step${installLogCount === 1 ? "" : "s"}` : ""}.`}`)
} catch (error) {
setMessage(error instanceof Error ? error.message : "Failed to upload MCP server")
} finally {