fix(mcp): preflight python module check and surface install errors

- Verify python -m module import in preflight with fix hints

- Pass env_schema defaults in health/sync; catch JSON install exceptions in UI

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-05-30 23:42:44 +08:00
parent 8787adc3cc
commit 4610989d72
5 changed files with 107 additions and 34 deletions

View file

@ -5014,6 +5014,8 @@ async function renderPlugins() {
class: "btn btn--primary",
text: "Install MCP",
onclick: async () => {
installStatus.textContent = "[install] running preflight...";
try {
const payload = {
source_type: sourceType.value,
source_ref: sourceRef.value.trim(),
@ -5063,6 +5065,9 @@ async function renderPlugins() {
installStatus.textContent = JSON.stringify(res);
markPrewarmReminder("mcp_installed");
router();
} catch (err) {
installStatus.textContent = `[install] failed: ${String((err && err.message) || err || "install_failed")}`;
}
},
});
const jsonInstallBtn = el("button", {
@ -5075,6 +5080,8 @@ async function renderPlugins() {
installStatus.textContent = "[json] empty payload";
return;
}
installStatus.textContent = "[json] installing...";
try {
let parsed;
try {
parsed = JSON.parse(raw);
@ -5237,6 +5244,9 @@ async function renderPlugins() {
}
markPrewarmReminder("mcp_batch_installed");
router();
} catch (err) {
installStatus.textContent = `[json] failed: ${String((err && err.message) || err || "install_failed")}`;
}
},
});
const cliInstallModal = el("div", { class: "session-monitor-modal", style: "display:none;" });