Skip to content
    ↑↓ select↵ openesc close
    MrCarb0n

    Mcp Watchdog

    @mrcarb0n/opencode-mcp-watchdog·v1.1.0·MCP Integrations

    Opencode plugin: auto-check and reconnect failed MCP servers, with TUI toast status

    GitHub stars

    0

    Monthly installs

    836

    24 in 7 days

    Composite score

    38.0

    Multi-signal model

    Last commit

    5 days ago

    2026-09-30

    Install and configure

    opencode.json

    Writes 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"]
    }

    OpenCode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.

    npm version

    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