Skip to documentation
Advanced Network Utilities · Documentation

Guide & Technical Reference

Complete specification for mcp-adv-netutils: Docker & Linux deployment, Network Studio (/web), all 33 registered MCP tools (including manage_saved_destinations), MCP & CLI terminal formatting, 30-day cron retention, security architecture, and bundled agent skills.

v2.0.0 33 Registered MCP Tools 41.5 MB Unpacked (11.4 MB Compressed)
Getting Started

Docker & Linux Deployment

Single-binary CGO_ENABLED=0 deployment over local --stdio or native Go --http with zero Node.js or supergateway.

The multi-stage build compiles a static CGO_ENABLED=0 pure-Go binary into a single-layer Alpine runtime image measuring 41.5 MB unpacked (11.4 MB compressed). Using RUN --mount=type=bind and setcap cap_net_raw+ep /usr/local/bin/mcp-adv-netutils avoids duplicating the binary across layers while granting raw ICMP/ARP socket privileges to unprivileged USER netutils.

Container & Native Go Quickstart

# Local --stdio mode (zero open ports, zero secrets)
docker run -i --rm ghcr.io/frankxlt/mcp-adv-netutils:latest --stdio
# Static CGO_ENABLED=0 build & HTTP + Cron + /web startup (+ offline tests: go test -race ./...)
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -trimpath -tags netgo -o mcp-adv-netutils .
./mcp-adv-netutils --http --http-addr=:8000 --data-dir=./data --watchlist=./watchlist.yaml

Docker Compose Pattern

Grant NET_RAW for ICMP, path MTU, and ARP probes and mount /data for persistent SQLite storage. On older container kernels (such as Synology DSM 4.4), omit runc exec container healthchecks and monitor GET /healthz externally.

services:
  mcp-netutils:
    image: ghcr.io/frankxlt/mcp-adv-netutils:latest
    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: ["mcp_netutils_data:/data"]
    ports: ["8000:8000"]

Two-Doorway Endpoints & Client Config

EndpointDoorwayAuth & Boundary
/{PATH_SECRET}/mcpRemote Streamable HTTPHigh-entropy secret path + 30m Passphrase Deadbolt
/lan/{LAN_MCP_TOKEN}/mcpLAN Streamable HTTPLAN_MCP_TOKEN + RFC1918 source check + proxy-header reject
/sseLAN Legacy SSEBackward-compatible SSE stream, RFC1918-only & no proxy headers
/webNetwork StudioEmbedded 4-theme browser app with anti-CSRF Origin/Host checks
/healthzLiveness ProbeUnauthenticated JSON readiness check for external monitors
{
  "mcpServers": {
    "netutils-lan": { "url": "http://netutils.example:8000/lan/TOKEN/mcp" },
    "netutils-stdio": { "command": "docker", "args": ["run", "-i", "--rm", "ghcr.io/frankxlt/mcp-adv-netutils:latest", "--stdio"] }
  }
}
Operator Console

Network Studio (/web & ./demo/)

Interactive browser console with Apache ECharts SVG graphs, Saved Destinations, goal-grouped checks, and side-by-side Past Run comparisons.

Open /web from any desktop, tablet, or phone browser—or preview offline sample fixtures in the Live Demo (?demo=1)—across four themes (Pure White, Warm Paper, Dark, Dark Paper) and two display densities (Comfortable / Compact).

Workspace Highlights

  • Interactive KPI Triage Cards: Clickable, keyboard-accessible summary cards display 24h Uptime % (— when no scheduled checks exist yet), Active Problems, Saved Destinations, and Saved History Size, jumping directly to the corresponding section.
  • Pinned Destinations & Above-the-Fold Quick List: Favorite targets appear beside + Add Destination and Scan Pinned at the top of Checks, backed by a compact desktop Saved Destinations list directly beneath Run a Check and the full table below.
  • 4 Goal Category Filters: Filter Check Type cleanly across Path & Ping, Web & DNS, Ports & Host, and Wake with context-aware fields for Port Group, Wake MAC chips, and a direct jump link to full subnet scans in Local Network.
  • Apache ECharts SVG Visualizations (renderer: 'svg'): Renders crisp theme-aware path latency & packet-loss whiskers, HTTP/TLS response timing waterfalls, DNS resolver comparison bars, and 24h / 7d / 30d uptime & response-time timelines.
  • Chart / Table Toggle & Export Copy: Flip any result card or past-run view between Chart and Table modes, and copy formatted Markdown with Copy Summary or tab-separated rows with Copy Data (TSV).
  • Local Network Inventory: Search devices by name, IP, MAC, or vendor, choose a comparison baseline, and filter All, Physical Hardware, Containers & VMs, and Changed vs. Baseline with inline response bars and 1-click Ping, Check Ports, Wake, and Save actions.
  • Schedule & History with Past Run Drawer (<dialog>): Inspect 24h / 7d / 30d timelines, enable automated 5-minute monitoring via + Enable 5-Min Monitoring, or click any row in Past Check Runs to open a native modal drawer with Run Again & Compare.
Reference

All 33 Registered MCP Tools

12 hardened core tools, 6 active L2–L7 probes, 8 multi-probe recipes, 4 cron, destination & archive tools (including manage_saved_destinations), 1 digest renderer, and 2 Deadbolt session controls (33 total registered MCP tools).

Showing 33 of 33 registered MCP tools

1. Hardened Core Tools (12)

ToolLayerCapabilities & Hardening
mac_vendor_lookupL2Embedded 39,800+ IEEE OUI table; classifies physical [UAA] vs virtual [LAA]
pingL3Per-call Echo ID isolation, IPv4/IPv6 TTL control messages, explicit icmp vs tcp_fallback
tracerouteL3Rejects leading - targets, inserts -- delimiter, bounds concurrent hop PTR lookups
tcp_port_scanL4Concurrent TCP connect with single-resolution dial and presets (common, homelab, web, iot)
dns_reverse_batchL7Concurrent reverse PTR resolution capped at 256 validated IPs per call
wol_wakeL2Transmits 102-byte UDP Wake-on-LAN Magic Packet frames (port 7 or 9)
local_dns_queryL7Queries OS local resolvers for A, AAAA, CNAME, MX, NS, PTR, and TXT
remote_dns_queryL7Queries Cloudflare and Google DNS-over-HTTPS (DoH)
resolve_hostnameL7Resolves IPv4, IPv6, or dual-stack host addresses
whois_queryL7Domain registration and registrar metadata lookup via WHOIS
http_pingL7HTTP timing waterfall (dns, conn, tls, ttfb, total)
tls_certificate_checkL7Verifies against x509.SystemCertPool() + wire intermediates; supports Ed25519 keys

2. Active L2–L7 Probes (6)

ToolLayerDescription
arp_neighbor_sweepL2OS/ARP neighbor discovery (mdlayher/arp) enriched with OUI vendors and UAA/LAA flags
mtu_path_probeL3Sends DF-bit probes across 1500, 1492, 1420, and 1280 bytes to detect path fragmentation black holes
mtr_path_qualityL3Multi-cycle per-hop loss, min/avg/max RTT, and jitter matrix across the path
mdns_ssdp_discoverL7Bounded mDNS (hashicorp/mdns) and SSDP/UPnP local service discovery
split_dns_auditL7Audits record parity and TTL drift between internal resolvers and external DoH
snmp_switch_portL2Read-only SNMP (gosnmp) switch port, VLAN, LLDP, and MAC FDB correlation

3. Multi-Probe Recipes (8)

RecipeScopeWhat It Coordinates
recipe_diff_pingL2–L4Parallel 4-stage ladder (NIC → Gateway → WireGuard/WAN → Canary) + ARP + TCP RST/SYN-ACK
recipe_diff_dnsL7Local resolver vs external DoH comparison to isolate split-horizon overrides
recipe_diff_httpL7Direct backend vs external reverse-proxy latency waterfall and status diff
recipe_diff_snapshotL2/L3Compares live LAN inventory to baseline snapshot showing [+], [-], and [~] deltas
recipe_host_cardL2–L7Single-host summary combining DNS, ICMP/TCP reachability, open ports, TLS, and OUI vendor
recipe_lan_radarL2/L3/L7ARP sweep + embedded OUI + batch PTR + mDNS/SSDP + SNMP grouped by UAA vs LAA
recipe_path_autopsyL3Consolidated hop loss/jitter matrix, route trace, and DF-bit path MTU ceiling
recipe_wake_verifyL2–L4Sends Magic Packet to a UAA MAC and polls ARP/ICMP/TCP until online

4. Saved Destinations, Cron, Digest & Deadbolt Controls (7)

ToolCategoryBehavior
manage_saved_destinationsDestinationslist | save | delete | run persisted targets with TargetGuard validation and automatic dest_<id> cron watchlist synchronization
get_cron_statusCron / ArchiveSub-5ms 24h, 7d, and 30d health strips and active consecutive-failure alert counts
manage_cron_watchlistCron / ArchiveInspects, adds, updates, pauses, resumes, runs, or removes watchlist.yaml entries
get_job_reportCron / ArchiveRe-pulls any persisted job_id diagnostic run within its 30d expires_at window
render_run_digestDigest RendererConsolidates and re-renders stored job_id runs into default, quick, rich, or json
unlock_netutilsDeadboltVoice-normalizes passphrase and opens 30-minute Deadbolt window via SHA-256
lock_netutilsDeadboltImmediately closes the Deadbolt window before the 30-minute timer expires
Reference

MCP & CLI Terminal Output

Three-Tier ASCII formatting (default, quick, rich) and compact json scoped strictly to MCP clients and CLI terminals—while /web renders Apache ECharts SVG graphs and structured tables.

Browser operators in Network Studio (/web) inspect interactive Apache ECharts graphs, sortable tables, and Markdown/TSV exports. For conversational MCP clients and terminal runs (including --run-watchlist-once), pass the style parameter to match the caller viewport:

styleWidth / CapFormatting ContractBest Target Client
default72 cols exactSingle-line header split, severity-sorted rows, and footer job_idChat panes, IDE terminals, 900px tablets
quick≤ 40 colsBorderless compact lines with zero mid-row wrappingFolded 390px phones and mobile chat
rich76 cols boxedDouble-line TUI frame, sparklines, 30d health bar, and status legend1440px+ desktops and CLI postmortems
json< 18.5 KBFAIL → WARN → OK sorted rows; compacts OK rows first if cappedAutomated MCP/CI pipelines and /web API
Verbatim Display Rule: When displaying MCP terminal cards in chat, wrap default, quick, and rich output verbatim inside a fenced text code block so markdown engines never reflow fixed columns.

To inspect an older incident at a different width over MCP without re-sending packets, call render_run_digest with the archived job_id and desired style.

Operations & Security

Cron Watchlist & 30d Retention

Scheduled background checks escalating after two consecutive failures, backed by bounded 30-day SQLite WAL storage.

mcp-adv-netutils embeds robfig/cron/v3 (with SkipIfStillRunning overlap protection) to execute watchlist.yaml and synced dest_<id> Saved Destination schedules in --http mode, or once on demand via --run-watchlist-once for external systemd timers.

  • Two-Failure Alert Threshold: A single non-OK check records a soft pending state without firing an alert; status escalates only after >= 2 consecutive failed checks.
  • 30-Day Job Archive (netutils_jobs.db): Pure-Go SQLite WAL storage (modernc.org/sqlite, read queries via ?mode=ro) persists every manual, MCP, Saved Destination, and scheduled check with explicit expires_at timestamps.
  • Bounded Storage Retention: Granular healthy */5m ticks compact across 7d → 30d while failures keep full diagnostic payloads; an hourly TTL reaper runs PRAGMA incremental_vacuum and enforces --max-store-mb 256.

Default watchlist.yaml Structure

jobs:
  - id: wan-canary-ping
    schedule: "*/5 * * * *"
    tool: recipe_diff_ping
    target: "1.1.1.1"
    enabled: true
  - id: wg-mtu-check
    schedule: "*/15 * * * *"
    tool: mtu_path_probe
    target: "1.1.1.1"
    enabled: true
  - id: split-dns-diff
    schedule: "0 */6 * * *"
    tool: recipe_diff_dns
    target: "example.com"
    enabled: true
  - id: edge-http-diff
    schedule: "0 */6 * * *"
    tool: recipe_diff_http
    target: "https://example.com"
    enabled: true
Operations & Security

Security Architecture

Five fail-closed defense layers isolating remote doorways, LAN-only sockets, browser APIs, target CIDRs, and container privileges.

LayerControlMechanism
Layer 130-Minute PASS_HASH DeadboltSHA-256 + voice normalization + crypto/subtle.ConstantTimeCompare; 30m auto-relock and immediate lock_netutils
Layer 2Two-Doorway SetupRemote /{PATH_SECRET}/mcp + /web vs LAN /lan/{LAN_MCP_TOKEN}/mcp & /sse rejecting forwarding headers and non-RFC1918 peers
Layer 3/web/api/* Anti-CSRF & RebindingStrict same-origin Origin checks and allowlisted Host header validation
Layer 4Central TargetGuard & CLI --DNS-resolved CIDR checks (--allow-cidrs / --deny-cidrs), mandatory 169.254.0.0/16 block, no-shell -- separation
Layer 5Unprivileged RuntimeUSER netutils, minimal cap_net_raw+ep binary capability, runtime-only secret env vars
Metadata & Secret Hygiene: Cloud instance metadata space 169.254.0.0/16 is unconditionally blocked regardless of allowlist flags, and PASS_HASH stores only a 64-character hex SHA-256 digest—never a plaintext passphrase.
Operations & Security

5 Bundled Agent Skills (skills/)

Ready-to-load SKILL.md playbooks in skills/ aligning AI assistants with all 33 MCP tools.

SkillCore Tools CoveredOperational Focus
netutils-ascii-displaystyle, render_run_digestPicks quick/default/rich/json widths and enforces verbatim fenced terminal output
netutils-differential-pingrecipe_diff_ping, mtu_path_probe, mtr_path_quality4-stage fault isolation, icmp vs tcp_fallback interpretation, PMTUD black holes
netutils-lan-radarrecipe_lan_radar, recipe_diff_snapshot, recipe_wake_verifyPhysical [UAA] vs virtual [LAA] grouping, baseline diffs, & WOL verification
netutils-split-horizon-webrecipe_diff_dns, recipe_diff_http, unlock_netutilsInternal vs DoH parity, HTTP waterfall bottlenecks, TLS chains, and Deadbolt usage
netutils-cron-monitorget_cron_status, manage_cron_watchlist, manage_saved_destinations, get_job_report24h/7d/30d strips, dest_<id> sync, two-failure alerting, & 7d → 30d compaction