Mcp Watchdog
Opencode plugin: auto-check and reconnect failed MCP servers, with TUI toast status
0
836
24 in 7 days
38.0
Multi-signal model
5 days ago
2026-09-30
Install and configure
opencode.jsonWrites to this project's opencode.json — applies to this repository only.
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@mrcarb0n/opencode-mcp-watchdog@1.1.0"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@mrcarb0n/opencode-mcp-watchdog@1.1.0"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D @mrcarb0n/opencode-mcp-watchdogOpenCode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
Opencode plugin: on every startup it checks all configured MCP servers via opencode's own API, reconnects the failed ones, and shows a TUI toast summary. No sidecar processes — opencode core keeps owning MCP lifecycles.
Install
Via config (npm):
{ "plugin": ["@mrcarb0n/opencode-mcp-watchdog"] }
Restart opencode — Bun installs it automatically. ~8s after launch, if anything needs attention you get a toast like:
MCP watchdog (startup)
14/15 connected · failed: github (spawn npx ENOENT…) · disabled: git
All-green startups stay quiet. Reconnects run sequentially (parallel
npx spawns thundering-herd the registry into probe timeouts). If the
status probe itself times out, the toast says showing last-known
instead of presenting stale data as fresh. Unknown states are listed
under other: name (status).
Local alternative (build first, then copy the bundle):
npm run build
cp dist/index.js ~/.config/opencode/plugins/mcp-watchdog.js
Tool
mcp_watchdog with one arg:
status— list every server with state (✓ connected,✗ failed,○ disabled,⚠ needs_auth)reconnect— reconnect failed servers now (always runs, bypasses the cooldown), report what recovered plus the reason for each still-failing server
Triggers
| Trigger | Behavior |
|---|---|
| Startup (+8s) | check + heal, toasts only if something recovered/failed |
server.connected |
check + heal + toast (15s cooldown from run end; concurrent triggers share one run) |
session.error |
silent heal, toasts only if something recovered/failed |
Servers reporting needs_auth / needs_client_registration are listed, never
retried. Outside the TUI (serve/web/headless) the summary is logged
(mcp-watchdog service, info level) instead of toasted and the
tool keeps working.
Development
Requires Node.js 18+.
npm install # install dependencies
npm run build # compile src/ to dist/
npm test # build + run test suite
npm run check # typecheck without emitting
npm run lint # eslint
npm run format # prettier check
Push single commits to main with
conventional commit messages —
release-please accumulates them into a release PR, and merging it publishes
the next version automatically.
Similar plugins
Browser
opencode-browser
OpenCode plugin that integrates Browser MCP for browser automation
Qoder Bridge
opencode-qoder-bridge
Qoder provider plugin for OpenCode powered by the official Qoder Agent SDK, with streaming, tools, MCP, sessions, multimodal input, and quota tracking.
Navigator
opencode-navigator
Search, navigate, and manage OpenCode sessions from the TUI