Read-only is the default and a sensible place to stay for a while: leases, logs, state tables, VPN status and the security audit all work without enabling anything. With writes on, firewall changes use OPNsense's own savepoint mechanism and revert after 60 seconds unless confirmed — and the project states plainly that OPNsense 26.7 removed that API upstream, so on those versions changes apply immediately with no automatic rollback. The genuinely dangerous endpoints are blocked in the client rather than left to good behaviour.
A Python server over the OPNsense API with 81 tools spanning system, firewall, network, DNS, DHCP, VPN, HAProxy, services, diagnostics and security. Writes are disabled unless enabled explicitly, and where OPNsense still offers the savepoint API, firewall changes go in behind its 60-second auto-revert.
- Firewall rules and aliases listed, added, updated, deleted and toggled, with NAT port-forward rules and rule categories beside them, and opn_confirm_changes cancelling the auto-rollback once the change looks right
- opn_firewall_log returns recent blocked and passed packets and opn_pf_states queries the live packet-filter state table
- Unbound DNS: host overrides added, updated and deleted with an immediate apply, forward zones listed, resolver statistics read, and DNSBL blocklists configured with allowlist entries added or removed without overwriting what is already there
- DHCP across all three servers OPNsense can run — ISC leases, Kea leases, and dnsmasq leases and ranges, with ranges created, updated, deleted and the configuration reapplied
- Diagnostics run from the firewall itself: opn_ping, opn_traceroute, opn_dns_lookup, per-interface traffic statistics, the ARP and NDP tables, IPv6 status and static routes
- VPN status for WireGuard tunnels and peers, IPsec IKE and ESP phases, and OpenVPN instances, sessions and routes
- HAProxy managed end to end — search and read any resource, add, update and delete frontends, backends and servers, with opn_haproxy_configtest validating the configuration before it is applied
- opn_security_audit runs a set of checks across the firewall, CrowdSec status and alerts are readable, and opn_download_config takes a config.xml backup with passwords and keys stripped by default
- Dynamic DNS accounts, ACME certificate status, cron jobs, service status, gateway health from dpinger, and mDNS repeater configuration
Python 3.11 or newer, published on PyPI as opnsense-mcp-server and also as the uhlenheide/opnsense-mcp-server container image. OPNsense 24.7 or newer, since it relies on the MVC API — the version is auto-detected to pick the right endpoint naming. OPNSENSE_URL, OPNSENSE_API_KEY and OPNSENSE_API_SECRET come from an API key pair created under System > Access > Users, and the secret cannot be retrieved from OPNsense a second time. Writes require OPNSENSE_ALLOW_WRITES=true. Transport is stdio only with nothing network-exposed, and halt, reboot, poweroff and firmware update are blocked at the API client so they cannot be called at all.
One command plus a key — pip install opnsense-mcp-server, then supply credentials
