Skip to main content
Glama
mcp-opnsense

mcp-opnsense

by itunified-io

mcp-opnsense

GitHub release License: AGPL-3.0 CalVer Node.js MCP Tools TypeScript mcp-opnsense MCP server

Slim OPNsense MCP Server for managing firewall infrastructure via the OPNsense REST API.

No SSH. No shell execution. API-only. 3 runtime dependencies.

Table of Contents

Related MCP server: coreyhines/opnsense-mcp

Enterprise Edition

For audit + compliance reporting, multi-firewall fleet operations, encrypted backup orchestration, capacity forecasting, advanced IDS tuning, and Q-Feeds Premium feeds, see the commercial tier:

mcp-opnsense-enterprise — €29/month/seat

Tier comparison:

Tier

This repo

Enterprise repo

License

AGPL-3.0-only

Commercial (Ed25519 JWT)

Pricing

Free

€29/mo/seat

Tools

112 (basic CRUD + diagnostics)

+ ~35 (audit, compliance, fleet, backup_ops, capacity, ha, ids_advanced, qfeeds_premium)

Use case

Single-firewall ops

Multi-firewall + audit/compliance workflows

Trial token: sales@itunified.io.

Features

62 tools across 8 domains:

  • DNS/Unbound (12) — Host overrides, forwards, blocklist, cache management

  • Firewall (8) — Rules, aliases, NAT, apply changes

  • Diagnostics (8) — ARP, routes, ping, traceroute, DNS lookup, firewall states/logs

  • Interfaces (3) — List, configuration, statistics (read-only)

  • DHCP (5) — Leases, static mappings (ISC DHCPv4 + Kea dual support)

  • System (7) — Info, backup (list/download/revert), certificate listing, service control

  • ACME/Let's Encrypt (14) — Accounts, challenges, certificates, renewal, settings

  • Firmware/Plugins (5) — Version info, plugin management

Quick Start

npm install
cp .env.example .env   # Edit with your OPNsense API credentials
npm run build
node dist/index.js     # stdio transport for MCP

HashiCorp Vault Integration (Optional)

mcp-opnsense supports opportunistic AppRole authentication against a HashiCorp Vault instance. When Vault env vars are present, the server fetches OPNsense credentials from KV v2 at startup. If they are absent, the server falls back silently to direct env vars or MCP_SECRETS_FILE — no configuration change or restart required.

How It Works

  1. At startup, the server checks for NAS_VAULT_ADDR in process.env.

  2. If set, it authenticates via AppRole (NAS_VAULT_ROLE_ID + NAS_VAULT_SECRET_ID), reads the secret at <NAS_VAULT_KV_MOUNT>/data/<path>, and maps the KV fields to OPNsense env vars.

  3. If NAS_VAULT_ADDR is not set (or any Vault call fails), a single warning line is written to stderr and the server continues with whatever env vars are already available.

  4. The Vault client uses the global fetch built into Node 20+ — no additional runtime dependencies are added.

Secret Precedence

Explicit env vars  >  Vault  >  MCP_SECRETS_FILE  >  error (required var missing)
  • Values already present in process.env are never overwritten by Vault.

  • Vault is skipped entirely if NAS_VAULT_ADDR is unset.

  • MCP_SECRETS_FILE is the last fallback (see Loading Secrets from a File below).

Vault Environment Variables

Variable

Required

Description

NAS_VAULT_ADDR

Yes*

Vault server address (e.g. https://vault.example.com:8200)

NAS_VAULT_ROLE_ID

Yes*

AppRole role ID for this server

NAS_VAULT_SECRET_ID

Yes*

AppRole secret ID for this server

NAS_VAULT_KV_MOUNT

No

KV v2 mount path (default: kv)

* Only required when using Vault. Without these, the server uses direct env vars or MCP_SECRETS_FILE.

Note: OPNSENSE_VERIFY_SSL, OPNSENSE_TIMEOUT, and all SSH-related env vars (OPNSENSE_SSH_*) are not loaded from Vault. Set them directly in the MCP config or your shell environment.

KV v2 Secret Structure

The server reads from the path configured at startup (default: kv/data/opnsense/bifrost, customisable via the KV mount). The secret must contain the following keys:

# Path: kv/your/opnsense/secret
{
  "url":        "https://your-opnsense.example.com",
  "api_key":    "your-api-key",
  "api_secret": "your-api-secret"
}

Key mapping:

KV field

Env var

url

OPNSENSE_URL

api_key

OPNSENSE_API_KEY

api_secret

OPNSENSE_API_SECRET

Vault Setup

1. Write credentials to KV v2:

vault kv put kv/opnsense/your-firewall \
  url=https://your-opnsense.example.com \
  api_key=your-api-key \
  api_secret=your-api-secret

2. Create a read-only policy:

# opnsense-read.hcl
path "kv/data/opnsense/*" {
  capabilities = ["read"]
}

path "kv/metadata/opnsense/*" {
  capabilities = ["list", "read"]
}
vault policy write opnsense-read opnsense-read.hcl

3. Enable AppRole auth and create a role:

vault auth enable approle

vault write auth/approle/role/mcp-opnsense \
  token_policies="opnsense-read" \
  token_ttl=1h \
  token_max_ttl=4h \
  secret_id_ttl=0

4. Retrieve the role credentials:

vault read auth/approle/role/mcp-opnsense/role-id
vault write -f auth/approle/role/mcp-opnsense/secret-id

Store the returned role_id and secret_id in your MCP config (see example below).

Claude Desktop / MCP Config Example (Vault)

When using Vault, OPNsense credentials are not present in the config file. Only Vault authentication details and non-secret options are needed:

{
  "mcpServers": {
    "opnsense": {
      "command": "npx",
      "args": ["@itunified.io/mcp-opnsense"],
      "env": {
        "NAS_VAULT_ADDR": "https://vault.example.com:8200",
        "NAS_VAULT_ROLE_ID": "your-role-id",
        "NAS_VAULT_SECRET_ID": "your-secret-id",
        "OPNSENSE_VERIFY_SSL": "true"
      }
    }
  }
}

This keeps all OPNsense secrets out of config files and version control. The server authenticates to Vault on each startup and retrieves fresh credentials.

Claude Code Integration

Add to .mcp.json in your project root:

{
  "mcpServers": {
    "opnsense": {
      "command": "node",
      "args": ["/path/to/mcp-opnsense/dist/index.js"],
      "env": {
        "OPNSENSE_URL": "https://your-opnsense.example.com",
        "OPNSENSE_API_KEY": "your-api-key",
        "OPNSENSE_API_SECRET": "your-api-secret",
        "OPNSENSE_VERIFY_SSL": "true"
      }
    }
  }
}

Environment Variables

Variable

Required

Default

Description

OPNSENSE_URL

Yes

—

OPNsense base URL (e.g. https://192.168.1.1)

OPNSENSE_API_KEY

Yes

—

API key for authentication

OPNSENSE_API_SECRET

Yes

—

API secret for authentication

OPNSENSE_VERIFY_SSL

No

true

Set to false for self-signed certificates

OPNSENSE_TIMEOUT

No

30000

Request timeout in milliseconds

MCP_SECRETS_FILE

No

—

Path to a key/value file to load on startup (see below)

NAS_VAULT_ADDR

No

—

HashiCorp Vault URL, enables Vault AppRole loading (see below)

NAS_VAULT_ROLE_ID

No

—

Vault AppRole role_id

NAS_VAULT_SECRET_ID

No

—

Vault AppRole secret_id

NAS_VAULT_KV_MOUNT

No

kv

Vault KV v2 mount path

OPNSENSE_SSH_ENABLED

No

false

Enable SSH-backed tools (opnsense_if_assign, opnsense_if_configure) — see below

OPNSENSE_SSH_HOST

If SSH enabled

—

SSH hostname of the OPNsense target

OPNSENSE_SSH_USER

If SSH enabled

—

SSH login user (must have NOPASSWD sudo for the helper scripts)

OPNSENSE_SSH_KEY_PATH

If SSH enabled

—

Path to the private key (e.g. ~/.ssh/id_ed25519)

OPNSENSE_SSH_KNOWN_HOSTS

If SSH enabled

—

Path to a pre-populated known_hosts (strict checking, no TOFU)

OPNSENSE_SSH_PORT

No

22

SSH port

OPNSENSE_SSH_HELPER_DIR

No

/usr/local/opnsense/scripts/mcp

Remote directory holding if_assign.php / if_configure.php

OPNSENSE_SSH_CONNECT_TIMEOUT

No

10

SSH connect timeout in seconds

Loading Secrets from a File

When the MCP server is launched from a context that does not inherit your shell environment (e.g. a GUI desktop app launched via launchd), process.env may be empty and tool calls will fail with Invalid URL errors. To avoid system-wide environment hacks, point MCP_SECRETS_FILE at a file that holds the required variables:

export MCP_SECRETS_FILE=~/.mcp-opnsense.env

The file is a simple KEY=value format (optionally prefixed with export, with single or double quotes around values, # comments allowed). Example:

OPNSENSE_URL=https://your-opnsense.example.com
OPNSENSE_API_KEY=your-api-key
OPNSENSE_API_SECRET=your-api-secret

The OPNsense web UI "Download as .txt" button generates a two-line file with lowercase key= / secret= pairs. That format is also recognized directly — no rewriting needed:

key=your-api-key
secret=your-api-secret

Precedence: values in process.env always win over values from the file, so the existing shell-based workflow stays fully backward compatible. Missing or unreadable files are silently skipped (the server will fail with the usual "required variable" error if nothing is set).

Security: the file holds plaintext credentials. Store it outside any git repository and restrict permissions: chmod 600 ~/.mcp-opnsense.env.

Loading Secrets from HashiCorp Vault (AppRole)

If you run a central Vault instance, mcp-opnsense can fetch its credentials at startup via AppRole instead of storing them in a file. Set:

export NAS_VAULT_ADDR=https://vault.example.com
export NAS_VAULT_ROLE_ID=<role-id>
export NAS_VAULT_SECRET_ID=<secret-id>
# optional — defaults to "kv"
export NAS_VAULT_KV_MOUNT=kv

The loader reads KV v2 at <mount>/data/opnsense/bifrost and expects three keys: url, api_key, api_secret. Example Vault write:

vault kv put kv/opnsense/bifrost \
  url=https://your-opnsense.example.com \
  api_key=your-api-key \
  api_secret=your-api-secret

Precedence: process.env > Vault > MCP_SECRETS_FILE. If NAS_VAULT_ADDR is unset, Vault loading is a silent no-op — the server behaves exactly as before. On any Vault error (network, auth, missing path), a single-line warning is written to stderr and the server falls back to whatever env vars are already set; it will then fail with the usual "required variable" error if nothing remains.

Security: secret values are never logged. Only the KV path name and a populated-count appear in stderr diagnostics. The loader uses the global fetch (Node 20+) — no new runtime dependencies.

Available Tools (87)

DNS/Unbound (19 tools)

Includes DNSBL (multi-source blocklist) management — opnsense_dns_blocklist_get, opnsense_dns_blocklist_sources_list, opnsense_dns_blocklist_set — for OPNsense 26.1+.

Tool

Description

opnsense_dns_list_overrides

List host overrides (A/AAAA/CNAME)

opnsense_dns_add_override

Add a host override record

opnsense_dns_delete_override

Delete a host override by UUID

opnsense_dns_list_forwards

List DNS-over-TLS forwarding servers

opnsense_dns_add_forward

Add a DNS forwarding server

opnsense_dns_delete_forward

Delete a DNS forward by UUID

opnsense_dns_list_blocklist

List domain overrides (blocked domains)

opnsense_dns_block_domain

Block a domain

opnsense_dns_unblock_domain

Unblock a domain by UUID

opnsense_dns_flush_cache

Flush DNS cache and DNSBL data

opnsense_dns_diagnostics

Dump DNS cache for diagnostics

opnsense_dns_apply

Apply DNS changes (reconfigure Unbound)

NAT (7 tools)

Source NAT (outbound) tools wrapping /api/firewall/source_nat/* (OPNsense 26.1+):

Tool

Description

opnsense_nat_source_list

List all SNAT rules

opnsense_nat_source_get

Get a single SNAT rule by UUID

opnsense_nat_source_add

Add a SNAT rule (requires confirm: true)

opnsense_nat_source_update

Round-trip update of an existing SNAT rule (requires confirm: true)

opnsense_nat_source_delete

Delete a SNAT rule (requires confirm: true)

opnsense_nat_source_toggle

Toggle a SNAT rule's enabled state (requires confirm: true)

opnsense_nat_apply

Apply pending NAT changes (requires confirm: true)

Note: Destination NAT (port forwarding) endpoints are not yet exposed by OPNsense 26.1.7; see issue #123 for the deferred portion.

Firewall (10 tools)

Tool

Description

opnsense_fw_list_rules

List all firewall filter rules

opnsense_fw_add_rule

Create a firewall rule

opnsense_fw_update_rule

Update a firewall rule by UUID

opnsense_fw_delete_rule

Delete a firewall rule by UUID

opnsense_fw_toggle_rule

Enable/disable a firewall rule

opnsense_fw_reorder_rules

Change the evaluation order (sequence) of a rule — enforces whitelist-before-deny

opnsense_fw_drift_check

Audit rule descriptions against a regex (default: ^#\d+: issue-reference prefix)

opnsense_fw_list_aliases

List firewall aliases (host, network, port, URL)

opnsense_fw_manage_alias

Create/update/delete aliases

opnsense_fw_apply

Apply pending firewall changes

Diagnostics (12 tools)

Tool

Description

opnsense_diag_arp_table

Show ARP table (IP-to-MAC mappings)

opnsense_diag_routes

Show routing table

opnsense_diag_ping

Ping a host from OPNsense

opnsense_diag_traceroute

Traceroute to a destination

opnsense_diag_dns_lookup

Perform DNS lookup from OPNsense

opnsense_diag_fw_states

List active firewall connection states

opnsense_diag_fw_logs

Retrieve recent firewall log entries

opnsense_diag_system_info

Get system status (CPU, memory, uptime, disk)

opnsense_diag_log_system

Retrieve recent system log entries

opnsense_diag_log_gateways

Retrieve recent gateway monitoring (dpinger) log entries

opnsense_diag_log_routing

Retrieve recent routing daemon log entries

opnsense_diag_log_resolver

Retrieve recent Unbound DNS resolver log entries

Interfaces (5 tools)

Tool

Description

opnsense_if_list

List all network interfaces with device mappings

opnsense_if_get

Get detailed interface configuration

opnsense_if_stats

Get traffic statistics for all interfaces

opnsense_if_assign

SSH-backed. Assign a VLAN/NIC device to a free optN slot (gap in the OPNsense REST API)

opnsense_if_configure

SSH-backed. Set IPv4/IPv6 on an already-assigned optN slot (static, dhcp, dhcp6, track6, none)

SSH-backed interface assignment

opnsense_if_assign and opnsense_if_configure are the only tools that do not go through the OPNsense REST API. The REST API has no "Interfaces → Assignments" endpoint, so mcp-opnsense invokes two small PHP helpers over SSH + sudo instead. Both tools fail fast with a clear error if OPNSENSE_SSH_ENABLED is not true, so non-SSH deployments are unaffected.

Setup on the OPNsense host:

  1. Install the helpers (shipped in this repo under opnsense-helpers/):

    sudo install -m 0755 -o root -g wheel if_assign.php    /usr/local/opnsense/scripts/mcp/
    sudo install -m 0755 -o root -g wheel if_configure.php /usr/local/opnsense/scripts/mcp/
  2. Create a dedicated SSH user with a public key and add a sudoers.d drop-in that whitelists the exact helper invocations (see opnsense-helpers/README.md for the recommended pattern — the glob MUST end in * to accommodate the mandatory PHP -- separator).

Setup on the mcp-opnsense host:

export OPNSENSE_SSH_ENABLED=true
export OPNSENSE_SSH_HOST=your-opnsense.example.com
export OPNSENSE_SSH_USER=claude
export OPNSENSE_SSH_KEY_PATH=~/.ssh/id_ed25519
export OPNSENSE_SSH_KNOWN_HOSTS=~/.ssh/known_hosts

The known_hosts file must be pre-populated — mcp-opnsense enforces strict host key checking and will refuse to connect otherwise (no TOFU fallback).

Security posture:

  • No shell is invoked locally; the client spawns ssh directly with an argv array.

  • Arguments are single-quote-escaped before concatenation into the remote command string, so untrusted tool input cannot break out of argv on the remote side.

  • BatchMode=yes + PreferredAuthentications=publickey disables password and keyboard-interactive auth.

  • The PHP helpers validate every argument (slot regex, device regex, description charset, IP + CIDR) before touching config.xml, stamp every write_config() with mcp-opnsense: ... for audit traceability, and use numbered exit codes so the caller can distinguish "invalid args" from "write_config failed" from "apply failed".

See ADR-0092 (in the private infrastructure repo) for the full research spike, empirical findings, and rollback contract.

DHCP (5 tools)

Tool

Description

opnsense_dhcp_list_leases

List all current DHCPv4 leases (Kea + ISC, auto-detected)

opnsense_dhcp_find_lease

Search leases by IP, MAC, or hostname (Kea + ISC, auto-detected)

opnsense_dhcp_list_static

List static DHCP mappings (reservations)

opnsense_dhcp_add_static

Add a static DHCP mapping

opnsense_dhcp_delete_static

Delete a static mapping by UUID

System (7 tools)

Tool

Description

opnsense_sys_info

Get system status (hostname, versions, CPU, memory, uptime, disk)

opnsense_sys_backup_list

List all configuration backups with timestamps and descriptions

opnsense_sys_backup_download

Download configuration backup as XML (current or specific)

opnsense_sys_backup_revert

Revert to a previous configuration backup (destructive)

opnsense_sys_list_certs

List all certificates in the trust store

opnsense_svc_list

List all services and their running status

opnsense_svc_control

Start, stop, or restart a service by name

Note on tunables: opnsense_sys_tunable_* tools shipped briefly in v2026.5.6-1 (#133) were reverted in v2026.5.6-4 (#137). OPNsense exposes no public REST API for FreeBSD sysctl tunables — they live in config.xml under <sysctl> and are managed via the legacy PHP UI (System → Settings → Tunables). Tunable management can be approximated via XML-config roundtrip (opnsense_sys_backup_download + edit + opnsense_sys_backup_revert).

Note on diagnostic logs: opnsense_diag_log_{system,gateways,routing,resolver} require the API user to have Diagnostics: Logfile privilege in OPNsense (System → Access → Users). Without this privilege the endpoints return 200 OK but with "total":0. The opnsense_diag_fw_logs tool uses a separate privilege (Firewall: Diagnostics) that's typically already granted.

ACME/Let's Encrypt (14 tools)

Tool

Description

opnsense_acme_list_accounts

List ACME accounts (Let's Encrypt, ZeroSSL, etc.)

opnsense_acme_add_account

Register a new ACME account with a CA

opnsense_acme_delete_account

Delete an ACME account by UUID

opnsense_acme_register_account

Trigger registration of an ACME account with its CA

opnsense_acme_list_challenges

List all challenge/validation methods

opnsense_acme_add_challenge

Add a DNS-01 challenge (Cloudflare, AWS, etc.)

opnsense_acme_update_challenge

Update an existing challenge configuration

opnsense_acme_delete_challenge

Delete a challenge by UUID

opnsense_acme_list_certs

List all ACME certificates and their status

opnsense_acme_create_cert

Create a new certificate request

opnsense_acme_delete_cert

Delete an ACME certificate by UUID

opnsense_acme_renew_cert

Trigger immediate certificate renewal

opnsense_acme_settings

Get or update ACME service settings

opnsense_acme_apply

Apply pending ACME configuration changes

VLANs (4 tools)

Tool

Description

opnsense_vlan_list

List configured 802.1Q VLAN interfaces (parent, tag, priority, description)

opnsense_vlan_create

Create a VLAN interface on a parent device

opnsense_vlan_update

Update VLAN tag, parent, priority, or description

opnsense_vlan_delete

Delete a VLAN interface by UUID

Firmware/Plugins (8 tools)

Tool

Description

opnsense_firmware_info

Get firmware version, architecture, update status

opnsense_firmware_status

Check for available firmware upgrades

opnsense_firmware_list_plugins

List all available and installed plugins

opnsense_firmware_install

Install an OPNsense plugin package

opnsense_firmware_remove

Remove a plugin package (requires confirmation)

opnsense_firmware_upgrade

Trigger system upgrade (minor or major series jump). Long-running. Requires confirmation.

opnsense_firmware_upgrade_status

Get progress/log of a running or just-completed upgrade

opnsense_firmware_reboot

Reboot the OPNsense system. Requires confirmation.

Skills

Claude Code skills compose MCP tools into higher-level workflows. See .claude/skills/README.md for detailed documentation.

Skill

Slash Command

Description

opnsense-service-health

/opn-health

Health dashboard — system status, services, firmware, interfaces

opnsense-acme-renew

/opn-renew-cert

ACME certificate status check and renewal

opnsense-backup

/opn-backup

Configuration backup management — list, download, revert

opnsense-live-test

/opn-test

Live integration test — read + safe writes with cleanup

opnsense-diagnostics

—

Network connectivity diagnostics — ping, traceroute, DNS, ARP

opnsense-dns-management

—

DNS record management — add, delete, apply, verify resolution

opnsense-firewall-audit

—

Firewall security audit — permissive rules, disabled rules, patterns

Known Limitations

Some OPNsense operations are not available via the REST API and require manual GUI access:

  • Web GUI SSL certificate assignment — ssl-certref can only be changed via System > Settings > Administration in the web UI. See docs/manual-operations.md.

  • Configuration upload/import — OPNsense has no API to upload configuration XML files. Use opnsense_sys_backup_revert to revert to local backups, or upload via the web GUI.

  • User/group management — Not exposed via REST API.

  • VPN configuration — Limited API coverage; most settings require the web UI.

Security

  • Transport: stdio only — no HTTP endpoints exposed

  • Authentication: OPNsense API key/secret via environment variables

  • SSL: Enabled by default, configurable for self-signed certs

  • No SSH: All operations use the OPNsense REST API exclusively

  • Input validation: Strict Zod schemas for all tool parameters

  • Destructive operations: Require explicit confirm: true parameter

  • See SECURITY.md for the full security policy

Development

npm test          # Run unit tests (vitest)
npm run build     # Compile TypeScript
npx tsc --noEmit  # Type check only

See CONTRIBUTING.md for contribution guidelines.

License

This project (mcp-opnsense, the Community Edition) is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). It is free to use under AGPL terms.

For audit, compliance, fleet, backup orchestration, capacity forecasting, advanced IDS, Q-Feeds Premium, and HA tooling, see the Business Edition: mcp-opnsense-enterprise (commercial license, €29/mo/seat).

Support development by sponsoring us on GitHub.

Available Tools

112 tools
opnsense_acme_add_accountB

Register a new ACME account with a certificate authority (Let's Encrypt, ZeroSSL, etc.). Run opnsense_acme_apply afterwards.

Inputs: name (required), email (required), ca.

opnsense_acme_add_challengeA

Add a DNS-01 challenge configuration for automated certificate validation. For Cloudflare, use the dedicated dns_cf_* fields instead of dns_environment. Run opnsense_acme_apply afterwards.

Inputs: name (required), dns_service (required), dns_environment, description, +5 more.

opnsense_acme_applyA

Apply pending ACME configuration changes (reconfigure service)

Inputs: no named parameters.

opnsense_acme_create_certA

Create a new ACME certificate request. Requires an account and challenge to be configured first. Run opnsense_acme_apply afterwards.

Inputs: name (required), alt_names (required), account_uuid (required), validation_uuid (required), +3 more.

opnsense_acme_delete_accountA

Delete an ACME account by UUID. Run opnsense_acme_apply afterwards.

Inputs: uuid (required).

opnsense_acme_delete_certA

Delete an ACME certificate by UUID. Run opnsense_acme_apply afterwards.

Inputs: uuid (required).

opnsense_acme_delete_challengeA

Delete an ACME challenge/validation method by UUID. Run opnsense_acme_apply afterwards.

Inputs: uuid (required).

opnsense_acme_list_accountsA

List all ACME accounts (Let's Encrypt, ZeroSSL, etc.) configured in the os-acme-client plugin

Inputs: no named parameters.

opnsense_acme_list_certsA

List all ACME certificates and their status (issued, pending, expired)

Inputs: no named parameters.

opnsense_acme_list_challengesA

List all configured ACME challenge/validation methods (DNS-01, HTTP-01, etc.)

Inputs: no named parameters.

opnsense_acme_register_accountA

Trigger registration of an ACME account with its certificate authority. Use after adding an account to verify it registers successfully.

Inputs: uuid (required).

opnsense_acme_renew_certA

Trigger immediate renewal/signing of an ACME certificate by UUID

Inputs: uuid (required).

opnsense_acme_settingsA

Get or update ACME service settings (enable/disable, environment, auto-renewal, log level). When called with no parameters, returns current settings. Run opnsense_acme_apply afterwards when updating.

Inputs: enabled, environment, autoRenewal, logLevel.

opnsense_acme_update_challengeA

Update an existing ACME challenge/validation by UUID. Use to change credentials or settings. Run opnsense_acme_apply afterwards.

Inputs: uuid (required), name, dns_service, dns_environment, +6 more.

opnsense_dhcp_add_staticA

Add a static DHCP mapping (MAC-to-IP reservation). Supports both Kea DHCP and ISC DHCP (legacy) backends — auto-detected. Requires DHCP service restart to take effect.

Inputs: mac (required), ipaddr (required), hostname, description.

opnsense_dhcp_delete_staticA

Delete a static DHCP mapping by UUID. Supports both Kea DHCP and ISC DHCP (legacy) backends — auto-detected.

Inputs: uuid (required).

opnsense_dhcp_find_leaseA

Search DHCPv4 leases by IP address, MAC address, or hostname. Supports both Kea DHCP and ISC DHCP (legacy) backends — auto-detects which is active.

Inputs: query (required).

opnsense_dhcp_list_leasesA

List all current DHCPv4 leases. Supports both Kea DHCP (default on modern OPNsense) and ISC DHCP (legacy) backends — auto-detects which is active.

Inputs: no named parameters.

opnsense_dhcp_list_staticA

List all static DHCP mappings (MAC-to-IP reservations). Supports both Kea DHCP and ISC DHCP (legacy) backends — auto-detected.

Inputs: no named parameters.

opnsense_diag_arp_tableA

Show the ARP table (IP-to-MAC mappings). Optionally filter by IP, MAC, or interface.

Inputs: ip, mac, interface.

opnsense_diag_dns_lookupB

Perform a DNS lookup from the OPNsense firewall

Inputs: hostname (required).

opnsense_diag_fw_logsB

Retrieve recent firewall log entries

Inputs: limit.

opnsense_diag_fw_statesA

List active firewall connection tracking states

Inputs: no named parameters.

opnsense_diag_log_gatewaysA

Retrieve recent OPNsense gateway monitoring (dpinger) log entries — useful for WAN/gateway health debugging.

Inputs: limit.

opnsense_diag_log_resolverB

Retrieve recent Unbound DNS resolver log entries.

Inputs: limit.

opnsense_diag_log_routingB

Retrieve recent OPNsense routing daemon log entries.

Inputs: limit.

opnsense_diag_log_systemA

Retrieve recent OPNsense system log entries (kernel, generic system events).

Inputs: limit.

opnsense_diag_pingB

Ping a host from the OPNsense firewall

Inputs: address (required), count.

opnsense_diag_reverse_dnsA

Perform a reverse DNS lookup (IP to hostname) from the OPNsense firewall

Inputs: address (required).

opnsense_diag_routesA

Show the routing table

Inputs: no named parameters.

opnsense_diag_system_infoA

Get system status information (CPU, memory, uptime, disk, versions)

Inputs: no named parameters.

opnsense_diag_tracerouteB

Run a traceroute from the OPNsense firewall to a destination

Inputs: address (required).

opnsense_dns_add_forwardA

Add a DNS forwarding server (DNS-over-TLS). Run opnsense_dns_apply afterwards to activate.

Inputs: domain (required), server (required), port.

opnsense_dns_add_overrideA

Add a DNS host override (A/AAAA/CNAME record) to Unbound. Run opnsense_dns_apply afterwards to activate.

Inputs: hostname (required), domain (required), server (required), description, +1 more.

opnsense_dns_applyA

Apply pending DNS/Unbound configuration changes (reconfigure service)

Inputs: no named parameters.

opnsense_dns_block_domainA

Block a domain by adding a domain override with an empty server. Run opnsense_dns_apply afterwards to activate.

Inputs: domain (required), server, description.

opnsense_dns_blocklist_getA

Get the Unbound DNSBL (DNS blocklist) configuration: enabled flag, selected built-in source IDs, custom URLs, NX-domain mode, allowlist. Read-only.

Inputs: no named parameters.

opnsense_dns_blocklist_setA

Update the Unbound DNSBL configuration: enable/disable, select multiple built-in source IDs, set custom blocklist URLs, configure NX-domain mode. After this, call opnsense_dns_apply to activate. DESTRUCTIVE: requires explicit confirmation.

Inputs: confirm (required), enabled, sources, custom_lists, +1 more.

opnsense_dns_blocklist_sources_listA

List all available built-in DNSBL block-list sources (curated feeds like AdGuard, EasyList, hagezi, Steven Black, etc.) with their internal IDs and selected state. Read-only.

Inputs: no named parameters.

opnsense_dns_delete_forwardA

Delete a DNS forwarding entry by UUID. Run opnsense_dns_apply afterwards to activate.

Inputs: uuid (required).

opnsense_dns_delete_overrideA

Delete a DNS host override by UUID. Run opnsense_dns_apply afterwards to activate.

Inputs: uuid (required).

opnsense_dns_diagnosticsB

Dump the current Unbound DNS cache for diagnostic purposes

Inputs: no named parameters.

opnsense_dns_flush_cacheB

Flush the Unbound DNS resolver cache

Inputs: no named parameters.

opnsense_dns_flush_zoneA

Flush all cached DNS entries for a specific domain/zone. Use this to clear stale SERVFAIL or outdated records for a domain. Restarts Unbound to ensure complete cache clearing.

Inputs: domain (required).

opnsense_dns_infraA

Dump the Unbound infrastructure cache showing upstream server RTT, EDNS support, and lame delegation status. Useful for diagnosing upstream DNS connectivity issues.

Inputs: no named parameters.

opnsense_dns_list_blocklistA

List all domain overrides (used for domain blocking) in Unbound

Inputs: no named parameters.

opnsense_dns_list_forwardsA

List all DNS-over-TLS forwarding servers configured in Unbound

Inputs: no named parameters.

opnsense_dns_list_overridesA

List all DNS host overrides (A/AAAA/CNAME records) configured in Unbound

Inputs: no named parameters.

opnsense_dns_statsA

Get Unbound DNS resolver statistics: query counts, cache hits/misses, uptime, and memory usage

Inputs: no named parameters.

opnsense_dns_unblock_domainA

Unblock a domain by deleting its domain override. Run opnsense_dns_apply afterwards to activate.

Inputs: uuid (required).

opnsense_firmware_checkA

Trigger a background firmware repository check to refresh the cached upgrade status. After calling this, wait briefly and then call 'opnsense_firmware_status' to see fresh upgrade info.

Inputs: no named parameters.

opnsense_firmware_infoA

Get firmware version, architecture, and update status of the OPNsense system

Inputs: no named parameters.

opnsense_firmware_installA

Install an OPNsense plugin package by name (e.g. 'os-acme-client'). May require a service restart.

Inputs: package (required).

opnsense_firmware_list_pluginsA

List all available and installed OPNsense plugins with their versions and status

Inputs: no named parameters.

opnsense_firmware_rebootA

Reboot the OPNsense system. Causes a network outage on the firewall and any services it provides (DNS, DHCP, VPN). DESTRUCTIVE: requires explicit confirmation.

Inputs: confirm (required).

opnsense_firmware_removeA

Remove an installed OPNsense plugin package. DESTRUCTIVE: requires explicit confirmation.

Inputs: package (required), confirm (required).

opnsense_firmware_statusA

Check for available firmware upgrades and their status (running, pending, done). Reads the cached state — call 'opnsense_firmware_check' first if the cache may be stale.

Inputs: no named parameters.

opnsense_firmware_upgradeA

Trigger an OPNsense system upgrade based on what 'opnsense_firmware_status' reports (minor packages, or a major-series jump such as 24.7 → 25.1). Long-running: poll progress with 'opnsense_firmware_upgrade_status'. A reboot is typically required afterwards. DESTRUCTIVE: requires explicit confirmation.

Inputs: confirm (required).

opnsense_firmware_upgrade_statusA

Get the progress/log of a currently running or last completed firmware upgrade (long-running operation status).

Inputs: no named parameters.

opnsense_fw_add_ruleA

Add a new firewall filter rule. Run opnsense_fw_apply afterwards to activate.

Inputs: action (required), direction (required), interface, protocol, +4 more.

opnsense_fw_applyA

Apply pending firewall configuration changes

Inputs: no named parameters.

opnsense_fw_delete_ruleA

Delete a firewall filter rule by UUID. Run opnsense_fw_apply afterwards to activate.

Inputs: uuid (required).

opnsense_fw_drift_checkA

Audit firewall filter rules for description hygiene. Returns rules whose description does not match the given regex (default: '^#\d+:' — issue-reference prefix) and rules with empty descriptions. Read-only.

Inputs: description_prefix_regex, category.

opnsense_fw_list_aliasesA

List all firewall aliases (host groups, networks, ports, URLs)

Inputs: no named parameters.

opnsense_fw_list_rulesA

List all firewall filter rules

Inputs: no named parameters.

opnsense_fw_manage_aliasA

Create, update, or delete a firewall alias. Run opnsense_fw_apply afterwards to activate.

Inputs: action (required), uuid, name, type, +2 more.

opnsense_fw_reorder_rulesA

Change the sequence (ordering) of a firewall filter rule by UUID. Rules with lower sequence values are evaluated first. Use this to enforce whitelist-before-deny ordering. Run opnsense_fw_apply afterwards to activate.

Inputs: uuid (required), sequence (required).

opnsense_fw_toggle_ruleA

Enable or disable a firewall rule by UUID. Run opnsense_fw_apply afterwards to activate.

Inputs: uuid (required), enabled (required).

opnsense_fw_update_ruleA

Update an existing firewall filter rule by UUID. Run opnsense_fw_apply afterwards to activate.

Inputs: uuid (required), action (required), direction (required), interface, +5 more.

opnsense_if_assignA

Assign an existing VLAN or NIC device to a free optN slot via SSH. Requires OPNSENSE_SSH_ENABLED=true and the opnsense-helpers/if_assign.php script installed on the target host. Fills the gap where the OPNsense REST API has no 'Interfaces → Assignments' endpoint.

Inputs: slot (required), if (required), descr.

opnsense_if_configureA

Configure IPv4/IPv6 on an already-assigned optN slot via SSH. Supports static, dhcp, dhcp6, track6, and 'none'. Requires OPNSENSE_SSH_ENABLED=true and the opnsense-helpers/if_configure.php script installed on the target host.

Inputs: slot (required), ipv4, subnet, ipv6, +5 more.

opnsense_if_getA

Get detailed configuration for a specific network interface (IP addresses, status, MTU, etc.)

Inputs: interface_name (required).

opnsense_if_listA

List all network interface names and their device mappings

Inputs: no named parameters.

opnsense_if_statsA

Get traffic statistics for all interfaces (bytes, packets, errors, collisions)

Inputs: no named parameters.

opnsense_kea_applyA

Apply pending Kea DHCP configuration changes (reconfigure service). Run after subnet or reservation changes.

Inputs: no named parameters.

opnsense_kea_subnet_createA

Create a new Kea DHCPv4 subnet. Run opnsense_kea_apply afterwards to activate.

Inputs: subnet (required), pools, description, option_data_autocollect, +5 more.

opnsense_kea_subnet_deleteA

Delete a Kea DHCPv4 subnet by UUID. Run opnsense_kea_apply afterwards to activate.

Inputs: uuid (required).

opnsense_kea_subnet_getA

Get detailed configuration of a specific Kea DHCPv4 subnet by UUID.

Inputs: uuid (required).

opnsense_kea_subnet_listA

List all Kea DHCPv4 subnets with their pools, options, and reservation counts.

Inputs: no named parameters.

opnsense_kea_subnet_updateA

Update an existing Kea DHCPv4 subnet. Run opnsense_kea_apply afterwards to activate.

Inputs: uuid (required), subnet (required), pools, description, +6 more.

opnsense_nat_applyB

Apply pending NAT configuration changes. Required after add/update/delete/toggle for changes to take effect. DESTRUCTIVE.

Inputs: confirm (required).

opnsense_nat_source_addA

Add a new Source NAT (outbound) rule. After adding, call opnsense_nat_apply to activate. DESTRUCTIVE: requires explicit confirmation.

Inputs: interface (required), confirm (required), enabled, ipprotocol, +15 more.

opnsense_nat_source_deleteA

Delete a Source NAT rule. DESTRUCTIVE: requires explicit confirmation.

Inputs: uuid (required), confirm (required).

opnsense_nat_source_getA

Get a single Source NAT rule by UUID with full configuration. Read-only.

Inputs: uuid (required).

opnsense_nat_source_listA

List all Source NAT (outbound) rules. Read-only. Returns rule UUID, sequence, interface, source/destination, target, enabled state.

Inputs: no named parameters.

opnsense_nat_source_toggleA

Toggle a Source NAT rule's enabled state. DESTRUCTIVE: requires explicit confirmation.

Inputs: uuid (required), confirm (required).

opnsense_nat_source_updateB

Update an existing Source NAT rule. Round-trips current config and only overrides explicitly provided fields. DESTRUCTIVE.

Inputs: uuid (required), confirm (required), enabled, interface, +16 more.

opnsense_route_addA

Add a static route. The gateway parameter must be a gateway name from opnsense_route_gateway_list. Run opnsense_route_apply afterwards to activate.

Inputs: network (required), gateway (required), disabled, description.

opnsense_route_applyA

Apply static route configuration changes (reconfigure routing)

Inputs: no named parameters.

opnsense_route_deleteA

Delete a static route. Run opnsense_route_apply afterwards to activate.

Inputs: uuid (required).

opnsense_route_gateway_applyA

Apply pending gateway configuration changes (calls /api/routing/settings/reconfigure). Required after opnsense_route_gateway_update for changes to take effect. May briefly affect WAN connectivity. DESTRUCTIVE: requires explicit confirmation.

Inputs: confirm (required).

opnsense_route_gateway_listA

List all available gateways (used as targets for static routes)

Inputs: no named parameters.

opnsense_route_gateway_statusA

Get live gateway monitor status: per-gateway online/offline state, RTT (delay), packet loss, stddev, monitor IP, and monitor_disable flag. Read-only — complements opnsense_route_gateway_list (which only returns config).

Inputs: no named parameters.

opnsense_route_gateway_updateA

Update an existing gateway's settings (toggle monitoring, set monitor IP, change weight/priority, enable/disable). Round-trips current config and only overrides explicitly provided fields. After updating, call opnsense_route_gateway_apply to activate the change. DESTRUCTIVE: requires explicit confirmation.

Inputs: uuid (required), confirm (required), monitor_disable, monitor, +5 more.

opnsense_route_listA

List all configured static routes

Inputs: no named parameters.

opnsense_route_updateB

Update an existing static route. Run opnsense_route_apply afterwards to activate.

Inputs: uuid (required), network, gateway, disabled, +1 more.

opnsense_svc_controlB

Start, stop, or restart a service by name

Inputs: service_name (required), action (required).

opnsense_svc_listA

List all services and their running status

Inputs: no named parameters.

opnsense_sys_backup_downloadA

Download an OPNsense configuration backup as XML. Downloads the current running config if no backup_id is specified.

Inputs: backup_id.

opnsense_sys_backup_listA

List all configuration backups stored on the OPNsense filesystem with timestamps, descriptions, and file sizes

Inputs: no named parameters.

opnsense_sys_backup_revertA

Revert OPNsense configuration to a previous backup. DESTRUCTIVE: replaces the running config with the specified backup.

Inputs: backup_id (required).

opnsense_sys_infoA

Get system status information (hostname, versions, CPU, memory, uptime, disk usage)

Inputs: no named parameters.

opnsense_sys_list_certsA

List all certificates in the OPNsense trust store with their refids, descriptions, and validity dates

Inputs: no named parameters.

opnsense_tailscale_service_controlA

Control the Tailscale service: start, stop, restart, or reconfigure (apply settings changes).

Inputs: action (required).

opnsense_tailscale_service_statusA

Check if the Tailscale service (tailscaled) is running.

Inputs: no named parameters.

opnsense_tailscale_settings_getA

Get current Tailscale plugin settings (enabled, port, auth-key, advertise-routes, accept-routes, accept-dns, exit-node).

Inputs: no named parameters.

opnsense_tailscale_settings_setA

Update Tailscale plugin settings. Only provided fields are changed. Run opnsense_tailscale_service_control with action 'reconfigure' afterwards to apply.

Inputs: enabled, port, auth_key, advertise_routes, +3 more.

opnsense_vlan_createA

Create a new 802.1Q VLAN interface on a parent interface. After create, run opnsense_if_assign to bind the VLAN to a logical interface (opt1, opt2, ...) and opnsense_if_configure to assign an IP.

Inputs: parent_interface (required), vlan_tag (required), description, priority.

opnsense_vlan_deleteA

Delete a VLAN interface by UUID. Fails if the VLAN is still assigned to a logical interface — unassign it first via opnsense_if_assign.

Inputs: uuid (required).

opnsense_vlan_listA

List all configured 802.1Q VLAN interfaces (parent interface, VLAN tag, description, priority)

Inputs: no named parameters.

opnsense_vlan_updateA

Update an existing VLAN interface by UUID. Only provided fields are changed.

Inputs: uuid (required), parent_interface, vlan_tag, description, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 112 tools

    Disambiguation4/5

    Most tools are clearly distinct due to strong domain prefixes and specific CRUD operations. However, with 112 tools there are a few overlapping ones (e.g., opnsense_sys_info vs opnsense_diag_system_info) and similar diagnostics tools that could cause misselection, though descriptions help differentiate them.

    Naming Consistency5/5

    The naming pattern is highly consistent: 'opnsense_' + domain + action + object (e.g., opnsense_dns_list_overrides, opnsense_fw_add_rule). Verbs like list/add/delete/update/apply are used uniformly. Minor exceptions like opnsense_fw_manage_alias and opnsense_acme_settings exist but are negligible.

    Tool Count2/5

    112 tools is far beyond the typical 3-15 for a well-scoped server. While OPNsense covers many subsystems, this count feels excessive and could overwhelm agents. Many tools are specialized (e.g., 6 DNS cache tools, 4 log tools) and could be consolidated into fewer parameterized operations.

    Completeness4/5

    The set covers major OPNsense domains comprehensively: DNS, firewall, DHCP, Kea, interfaces, routes, NAT, ACME, firmware, Tailscale, and diagnostics. CRUD operations exist for key objects with apply functions. Minor gaps exist (e.g., no destination NAT/port forwarding tools, no VPN management), but the core firewall and network management lifecycle is well-covered.

    Maintenance

    ActivityNo data
    ResponsivenessSyncing

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      Slim Cloudflare MCP Server — 42 tools for managing DNS, zones, tunnels, WAF, Zero Trust, and security via Cloudflare API v4. Multi-zone support. No SSH, no shell, API-only with 3 runtime dependencies. AGPL-3.0 + Commercial dual-licensed.
      96
      65 npm
      AGPL 3.0
    • A
      license
      A
      quality
      B
      maintenance
      A secure MCP server for managing OPNsense firewalls through AI assistants. Provides 81 tools across system, firewall, network, DNS, DHCP, VPN, HAProxy, services, diagnostics, and security domains.
      81
      289 PyPI
      27
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides complete programmatic access to OPNsense core APIs, enabling firewall automation, VPN management, and system administration through a comprehensive MCP server.
      MIT