OPNSenseMCP MCP Server

Model Context Protocol server for OPNSense firewall management with inter-VLAN routing diagnostics, ARP table, DNS filtering and HAProxy support via

Local serverstdio

What is the OPNSenseMCP MCP server?

Model Context Protocol server for OPNSense firewall management with inter-VLAN routing diagnostics, ARP table, DNS filtering and HAProxy support via Claude Desktop. Exposed over MCP by the opnsensemcp mcp server, that capability becomes something an assistant can invoke while it works, not something you go and do afterwards.

What it actually does

A Model Context Protocol (MCP) server for comprehensive OPNsense firewall management. This server enables AI assistants like Claude to directly manage firewall configurations, diagnose network issues, and automate complex networking tasks.

Adding it to your client

tsx on npm is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Its toolset

Everything the assistant can do here goes through one of these:

  • firewall_list_rules — List all firewall rules
  • firewall_create_rule — Create a new rule
  • firewall_update_rule — Update existing rule
  • firewall_delete_rule — Delete a rule
  • firewall_apply_changes — Apply pending changes
  • nat_list_outbound — List outbound NAT rules
  • nat_set_mode — Set NAT mode
  • nat_create_outbound_rule — Create NAT rule
  • nat_fix_dmz — Fix DMZ NAT issues
  • nat_analyze_config — Analyze NAT configuration
  • arp_list — List ARP table entries
  • routing_diagnostics — Diagnose routing issues

Configuration

You will need 6 environment variables: OPNSENSE_HOST, OPNSENSE_API_KEY, OPNSENSE_API_SECRET, OPNSENSE_VERIFY_SSL, OPNSENSE_SSH_HOST, OPNSENSE_SSH_KEY_PATH. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

  • Node.js 18+ or Bun 1.0+ - OPNsense firewall (v24.7+ recommended) - API credentials for OPNsense - SSH access (optional, for advanced features)

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch OPNSenseMCP.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the opnsensemcp mcp server does with a few real requests.

When to reach for it

Plenty of developer tooling servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. OPNSenseMCP's toolset — firewall_list_rules, firewall_create_rule, firewall_update_rule and 11 more — is a fair guide to whether it matches your workflow. It is maintained by vespo92; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Available tools

ToolWhat it does
firewall_list_rulesList all firewall rules
firewall_create_ruleCreate a new rule
firewall_update_ruleUpdate existing rule
firewall_delete_ruleDelete a rule
firewall_apply_changesApply pending changes
nat_list_outboundList outbound NAT rules
nat_set_modeSet NAT mode
nat_create_outbound_ruleCreate NAT rule
nat_fix_dmzFix DMZ NAT issues
nat_analyze_configAnalyze NAT configuration
arp_listList ARP table entries
routing_diagnosticsDiagnose routing issues
routing_fix_allAuto-fix routing problems
interface_listList network interfaces

How to install the OPNSenseMCP MCP server

### Using Bun with Claude Desktop

```json
{
  "mcpServers": {
    "opnsense": {
      "command": "bun",
      "args": ["run", "/path/to/OPNSenseMCP/src/index.ts"],
      "env": {
        "OPNSENSE_HOST": "https://your-opnsense:port",
        "OPNSENSE_API_KEY": "your-key",
        "OPNSENSE_API_SECRET": "your-secret",
        "OPNSENSE_VERIFY_SSL": "false"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

  • Node.js 18+ or Bun 1.0+ - OPNsense firewall (v24.7+ recommended) - API credentials for OPNsense - SSH access (optional, for advanced features)
VariableDescriptionRequired
OPNSENSE_HOSTEndpoint or connection string the server talks to.Optional
OPNSENSE_API_KEYCredential the server authenticates with.Yes
OPNSENSE_API_SECRETCredential the server authenticates with.Yes
OPNSENSE_VERIFY_SSLConfiguration value read at startup.Optional
OPNSENSE_SSH_HOSTEndpoint or connection string the server talks to.Optional
OPNSENSE_SSH_KEY_PATHCredential the server authenticates with.Yes

Example prompts to try

  • Use OPNSenseMCP to firewall list rules.
  • Use OPNSenseMCP to firewall create rule.
  • Use OPNSenseMCP to firewall update rule.

Frequently asked questions

It connects OPNSenseMCP to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (firewall_list_rules, firewall_create_rule, firewall_update_rule, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with OPNSenseMCP directly.