acme_add_action
Create a new ACME automation action (restart HAProxy, restart web UI, SFTP upload, SSH command, etc.)
Run an OPNsense firewall from a conversation — rules, VLANs, NAT, HAProxy, DNS blocklists — over the API, with SSH for the things the API cannot reach.
LABSCO SUMMARY
Outbound NAT, DMZ routing and packet-filter inspection are exactly the things an API-only integration cannot touch, and they are the things that break inter-VLAN traffic; here they run over SSH alongside the API tools, so a diagnosis and its fix happen in one session. Two things to weigh before pointing it at a live firewall: SSH access means shell execution on the box, so the credential you give it is as powerful as the account behind it, and the plan-then-apply and macro-recording paths are the safer way to make a multi-step change than issuing the calls one at a time and hoping.
A wide operations surface for an OPNsense firewall, working two ways: the OPNsense API for most configuration, and SSH into the box for the parts that need direct XML or shell access, such as outbound NAT and routing repair.
An OPNsense firewall — v24.7 or later recommended — and API credentials: OPNSENSE_HOST, OPNSENSE_API_KEY and OPNSENSE_API_SECRET, with OPNSENSE_VERIFY_SSL for self-signed certificates. Node.js 18+ or Bun 1.0+, installed as npm install -g opnsense-mcp-server. The SSH and CLI tools need separate access — OPNSENSE_SSH_HOST and OPNSENSE_SSH_USERNAME with either OPNSENSE_SSH_PASSWORD or OPNSENSE_SSH_KEY_PATH — and NAT management in particular runs through SSH rather than the API. MIT.
One command plus a key — npm install -g opnsense-mcp-server, then supply credentials
USE CASES
Run the routing diagnostics, look at the rules and interface configuration involved, and apply the inter-VLAN fix when the cause is clear.
Read the DHCP leases and ARP table, then look a device up by MAC, hostname or VLAN.
Create the VLAN, configure the interface on it, and add the rules that decide what it may reach.
Look at the current NAT mode and outbound rules, analyse the configuration, and apply the correction — this path runs over SSH rather than the API.
Subscribe to the blocklist category, apply it, and check what a specific domain resolves against afterwards.
Create the backend and its servers, put a frontend in front with the certificate, and check the backend reports healthy.
Take a configuration backup, plan the deployment before applying it, and restore if the result is wrong.
Record the calls once, replay them on the next firewall, and export the macro — or generate a tool from it.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
acme_add_actionCreate a new ACME automation action (restart HAProxy, restart web UI, SFTP upload, SSH command, etc.)
acme_delete_actionDelete an ACME automation action
acme_get_settingsGet full ACME/Let's Encrypt configuration — certificates, accounts, validations, automation actions
acme_renew_certificateTrigger manual renewal of a specific certificate
acme_revoke_certificateRevoke a certificate
acme_sign_certificateIssue/sign a certificate (initial creation or re-issue)
acme_update_certificateUpdate certificate settings (renewal interval, restart actions, enable/disable, description)
add_dnsbl_subscriptionAdd a DNSBL subscription list (e.g. OISD, Hagezi, Abuse.ch ThreatFox)
apply_blocklist_categoryApply a predefined category of domain blocks
block_domainAdd a domain to the DNS blocklist
block_multiple_domainsBlock multiple domains at once
cli_apply_changesApply all configuration changes via CLI
cli_check_nfsCheck NFS connectivity from DMZ
cli_executeExecute a CLI command on OPNsense for advanced configuration
cli_fix_dmz_routingComprehensive DMZ routing fix via CLI
cli_fix_interface_blockingFix interface blocking settings via CLI (for DMZ routing issues)
cli_reload_firewallReload firewall rules via CLI
cli_show_routingShow routing table via CLI
configureConfigure OPNsense connection
create_backupCreate a configuration backup
create_firewall_presetCreate a firewall rule from a preset
create_firewall_ruleCreate a new firewall rule
create_vlanCreate a new VLAN
delete_firewall_ruleDelete a firewall rule
delete_vlanDelete a VLAN
find_arp_by_hostnameFind ARP entries by hostname pattern
find_arp_by_interfaceFind ARP entries on specific interface
find_arp_by_ipFind ARP entries by IP address or subnet
find_arp_by_macFind ARP entries by MAC address
find_device_by_macFind device by MAC address
find_device_by_nameFind devices by hostname pattern
find_devices_on_vlanFind devices on specific VLAN
find_firewall_rulesFind firewall rules by description
get_arp_statsGet ARP table statistics
get_devices_by_interfaceGroup devices by network interface
get_firewall_ruleGet firewall rule details
get_guest_devicesGet all devices on guest network (VLAN 4)
get_interfacesList available network interfaces
get_vlanGet VLAN details
haproxy_acl_createCreate an ACL for HAProxy frontend. Supports all OPNsense HAProxy ACL expression types including SNI matching for TCP/SSL passthrough.
haproxy_acl_deleteDelete an HAProxy ACL
haproxy_acl_updateUpdate an existing HAProxy ACL
haproxy_action_createCreate an action for HAProxy frontend. Supports all OPNsense HAProxy action types including tcp-request for SNI routing.
haproxy_action_deleteDelete an HAProxy action
haproxy_action_updateUpdate an existing HAProxy action
haproxy_backend_createCreate a new HAProxy backend
haproxy_backend_deleteDelete an HAProxy backend
haproxy_backend_getGet detailed information about a specific HAProxy backend by UUID
haproxy_backend_healthGet health status of a specific backend
haproxy_backend_listList all HAProxy backends
haproxy_backend_updateUpdate an existing HAProxy backend configuration
haproxy_certificate_createCreate a certificate for HAProxy
haproxy_certificate_listList available certificates for HAProxy
haproxy_frontend_createCreate a new HAProxy frontend
haproxy_frontend_deleteDelete an HAProxy frontend
haproxy_frontend_getGet detailed information about a specific HAProxy frontend by UUID
haproxy_frontend_listList all HAProxy frontends
haproxy_frontend_updateUpdate an existing HAProxy frontend configuration
haproxy_server_addAdd a server to an HAProxy backend
haproxy_server_deleteDelete an HAProxy server
haproxy_server_updateUpdate an existing HAProxy server
haproxy_service_controlControl HAProxy service (start, stop, restart, reload)
haproxy_statsGet HAProxy statistics
iac_apply_deploymentApply a deployment plan
iac_destroy_deploymentDestroy deployed resources
iac_list_resource_typesList available resource types
iac_plan_deploymentPlan infrastructure deployment changes
interface_configure_dmzConfigure DMZ interface for inter-VLAN routing
interface_enable_intervlan_allEnable inter-VLAN routing on all interfaces
interface_enable_intervlan_routingEnable inter-VLAN routing on a specific interface
interface_get_configGet detailed configuration for a specific interface
interface_list_overviewList all network interfaces with their overview
interface_update_configUpdate interface configuration
list_arp_entriesList all ARP table entries
list_available_dnsblList all available DNSBL subscription lists (e.g. OISD, Hagezi, Abuse.ch)
list_backupsList available backups
list_dhcp_leasesList all DHCP leases
list_dns_blocklistList all DNS blocklist entries
list_firewall_rulesList all firewall rules
list_vlansList all VLANs
macro_analyzeAnalyze a macro to detect patterns and parameters
macro_deleteDelete a saved macro
macro_exportExport all macros to a file
macro_generate_toolGenerate an MCP tool definition from a macro
macro_importImport macros from a file
macro_listList all saved macros
macro_playPlay a saved macro
macro_start_recordingStart recording API calls to create a macro
macro_stop_recordingStop recording and save the macro
monit_add_alertAdd a new Monit alert recipient (email address for notifications)
monit_add_serviceAdd a new Monit monitored service (process, host, custom script, filesystem, network, etc.)
monit_add_testAdd a new Monit test condition (CPU, memory, disk, custom, etc.)
monit_delete_alertDelete a Monit alert recipient
monit_delete_serviceDelete a Monit monitored service
monit_delete_testDelete a Monit test
monit_get_settingsGet full Monit configuration (general settings, services, tests, alerts)
monit_statusGet Monit live status — shows if Monit is running and the state of all monitored services
monit_update_alertUpdate an existing Monit alert recipient
monit_update_serviceUpdate an existing Monit service
monit_update_testUpdate an existing Monit test
nat_analyze_configAnalyze NAT configuration for issues
nat_apply_changesApply NAT configuration changes
nat_cleanup_dmz_fixRemove all MCP-created NAT fix rules
nat_create_outbound_ruleCreate an outbound NAT rule
nat_create_port_forwardCreate a port forward rule
nat_delete_outbound_ruleDelete an outbound NAT rule by description (SSH mode) or UUID (API mode)
nat_delete_port_forwardDelete a port forward rule
nat_fix_dmzFix DMZ NAT issue - adds no-NAT rules for inter-VLAN traffic
nat_get_modeGet current NAT mode (automatic, hybrid, manual, disabled)
nat_list_outboundList all outbound NAT rules
nat_list_port_forwardsList all port forward rules
nat_quick_fix_dmzQuick fix for DMZ NAT issue with minimal configuration
nat_set_modeSet NAT mode (automatic, hybrid, manual, disabled)
remove_dnsbl_subscriptionRemove a DNSBL subscription list. Deletes the entry if no lists remain.
restore_backupRestore a configuration backup
routing_create_intervlan_rulesCreate firewall rules for inter-VLAN routing
routing_diagnosticsRun comprehensive inter-VLAN routing diagnostics
routing_fix_allAutomatically fix all detected inter-VLAN routing issues
routing_fix_dmzQuick fix for DMZ to LAN routing (includes NFS rules)
search_dns_blocklistSearch DNS blocklist entries
ssh_backup_configBackup OPNsense configuration via SSH
ssh_batch_executeExecute multiple commands in sequence via SSH
ssh_check_nfs_connectivityCheck NFS connectivity from OPNsense
ssh_enable_intervlan_routingEnable inter-VLAN routing via SSH
ssh_executeExecute arbitrary command via SSH on OPNsense (full CLI access)
ssh_fix_dmz_routingApply comprehensive DMZ routing fix via SSH
ssh_fix_interface_blockingFix interface blocking settings via SSH (resolves DMZ routing issues)
ssh_quick_dmz_fixApply quick DMZ fix (streamlined version)
ssh_reload_firewallReload firewall rules via SSH
ssh_restore_configRestore OPNsense configuration via SSH
ssh_show_pf_rulesShow packet filter rules via SSH
ssh_show_routingShow routing table via SSH
ssh_system_statusGet comprehensive system status via SSH
ssh_test_vlan_connectivityTest connectivity between VLANs
system_enable_intervlan_routingEnable inter-VLAN routing at the system level
system_get_settingsGet system-level firewall and routing settings
system_update_firewall_settingsUpdate system firewall settings
test_connectionTest API connection and authentication
toggle_blocklist_entryEnable/disable a DNS blocklist entry
toggle_firewall_ruleToggle firewall rule enabled/disabled
unblock_domainRemove a domain from the DNS blocklist
update_dnsbl_subscriptionUpdate a DNSBL subscription entry (change lists, enable/disable, update description)
update_firewall_ruleUpdate a firewall rule
update_vlanUpdate VLAN description
BEFORE YOU INSTALL
144 tools when we connected. Many documented example names are wrong: firewall_list_rules is really list_firewall_rules, vlan_create is create_vlan, backup_create is create_backup, and system_execute_command is cli_execute or ssh_execute.
CONTEXT COST
Rated by the size of the 144 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
npm install -g opnsense-mcp-server{
"mcpServers": {
"opnsense": {
"command": "npx",
"args": [
"opnsense-mcp-server"
],
"env": {
"OPNSENSE_HOST": "https://<YOUR_OPNSENSE>:port",
"OPNSENSE_API_KEY": "<YOUR_OPNSENSE_API_KEY>",
"OPNSENSE_API_SECRET": "<YOUR_OPNSENSE_API_SECRET>",
"OPNSENSE_VERIFY_SSL": "false"
}
}
}
}{
"mcpServers": {
"opnsense": {
"command": "bun",
"args": [
"run",
"<YOUR_PATH_TO_OPN_SENSE_MCP>/src/index.ts"
],
"env": {
"OPNSENSE_HOST": "https://<YOUR_OPNSENSE>:port",
"OPNSENSE_API_KEY": "<YOUR_OPNSENSE_API_KEY>",
"OPNSENSE_API_SECRET": "<YOUR_OPNSENSE_API_SECRET>",
"OPNSENSE_VERIFY_SSL": "false"
}
}
}
}opnsense-mcp-server