Skip to content

Monitor

Pummelchen edited this page Sep 11, 2026 · 6 revisions

Home · Installation · Compatibility · Tools Reference · Architecture · Providers · Configuration · Reliability · Security · Self-Hosting · Monitor · Testing · Troubleshooting · Project Tracker


What it is

mcps-mon is a live terminal dashboard for the deployment: which search providers and which SearXNG nodes are up, how fast they answer, and which are returning errors. It is a separate executable, so watching the system never disturbs the server.

swift run mcps-mon            # node health only — free, no provider credits
swift run mcps-mon --probe    # also measure provider latency and errors
  MCPSearch Monitor  providers and nodes            up 4m12s  cycle 1.2s  refreshed 05:31:08
────────────────────────────────────────────────────────────────────────────────────────────
  PROVIDERS   3 ok · 1 failing · 6 without credentials
    provider        kind       state       last     avg   n   ok%  note
  ● Tavily          index      OK        3241ms  3120ms   5  100%  last ok 05:31:02
  ○ Brave Search    index      NO KEY         –       –   –     –  set BRAVE_SEARCH_API_KEY
  ● DuckDuckGo      scraper    OK        1398ms  1502ms  10  100%  last ok 05:31:02
  ✖ Startpage       scraper    FAIL       917ms       –   0    0%  Startpage is temporarily unavailable.
  ● Parallel Sear…  aggregator OK        2457ms  2390ms  10  100%  last ok 05:31:02

  SEARXNG NODES   5 up · 0 down
    node          state       latency  results   ok  engines
  ● this-mac      UP         1225ms       23 100%  duckduckgo, google cse
  ● node1         UP         2109ms       29 100%  brave, google cse
  ● node2         UP         1661ms       29 100%  brave, google cse
  ● node3         UP         1241ms       29 100%  brave, google cse
  ● node4          UP         752ms       29 100%  brave, google cse
────────────────────────────────────────────────────────────────────────────────────────────
  p probe providers  ·  r refresh now  ·  e toggle engines  ·  c toggle colour  ·  q quit

Choosing what to probe

Command Cost What it measures
mcps-mon free Node reachability, latency, results, and per-engine health
mcps-mon --probe 1 credit per working keyed provider per refresh The above, plus provider latency and errors

Probing providers is opt-in because it issues real searches. With no keyed providers configured it costs nothing at all, since only the free providers are probed.

Options

Flag Purpose
--node <name=url> Add a node (repeatable). Defaults to this machine plus node1–4
--no-nodes Skip node probing entirely
--interval <seconds> Refresh interval, default 10
--probe Also probe providers with a real search
--iterations <n> Stop after n refreshes, for scripts and CI
--no-colour Disable ANSI colour
--no-engines Hide the per-node engine breakdown
--help Usage

Keys: p probe now, r refresh, e toggle engines, c toggle colour, q quit.

How it probes

Nodes are asked for JSON directly (/search?format=json), not through the MCP server. That distinction matters: an instance that is running but has JSON disabled returns HTTP 403, and a monitor that reported that as "down" would send an operator hunting for a network fault. It is shown as DEGRADED with the actual reason.

Providers are called through the same adapters the server uses, one provider at a time rather than through the orchestrator. A fused answer deliberately hides which provider failed; the dashboard exists to show exactly that.

Both are probed concurrently, each with its own short timeout, so one dead provider cannot stall the display. Probe queries rotate through a small set so repeated refreshes do not all hit the same cached page upstream.

Reading it

  • ● healthy, ○ idle or not yet probed, ✖ failing, – not configured.
  • NO KEY means the provider is known but has no credentials; the note names the environment variable to set.
  • Average latency is over successful probes only, so a slow failure cannot skew it.
  • ok% is successes over attempts for this session, not a provider SLA.
  • The warnings line calls out the things worth acting on. An engine failing on most nodes is a provider-level problem, not a node-level one, and is surfaced as such.

Non-interactive use

When stdout is not a terminal, the monitor renders plain frames instead of cursor escapes, so it can be redirected or run in a script:

swift run mcps-mon --iterations 1 --no-colour   # one plain snapshot

Where the code lives

Path Contents
Sources/MCPSMonitor/main.swift CLI parsing and the refresh loop
Sources/WebSearchCore/Monitor/ Terminal primitives, renderer, model, probes
Tests/WebSearchCoreTests/MonitorTests.swift Layout, rendering, metric accumulation
Tests/MCPSMonitorTests/ CLI parsing

The testable parts live in the library rather than the executable, because an executable's symbols cannot be imported by a test target. Layout is a pure function of the model for the same reason: it can be asserted without a terminal.

Clone this wiki locally