'use client'; import { useEffect, useState } from 'react'; import { cn } from '@/lib/cn'; interface Probe { name: string; url: string; description: string; } const PROBES: Probe[] = [ { name: 'Dashboard', url: '/login', description: 'Web frontend (Next.js)', }, { name: 'Control plane API', url: '/api/health', description: 'Fastify control plane via /api proxy', }, ]; type State = 'pending' | 'ok' | 'down'; interface Result { state: State; latencyMs: number | null; detail: string | null; } export default function Status() { const [results, setResults] = useState>(() => Object.fromEntries(PROBES.map((p) => [p.name, { state: 'pending', latencyMs: null, detail: null }])), ); useEffect(() => { let cancelled = false; async function probe() { const next: Record = {}; for (const p of PROBES) { const start = performance.now(); try { const res = await fetch(p.url, { cache: 'no-store' }); const latency = Math.round(performance.now() - start); next[p.name] = { state: res.ok ? 'ok' : 'down', latencyMs: latency, detail: res.ok ? `HTTP ${res.status}` : `HTTP ${res.status}`, }; } catch (e) { next[p.name] = { state: 'down', latencyMs: null, detail: (e as Error).message, }; } } if (!cancelled) setResults(next); } probe(); const interval = setInterval(probe, 10_000); return () => { cancelled = true; clearInterval(interval); }; }, []); const anyDown = Object.values(results).some((r) => r.state === 'down'); const allPending = Object.values(results).every((r) => r.state === 'pending'); return (
System status

{allPending ? 'Checking…' : anyDown ? 'Partial outage' : 'All systems operational'}

Live health probes against each service. Refreshes every 10 seconds.

{PROBES.map((p) => { const r = results[p.name]!; return (
{p.name}
{p.description}
{r.latencyMs !== null && ( {r.latencyMs}ms )} {stateLabel(r.state)}
); })}

Production status board: BetterStack-hosted at status.buildmymcpserver.com (set up post-launch).

); } function Dot({ state }: { state: State }) { const color = state === 'ok' ? 'bg-emerald-400' : state === 'down' ? 'bg-red-400' : 'bg-zinc-400'; return ( ); } function stateLabel(state: State): string { if (state === 'ok') return 'Operational'; if (state === 'down') return 'Down'; return 'Checking'; } function stateClass(state: State): string { if (state === 'ok') return 'text-emerald-300'; if (state === 'down') return 'text-red-300'; return 'text-[--color-fg-subtle]'; }