hyrule-mcp is the live diagnostic substrate for Hyrule Networks (AS215932).
It exposes narrow, bounded Model Context Protocol tools for monitoring, routing,
host, firewall, and packet-path inspection.
- Runs as either the legacy stdio server or a supervised local daemon on
noc. - The daemon serves MCP over loopback streamable HTTP and exposes
/health. - Host-targeted tools short-circuit to local subprocess execution when the target resolves to the MCP host itself.
- Remote host work uses the configured noc MCP SSH key and host resolver.
The intended production daemon mode is:
HYRULE_MCP_TRANSPORT=http \
HYRULE_MCP_BIND=127.0.0.1 \
HYRULE_MCP_PORT=8765 \
python mcp_server.pyNOC Agent then connects to http://127.0.0.1:8765/mcp.
The server follows three layers:
- Specialized read tools first.
- Purpose-built diagnostic helpers for correlation-heavy checks.
- Raw SSH only as a bounded escape hatch.
Command-style returns preserve:
stdoutstderrexit_codeduration_mstransportdata.commanddata.argvdata.resolved_target
data.resolved_target reports the resolved target name, address, username, and
whether an SSH key is configured; it does not include private key paths.
- Monitoring:
prometheus_queryprometheus_list_targetsicinga_get_host_state
- Routing and path:
frr_vtysh_cmdpath_explainecmp_path_selectmulti_source_probe
- Packet and firewall:
tcpdump_capturepf_log_tailnft_log_tailfirewall_statendp_statearp_state
- Host/service:
os_systemd_statusos_journalctldmesg_tailservice_restart_historyvault_agent_status
- DNS/WireGuard:
dns_digdns_probe_burstknot_zone_statuswg_show
Write-oriented tools remain shadow-mode gated.
Potentially heavy diagnostics are constrained server-side:
- packet capture duration, count, and snaplen are capped
- DNS bursts have count and interval bounds
- multi-source probes cap fan-out
- ECMP probes cap flow count
- raw SSH output is truncated
- raw SSH rejects mutative command patterns
These limits are configurable through HYRULE_MCP_* environment variables and
default conservatively.
Icinga state queries are API-first. The server talks to the REST API using:
ICINGA_API_BASEICINGA_API_USERICINGA_API_PASSWORDICINGA_VERIFY_TLS
This replaces the prior shell-based icinga2 object list dependency.
See TESTING.md.
export HYRULE_MCP_TRANSPORT=http
export HYRULE_MCP_BIND=127.0.0.1
export HYRULE_MCP_PORT=8765
python mcp_server.pycurl http://127.0.0.1:8765/healthNOC Agent connects to http://127.0.0.1:8765/mcp.
| Family | Examples |
|---|---|
| Monitoring | prometheus_query, icinga_get_host_state |
| Routing | frr_vtysh_cmd, path_explain, ecmp_path_select |
| Firewall & packets | firewall_state, tcpdump_capture, ndp_state |
| Host & services | os_systemd_status, os_journalctl, vault_agent_status |
| DNS & WireGuard | dns_dig, knot_zone_status, wg_show |
A human-gated, deliberately inert prepare/confirm/rollback state machine for
NOC remediation. In mode="noop" it never restarts a service or touches
FRR/PF/nftables/WireGuard — only guard JSON files under the guard directory.
Real execution stays behind the separate HYRULE_MCP_ENABLE_ACTIONS flag.
Tools (exposed only when HYRULE_MCP_ENABLE_NOOP_GUARDS=1):
prepare_commit_confirm— create a pending guard for a signed proposalconfirm_change— confirm a pending guardrollback_change— roll back a pending guardget_pending_rollback_guards— read-only list of pending guards
Every mutating call requires a signed authorization with
action_class="noop_rollback_guard" (same HMAC scheme as the action tools,
validated by validate_signed_authorization). operator, action_id, and the
proposal (case_id) are taken from the signed payload. Settings:
HYRULE_MCP_ENABLE_NOOP_GUARDS=0
HYRULE_MCP_ROLLBACK_GUARD_DIR=/var/lib/hyrule-mcp/rollback
HYRULE_MCP_ROLLBACK_GUARD_DEFAULT_TTL_S=300
Guard statuses: pending → confirmed | rolled_back | expired (a guard
past its TTL is marked expired and excluded from the pending list).
- Diagnostic tools are read-biased; write tools are shadow-mode gated.
- Resource-heavy operations (packet captures, DNS bursts, SSH fan-out) are capped server-side.
- Raw SSH is a bounded escape hatch and rejects mutative command patterns.
- No-op rollback guards (
HYRULE_MCP_ENABLE_NOOP_GUARDS) never mutate a service; signednoop_rollback_guardauthorization required.
network-operations— AS215932 infrastructure record and runbooksnoc-agent— Incident investigation agent that consumes this MCP serverengineering-loop— Autonomous change loop for the wider infrastructure