
mcp-adv-netutils
io.github.FrankXLT/mcp-adv-netutils
Pure-Go L2-L7 network diagnostics, triage recipes, 30-day cron monitor, and Operator Studio.
Documentation
Advanced Network Utilities (mcp-adv-netutils) v2.0.0
Advanced Network Utilities (mcp-adv-netutils) is a pure-Go (CGO_ENABLED=0) Model Context Protocol (MCP) server, scheduled cron monitor, and embedded 4-theme Operator Studio (/web) engineered for Layer 1–Layer 7 diagnostics across home labs, multi-VLAN infrastructure, and container hosts.
Interactive Showcase & Guides: Visit projects.oaworkbench.org/mcp-adv-netutils/ for the live zero-backend
?demo=1Operator Studio (./demo/) and searchable plain-language guides (./docs/), or read docs/WORKFLOWS.md for the completeWF-01..WF-08behavioral baseline.
What's New in v2.0.0
- Zero Node.js / Zero
supergatewayRuntime: Ships as a single staticCGO_ENABLED=0Go binary inside a single-layer Alpine container (~41.5 MBunpacked /~11.4 MBcompressed,USER netutils,setcap cap_net_raw+epviaRUN --mount=type=bind), serving native--stdio, Streamable HTTP, backward-compatible/sse,/web, and/healthz. - 33 Registered MCP Tools: Combines 12 hardened core tools, 6 active L2–L7 probes, 8 coordinated Diagnostic Recipes (
recipe_*),render_run_digest, 4 Cron, Saved Destinations & Archive tools (addingmanage_saved_destinations), andunlock_netutils/lock_netutils. - Three-Tier ASCII Styles (
style): Deterministic monospace cards across every tool and recipe—default(72columns exact),quick(<= 40columns borderless for390pxmobile),rich(76columns boxed TUI), andjson(< 18.5 KBwire cap withFAIL/WARNsorted first). - 30-Day SQLite Job Archive, Saved Destinations & Two-Tick Cron Watchlist: Pure-Go
robfig/cron/v3scheduler runningwatchlist.yamlplusdest_<id>Saved Destination monitors into WAL SQLite (netutils_jobs.dbviamodernc.org/sqlite), featuring Two-Tick Alert Hysteresis (>= 2consecutive non-OK ticks),7d -> 30dhealthy tick down-aging, hourly TTL reaping +PRAGMA incremental_vacuum, and--max-store-mb 256cap. - Thirty-Minute Passphrase Deadbolt & Two-Doorway Setup: Voice-normalized SHA-256 lock (
PASS_HASH+crypto/subtle.ConstantTimeCompare) paired with a remote/{PATH_SECRET}/mcp+/webdoorway, a LAN-only/lan/{LAN_MCP_TOKEN}/mcp+/ssedoorway, and central CIDR target guard blocking169.254.0.0/16. - Embedded 4-Theme Network Studio (
/web): Responsive Quiet UI (//go:embed) acrossPure White,Warm Paper,Dark, andDark Paperthemes featuring Apache ECharts SVG visualizations, Pinned Destinations & Scan Pinned, goal-grouped checks, Chart/Table toggle, Summary/TSV export, Saved Destinations manager, and Past Run Drawer (Run Again & Compare), plus?demo=1preview mode. - 5 Bundled Agent Skills (
skills/): Ready-to-useSKILL.mdplaybooks guiding LLM formatting, differential ping interpretation, LAN radar sweeps, split-horizon triage, and cron/destination monitoring.
MCP Tool Suite
mcp-adv-netutils v2.0.0 provides 30 core diagnostic, recipe, destination, and archive tools (12 hardened core + 6 active L2–L7 + 8 Diagnostic Recipes + 4 Cron, Destinations & Archive), plus render_run_digest and the unlock_netutils / lock_netutils Deadbolt controls (33 total registered MCP tools).
1. Hardened Core Tools (12)
| Tool | Layer | Capabilities & v2.0.0 Hardening |
|---|---|---|
mac_vendor_lookup | L2 | Embedded 39,800+ IEEE OUI lookup; separates physical [UAA] from Docker/VM [LAA] (02:42:...) |
ping | L3 | Per-call Echo ID/sequence isolation, IPv4/IPv6 TTL control messages, explicit probe_mode (icmp vs tcp_fallback) |
traceroute | L3 | Rejects leading - targets, enforces "--", bounds concurrent hop PTR lookups |
tcp_port_scan | L4 | Concurrent TCP connect scan with named presets (common, homelab, web, iot; default common) |
dns_reverse_batch | L7 | Concurrent reverse PTR resolution capped at 256 validated IPs per call |
wol_wake | L2 | Sends standard 102-byte UDP Wake-on-LAN Magic Packet frames (port 7 or 9) |
local_dns_query | L7 | Queries OS-configured local resolvers (A, AAAA, CNAME, MX, NS, PTR, TXT, etc.) |
remote_dns_query | L7 | Queries Cloudflare and Google DNS-over-HTTPS (DoH) |
resolve_hostname | L7 | Resolves IPv4, IPv6, or dual-stack host addresses |
whois_query | L7 | Domain registration metadata lookup via WHOIS |
http_ping | L7 | HTTP timing waterfall (dns, conn, tls, ttfb, total) |
tls_certificate_check | L7 | Verifies against x509.SystemCertPool() + wire intermediates; supports Ed25519 keys |
2. Active L2–L7 Diagnostic Probes (6)
| Tool | Layer | Description |
|---|---|---|
arp_neighbor_sweep | L2 | OS/ARP neighbor discovery (mdlayher/arp) enriched with OUI vendors and UAA/LAA flags |
mtu_path_probe | L3 | Probes 1500 / 1492 / 1420 / 1280 DF frames to catch tunnel and WAN fragmentation black holes |
mtr_path_quality | L3 | Multi-cycle per-hop loss, min/avg/max RTT, and jitter path quality matrix |
mdns_ssdp_discover | L7 | Bounded mDNS (hashicorp/mdns) and SSDP local service discovery |
split_dns_audit | L7 | Side-by-side comparison of internal local DNS vs. external DoH answers |
snmp_switch_port | L2 | Read-only SNMP (gosnmp) switch port, VLAN, and MAC FDB correlation |
3. Diagnostic Recipes, Digest, Cron, Destinations & Deadbolt Tools
| Category | Tools | Purpose |
|---|---|---|
| Diagnostic Recipes (8) | recipe_diff_ping, recipe_diff_dns, recipe_diff_http, recipe_diff_snapshot, recipe_host_card, recipe_lan_radar, recipe_path_autopsy, recipe_wake_verify | Coordinated multi-probe differential ladders, UAA/LAA LAN sweeps, before/after snapshot diffs ([+], [-], [~]), and WOL verification |
| Digest Renderer (1) | render_run_digest | Re-renders any persisted job_id report on demand into default, quick, rich, or json |
| Cron, Destinations & Archive (4) | get_cron_status, manage_cron_watchlist, manage_saved_destinations, get_job_report | < 5ms 24h/7d/30d ASCII health strips, watchlist.yaml management, list/save/delete/run saved targets (TargetGuard + dest_<id> cron sync), and 30-day job_id re-pulls with expires_at |
| Deadbolt Session (2) | unlock_netutils, lock_netutils | Voice-normalized SHA-256 unlock (30m sliding TTL) and immediate manual relock |
Three-Tier ASCII Styles & Output Budgets
Every tool, Diagnostic Recipe, and cron summary supports a style parameter designed for clean monospace rendering across mobile phones, IDE panes, and CI automation:
style | Width / Budget | Best For |
|---|---|---|
default (default) | 72 columns exact | Chat apps, IDE terminals, and unfolded tablets (900px) |
quick | <= 40 columns, borderless | Folded phones (390px) with zero line wrapping |
rich | 76 columns, boxed TUI | Desktop (1440px+) hop ladders, histograms, and status badges |
json | < 18.5 KB wire cap | Programmatic diffing with FAIL and WARN rows sorted first |
Cron Watchlist, Saved Destinations & 30-Day Job Archive
Scheduled jobs in watchlist.yaml and monitored Saved Destinations (dest_<id>) run automatically in-process via robfig/cron/v3 (SkipIfStillRunning) or as a one-shot external timer (--run-watchlist-once):
- Default Watchlist Cadence:
*/5mcanaryrecipe_diff_ping,*/15mmtu_path_probe,*/6hrecipe_diff_dnsandrecipe_diff_http, plus nightlytls_certificate_checkandrecipe_diff_snapshot. - Saved Destinations (
manage_saved_destinations): Stores friendly targets (category, optional Wake MAC, default check, pinned toggle, and 5-minute monitor toggle) in SQLite (saved_destinations), validates targets viaTargetGuard, supportslist|save|delete|run, and syncsdest_<id>checks with the cron watchlist. - Two-Tick Alert Hysteresis: Alerts flip only after
>= 2consecutive non-OK ticks, preventing single-packet jitter from triggering false alarms. - 30-Day WAL SQLite Archive (
netutils_jobs.db): Pure-Gomodernc.org/sqlite(?mode=roreaders) retains every manual, MCP, and incident report for30d(get_job_report), down-ages healthy*/5mticks across7d -> 30d, and runs an hourly TTL reaper withPRAGMA incremental_vacuumbounded by--max-store-mb 256.
5-Layer Security & Two-Doorway Setup
See SECURITY.md for full details on the 5-layer defense-in-depth architecture:
- Thirty-Minute Passphrase Deadbolt (
PASS_HASH): Voice-normalized SHA-256 verification viacrypto/subtle.ConstantTimeComparewith automatic30mrelock (and optional redacted aggregate cron summaries while locked). - Two-Doorway Setup:
- Remote Doorway (
/{PATH_SECRET}/mcp+/web): High-entropy path secret + Deadbolt protection for mobile/remote clients. - LAN-Only Doorway (
/lan/{LAN_MCP_TOKEN}/mcp+/sse): RejectsX-Forwarded-For/X-Real-IP/Forwardedproxy headers and non-RFC1918 source IPs.
- Remote Doorway (
/web/api/*Anti-CSRF & Anti-DNS-Rebinding: StrictOriginandHostheader validation.- Central Target Guard & CLI
--Prevention: Enforces--allow-cidrs/--deny-cidrson DNS-resolved IPs, unconditionally blocks169.254.0.0/16metadata endpoints, and blocks leading-target injection. - Unprivileged Container: Runs as
USER netutilswith minimalcap_net_raw+epcapability—noroot, noPrivileged: true.
Embedded Operator Studio (/web)
Compiled directly into the Go binary (//go:embed), /web provides a 4-theme Quiet UI Network Studio (Pure White, Warm Paper, Dark, Dark Paper) with Comfortable (d2) and Compact (d3) density:
- Pre-Unlock Gate: Clean passphrase challenge when
PASS_HASHis locked, with a 1-tap link to depersonalized?demo=1preview fixtures. - Apache ECharts SVG Visualizations & Export: Theme-aware Apache ECharts SVG charts for path latency whiskers, HTTP timing waterfalls, DNS comparisons, and
24h/7d/30duptime timelines, paired with a Chart / Table toggle and Copy Summary / Copy Data (TSV) export. - Pinned Destinations & Goal-Grouped Checks: 1-click Pinned Destinations bar + Scan Pinned sweep, goal-grouped check selector (
Connectivity,Web & TLS,DNS,Local Network), and a full Saved Destinations manager (add,edit,pin,monitor,delete). - Three Integrated Tabs & Past Run Drawer:
Checks,Local Network(Physical Hardware vs. Containers & VMs withPing/Ports/Wake/Saveactions and baseline diffs), andSchedule & History(24h/7d/30dhealth timeline + 30-day Past Check Runs opening the Past Run Drawer with Run Again & Compare). - Responsive Breakpoints:
>= 40pxtouch targets and>= 16pxinputs with0pxhorizontal overflow at390px(phone), 2-pane workspace at900px(tablet), and full Studio workspace at1440px+(desktop).
Bundled Agent Skills (skills/)
Five ready-to-use SKILL.md guides ship inside skills/:
skills/netutils-ascii-display— Deterministicdefault/quick/rich/jsonformatting andrender_run_digest.skills/netutils-differential-ping—recipe_diff_ping,recipe_path_autopsy,mtu_path_probe,mtr_path_quality, andicmpvs.tcp_fallbacktriage.skills/netutils-lan-radar—recipe_lan_radar, ARP/mDNS/SSDP/PTR/SNMP correlation, UAA vs. LAA grouping,recipe_diff_snapshot, andrecipe_wake_verify.skills/netutils-split-horizon-web—recipe_diff_dns,split_dns_audit,recipe_diff_http,recipe_host_card, Deadbolt, and Apache ECharts/webStudio.skills/netutils-cron-monitor—get_cron_status,manage_cron_watchlist,manage_saved_destinations,get_job_report, Two-Tick Alert Hysteresis, and7d -> 30ddown-aging.
Deployment & Setup
Docker Compose (Synology / Linux Docker host / Portainer GitOps Pattern)
Deploy the single-layer Alpine pure-Go image (~41.5 MB unpacked / ~11.4 MB compressed, cap_net_raw+ep via RUN --mount=type=bind) with persistent 30-day SQLite storage, NET_RAW for ICMP/ARP probes, and native HTTP flags (zero supergateway, and no runc exec container healthchecks on Synology DSM Kernel 4.4—use external GET /healthz checks instead):
services:
mcp-netutils:
image: ghcr.io/frankxlt/mcp-adv-netutils:latest
container_name: mcp-netutils
restart: unless-stopped
init: true
cap_add:
- NET_RAW
environment:
- PASS_HASH=${PASS_HASH}
- PATH_SECRET=${PATH_SECRET}
- LAN_MCP_TOKEN=${LAN_MCP_TOKEN}
command:
- --http
- --http-addr=:8000
- --data-dir=/data
- --max-store-mb=256
- --watchlist=/app/watchlist.yaml
volumes:
- ./data:/data
ports:
- "8000:8000"
# On Synology DSM Kernel 4.4, omit container exec healthchecks and monitor GET /healthz externally
Docker CLI (--stdio & HTTP Modes)
# Interactive --stdio JSON-RPC mode
docker run -i --rm ghcr.io/frankxlt/mcp-adv-netutils:latest --stdio
# Native HTTP mode with persistent SQLite store and /web Studio
docker run -d \
--name mcp-adv-netutils \
--cap-add NET_RAW \
-p 8000:8000 \
-v mcp_netutils_data:/data \
-e PASS_HASH="<sha256-hex>" \
-e PATH_SECRET="<high-entropy-secret>" \
-e LAN_MCP_TOKEN="<lan-token>" \
ghcr.io/frankxlt/mcp-adv-netutils:latest \
--http --http-addr=:8000 --data-dir=/data
MCP Client Configuration
{
"mcpServers": {
"netutils-lan": {
"url": "http://netutils.example.internal:8000/sse"
},
"netutils-stdio": {
"command": "docker",
"args": ["run", "-i", "--rm", "ghcr.io/frankxlt/mcp-adv-netutils:latest", "--stdio"]
}
}
}
Building from Source & Testing
git clone https://github.com/FrankXLT/mcp-adv-netutils.git
cd mcp-adv-netutils
# Build static pure-Go binary (CGO_ENABLED=0)
CGO_ENABLED=0 go build -ldflags="-s -w" -o mcp-adv-netutils .
# Run offline race-enabled unit tests
go test -race ./...
# Single-shot watchlist execution (for external systemd timers)
./mcp-adv-netutils --run-watchlist-once --watchlist=./watchlist.yaml --data-dir=./data
Documentation & Roadmap
- docs/WORKFLOWS.md — Common Terms Glossary and bound workflows (
WF-01..WF-08) across390px,900px, and1440px. - SECURITY.md — 5-Layer Security Architecture, Passphrase Deadbolt, and CIDR Target Guard.
- ROADMAP.md — Next milestone (Wave 4): Deadbolt-gated on-demand BPF
SPAN/ERSPANcapture -> pure-Goparquet-go(72hraw TTL +30dSQLite summary retention).
Attribution & License
Originally forked from patrickdappollonio/mcp-netutils and expanded into Advanced Network Utilities (FrankXLT/mcp-adv-netutils) with pure-Go single-binary transport, active L2–L7 diagnostics, Diagnostic Recipes, 30-day SQLite cron monitoring, and the embedded 4-theme Operator Studio.
Licensed under the MIT License — see LICENSE.
ghcr.io/frankxlt/mcp-adv-netutils:2.0.0docker pull ghcr.io/frankxlt/mcp-adv-netutils:2.0.0:undefined