opnsense-mcp-server MCP Server

A secure Model Context Protocol (MCP) server for managing OPNsense firewalls through AI assistants like Claude Code, Cursor, and other MCP-compatible tools.

Local serverstdio

What is the opnsense-mcp-server MCP Server?

opnsense-mcp-server is an MCP project maintained in the lucamarien/opnsense-mcp-server repository. The maintainer describes its purpose as “A secure Model Context Protocol (MCP) server for managing OPNsense firewalls through AI assistants like Claude Code, Cursor, and other MCP-compatible tools”. Read the project documentation for the complete scope.

Local setup

The project provides a local client configuration using opnsense-mcp. Follow the repository’s build and installation steps before copying it, and replace example paths with the paths on your own computer.

Configuration values

The example declares OPNSENSE_URL, OPNSENSE_API_KEY, OPNSENSE_API_SECRET, OPNSENSE_VERIFY_SSL, OPNSENSE_ALLOW_WRITES. Secret-looking values have been replaced with placeholders. Required and optional labels are shown only when the documentation states them.

Source

Project documentation · Repository · Discovery listing. This profile records the public documentation checked on 2026-10-08.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
opn_system_statusSystem info including firmware version, product name, and architecture
opn_list_servicesList all services and their running status. Params: search, limit
opn_gateway_statusGateway availability, latency, and dpinger health checks
opn_download_configDownload config.xml backup with optional sensitive data stripping. Params: include_sensitive (default: false — passwords and keys are redacted)
opn_scan_configScan the full configuration, parse it into sections, and collect runtime inventory (firmware, plugins, DHCP, DNS, interfaces, services). Results are cached per
opn_get_config_sectionGet a specific config section as structured JSON. Params: section, include_sensitive
opn_mcp_infoMCP server version, write mode status, detected OPNsense version, API style, and whether firewall writes still get savepoint/rollback protection
opn_interface_statsPer-interface traffic statistics (bytes in/out, packets, errors)
opn_arp_tableARP table showing IP-to-MAC address mappings
opn_ndp_tableNDP (Neighbor Discovery Protocol) table showing IPv6-to-MAC address mappings
opn_ipv6_statusIPv6 configuration and address status for all interfaces (method, live addresses, summary)
opn_list_static_routesConfigured static routes. Params: search, limit
opn_list_firewall_rulesList MVC firewall filter rules. Params: search, limit
opn_list_firewall_aliasesList alias definitions (IP lists, port groups, GeoIP, URLs). Params: search, limit
opn_list_nat_rulesList NAT port forwarding (DNAT) rules. Params: search, limit
opn_list_firewall_categoriesList firewall rule categories and their UUIDs. Params: search, limit
opn_firewall_logRecent firewall log entries with client-side filtering. Params: source_ip, destination_ip, action, interface, limit
opn_confirm_changesConfirm pending changes, cancelling 60-second auto-rollback (OPNsense < 26.7; a no-op returning not_applicable on 26.7+). Params: revision
opn_toggle_firewall_ruleToggle a rule's enabled/disabled state with savepoint (OPNsense < 26.7). Params: uuid
opn_add_firewall_ruleCreate a new filter rule with savepoint (OPNsense < 26.7). Params: action, direction, interface, ip_protocol, protocol, source_net, destination_net…
opn_delete_firewall_ruleDelete a filter rule by UUID with savepoint (OPNsense < 26.7). Params: uuid
opn_add_aliasCreate a new alias. Params: name, alias_type, content, description
opn_add_nat_ruleCreate a NAT port forwarding rule with savepoint (OPNsense < 26.7). Params: destination_port, target_ip, interface, protocol, target_port, description
opn_add_firewall_categoryCreate a new firewall rule category. Params: name, color
opn_delete_firewall_categoryDelete a firewall rule category by UUID with savepoint (OPNsense < 26.7). Params: uuid
opn_set_rule_categoriesAssign categories to a firewall rule with savepoint (OPNsense < 26.7). Params: uuid, categories
opn_add_icmpv6_rulesCreate essential ICMPv6 rules required for IPv6 operation (NDP, RA, ping6) per RFC 4890. Params: interface
opn_update_aliasUpdate an existing alias (name, content, type, description). Read-modify-write. Params: uuid, name, content, description, alias_type, enabled
opn_delete_aliasDelete an alias by UUID. Check rule references first. Params: uuid
opn_toggle_aliasToggle alias enabled/disabled state. Params: uuid
opn_update_firewall_ruleUpdate filter rule fields with savepoint (OPNsense < 26.7). Params: uuid, action, direction, interface, ip_protocol, protocol, source_net, source_not…
opn_update_nat_ruleUpdate NAT port forwarding rule with savepoint (OPNsense < 26.7). Params: uuid, interface, protocol, destination_port, target_ip, target_port, description…
opn_delete_nat_ruleDelete a NAT port forwarding rule by UUID with savepoint (OPNsense < 26.7). Params: uuid
opn_list_dns_overridesUnbound host overrides (local DNS records). Params: search, limit
opn_list_dns_forwardsDNS forward zones (domain-specific servers). Params: search, limit
opn_dns_statsUnbound resolver statistics (queries, cache hits, uptime)
opn_reconfigure_unboundApply pending DNS resolver configuration changes
opn_add_dns_overrideAdd an Unbound DNS host override (A/AAAA record) and apply immediately. Params: hostname, domain, server, description
opn_list_dnsblList DNSBL blocklist configurations with providers and status. Params: search, limit
opn_get_dnsblGet full DNSBL configuration by UUID (providers, allowlists, settings). Params: uuid
opn_set_dnsblUpdate DNSBL settings (read-modify-write). Params: uuid, enabled, providers, allowlists, blocklists, wildcards, etc.
opn_add_dnsbl_allowlistAdd domains to DNSBL allowlist without overwriting. Params: uuid, domains
opn_remove_dnsbl_allowlistRemove domains from DNSBL allowlist. Params: uuid, domains
opn_update_dnsblReload DNSBL blocklist files and restart Unbound (no config change, recovery tool)
opn_update_dns_overrideUpdate an Unbound DNS host override and apply immediately. Params: uuid, hostname, domain, server, description, enabled
opn_delete_dns_overrideDelete an Unbound DNS host override and apply immediately. Params: uuid
opn_list_dhcp_leasesActive DHCPv4 leases from the ISC DHCP server
opn_list_kea_leasesDHCPv4 leases from the Kea DHCP server. Params: search, limit
opn_list_dnsmasq_leasesDHCPv4 and DHCPv6 leases from the dnsmasq DNS/DHCP server. Params: search, limit
opn_list_dnsmasq_rangesConfigured DHCP address ranges (both DHCPv4 and DHCPv6 with RA config). Params: search, limit
opn_add_dnsmasq_rangeCreate a new DHCP range (IPv4 or IPv6 with Router Advertisement configuration). Params: interface, start_addr, end_addr, prefix_len, ra_mode, lease_time…
opn_reconfigure_dnsmasqApply pending dnsmasq DNS/DHCP configuration changes
opn_update_dnsmasq_rangeUpdate a DHCP range (addresses, lease time, RA config) and apply. Params: uuid, interface, start_addr, end_addr, prefix_len, ra_mode, lease_time…
opn_delete_dnsmasq_rangeDelete a DHCP range by UUID and apply. Params: uuid
opn_wireguard_statusWireGuard tunnel and peer status (requires os-wireguard plugin)
opn_ipsec_statusIPsec VPN tunnel status — IKE (Phase 1) and ESP/AH (Phase 2) sessions
opn_openvpn_statusOpenVPN connection status — instances, sessions, and routes
opn_haproxy_statusHAProxy service status and backend health
opn_haproxy_searchSearch HAProxy resources by type. Params: resource_type (frontends/backends/servers/actions/acls/healthchecks/errorfiles/resolvers/mailers), search, limit
opn_haproxy_getGet detailed configuration for a specific resource. Params: resource_type, uuid
opn_haproxy_configtestValidate HAProxy configuration syntax before applying
opn_haproxy_addCreate a new HAProxy resource. Params: resource_type, config (dict of field values)
opn_haproxy_updateUpdate an existing HAProxy resource (partial updates). Params: resource_type, uuid, config
opn_haproxy_deleteDelete a HAProxy resource by UUID. Params: resource_type, uuid
opn_reconfigure_haproxyApply pending HAProxy configuration changes
opn_list_acme_certsACME/Let's Encrypt certificates and their status. Params: search, limit
opn_list_cron_jobsScheduled cron jobs. Params: search, limit
opn_crowdsec_statusCrowdSec security engine status and active decisions
opn_crowdsec_alertsCrowdSec security alerts (detected threats). Params: search, limit
opn_list_ddns_accountsDynamic DNS accounts and their update status. Params: search, limit
opn_add_ddns_accountCreate a new Dynamic DNS account. Params: service, hostname, username, password, checkip, interface, description
opn_reconfigure_ddclientApply pending Dynamic DNS configuration changes
opn_update_ddns_accountUpdate a Dynamic DNS account (password is write-only). Params: uuid, service, hostname, username, password, checkip, interface, description, enabled
opn_delete_ddns_accountDelete a Dynamic DNS account by UUID. Params: uuid
opn_mdns_repeater_statusmDNS Repeater status and configuration (enabled, interfaces, blocklist). Requires os-mdns-repeater plugin
opn_configure_mdns_repeaterConfigure mDNS Repeater for cross-VLAN device discovery (HomeKit, Chromecast, AirPlay). Params: enabled, interfaces
opn_pingPing a host from the firewall to test connectivity. Params: host, count (1-10, default 3)
opn_tracerouteTrace network path to a destination. Params: host, protocol (ICMP/UDP/TCP), ip_version (4/6)
opn_dns_lookupDNS lookup from the firewall. Params: hostname, server (optional custom DNS server)
opn_pf_statesQuery active PF state table. Params: search, limit (max 1000)
opn_security_auditComprehensive 11-area security audit: firmware, firewall rules (MVC + legacy, port grouping, insecure protocols), NAT forwarding, DNS security (DNSSEC, DoT)…

How to install the opnsense-mcp-server MCP Server

{
  "mcpServers": {
    "opnsense": {
      "command": "opnsense-mcp",
      "env": {
        "OPNSENSE_URL": "https://192.168.1.1/api",
        "OPNSENSE_API_KEY": "YOUR_OPNSENSE_API_KEY",
        "OPNSENSE_API_SECRET": "YOUR_OPNSENSE_API_SECRET",
        "OPNSENSE_VERIFY_SSL": "false",
        "OPNSENSE_ALLOW_WRITES": "false"
      }
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Configuration

VariableDescriptionRequired
OPNSENSE_URLDeclared in the maintainer’s client configuration.Yes
OPNSENSE_API_KEYDeclared in the maintainer’s client configuration.Yes
OPNSENSE_API_SECRETDeclared in the maintainer’s client configuration.Yes
OPNSENSE_VERIFY_SSLDeclared in the maintainer’s client configuration.Check documentation
OPNSENSE_ALLOW_WRITESDeclared in the maintainer’s client configuration.Check documentation