status_dashboard
Monitor quantum-inspired secret manager health with live status, decay timers, entanglement graphs, and anomaly alerts through a local web dashboard.
Instructions
Launch the quantum status dashboard — a local web page showing live health, decay timers, superposition states, entanglement graph, tunnels, audit log, and anomaly alerts. Returns the URL to open in a browser.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | Port to serve on |
Implementation Reference
- src/core/dashboard.ts:122-197 (handler)Main server logic for the status dashboard, which manages connections, data collection via snapshots, and event streaming.
export function startDashboardServer( options: DashboardServerOptions = {}, ): { port: number; close: () => void; server: Server } { const port = options.port ?? 9876; const clients = new Set<ServerResponse>(); let intervalHandle: ReturnType<typeof setInterval> | null = null; const html = getDashboardHtml(); function broadcast() { const snapshot = collectSnapshot(); const data = `data: ${JSON.stringify(snapshot)}\n\n`; for (const res of clients) { try { res.write(data); } catch { clients.delete(res); } } } const server = createServer((req: IncomingMessage, res: ServerResponse) => { const url = req.url ?? "/"; if (url === "/events") { res.writeHead(200, { "Content-Type": "text/event-stream", "Cache-Control": "no-cache", Connection: "keep-alive", "Access-Control-Allow-Origin": "*", }); // Send initial snapshot immediately const snapshot = collectSnapshot(); res.write(`data: ${JSON.stringify(snapshot)}\n\n`); clients.add(res); req.on("close", () => clients.delete(res)); return; } if (url === "/api/status") { const snapshot = collectSnapshot(); res.writeHead(200, { "Content-Type": "application/json", "Access-Control-Allow-Origin": "*", }); res.end(JSON.stringify(snapshot, null, 2)); return; } // Serve the dashboard HTML res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" }); res.end(html); }); server.listen(port, "127.0.0.1", () => { intervalHandle = setInterval(broadcast, 5000); if (intervalHandle && typeof intervalHandle === "object" && "unref" in intervalHandle) { intervalHandle.unref(); } }); return { port, close: () => { if (intervalHandle) clearInterval(intervalHandle); for (const res of clients) { try { res.end(); } catch { /* noop */ } } clients.clear(); server.close(); }, server, }; } - src/mcp/server.ts:987-1000 (registration)Tool registration for "status_dashboard" in the MCP server setup.
server.tool( "status_dashboard", "Launch the quantum status dashboard — a local web page showing live health, decay timers, superposition states, entanglement graph, tunnels, audit log, and anomaly alerts. Returns the URL to open in a browser.", { port: z.number().optional().default(9876).describe("Port to serve on"), }, async (params) => { if (dashboardInstance) { return text(`Dashboard already running at http://127.0.0.1:${dashboardInstance.port}`); } const { startDashboardServer } = await import("../core/dashboard.js"); dashboardInstance = startDashboardServer({ port: params.port });