← Back to directory
O

OPNsense MCP Server

Community
Manage OPNsense firewalls and networks through MCP.
Category
Other #515 of 678
Stars
★ 100 Popular
Transport
stdio (local process)
Runtime
Node.js 18+ · Bun 1.1.39+
Credentials
API key / credential required
License
MIT
Last commit
Tools
18
45FMRS · D

The README describes broad OPNsense management and states that the server can make immediate changes by default, with read-only and dry-run safety modes available. It requires firewall API credentials, with SSH needed for some features, and provides a Claude Desktop configuration example.

Strongest · Setup experience 12/20 Weakest · Security and permissions 5/20

Reliability
7/20
Security and permissions
5/20
Maintenance
9/20
Documentation
12/20
Setup experience
12/20
Why each score
Reliability 7/20
The README describes tool categories, runtime requirements, and test scripts, but provides no verifiable CI results, test coverage details, or evidence of a successful MCP handshake. It also describes the tool set as both “140+” and “50+,” leaving the match between claims and actual behavior uncertain. The static-review cap and missing evidence keep the score modest.
Security and permissions 5/20
The README claims that read-only and dry-run modes are enforced at the API and SSH execution layers and documents their environment variables. However, it also describes firewall changes, direct XML manipulation, SSH command execution, and service restarts, with an example framed as running any CLI command. There is no reviewable implementation evidence for permission scoping, confirmation of dangerous actions, or data-flow boundaries. No confirmed red-line condition is established from the supplied material, but the broad side-effect surface and missing implementation evidence warrant deductions.
Maintenance 9/20
The supplied material identifies an MIT license, a version, and documentation entry points; metadata says the repository is not archived and has 12 open issues. It provides no evidence of commit or release history, dependency updates, issue response, or a security-response process, so maintenance continuity and governance remain uncertain.
Documentation 12/20
The README provides installation steps, Node and Bun usage, Claude Desktop configuration, example use cases, tool names, safety modes, and basic troubleshooting. Parameter coverage is limited, the complete tool reference points to files not supplied here, and reviewable detail on platform limits, permission boundaries, and error handling is missing. The inconsistent tool-count claims also reduce confidence.
Setup experience 12/20
The README gives an npm global-install path and a Claude Desktop configuration example, and identifies required API credentials and optional SSH configuration. The operator still needs an OPNsense system, API access, and credentials; SSH features require additional access and setup. With no manifest or execution evidence, the install path cannot be verified.

Static review · not runReviewed 2026-11-30

Read the FMRS scoring method →

Fit and risk

What it can accessReads local filesWrites / deletes local filesRuns commands or codeUses the network

Best for

  • Administrators managing their own OPNsense firewall through MCP.
  • Operators automating firewall, NAT, or network diagnostic tasks.

Not for

  • Environments that do not use OPNsense.
  • Read-only use when read-only mode has not been enabled.
  • Users without authorized credentials or permissions for the target firewall.

Required permissions

  • Requires the OPNsense API host, API key, and API secret.
  • NAT management and advanced system features require configured SSH access and credentials.
  • The running server can make firewall changes; SSH features can also run whitelisted commands, manipulate configuration files, and manage services.

Risks and side effects

  • By default, the server can make immediate changes to firewall rules, NAT configuration, and service state; SSH can run whitelisted commands.
  • Incorrect configuration can affect network connectivity or firewall access. The README recommends enabling OPNSENSE_READ_ONLY=true first on a live device, then using OPNSENSE_DRY_RUN=true to review simulated operations.
  • The example sets OPNSENSE_VERIFY_SSL=false; configure connection verification carefully for the deployment environment.

Setup

Before you start

Runtime:Node.js 18+ · Bun 1.1.39+

OPNSENSE_HOST required URL of the OPNsense management endpoint; get it from your OPNsense host address and port.
OPNSENSE_API_KEY requiredsecret Required OPNsense API key; obtain it after enabling API access in OPNsense.
OPNSENSE_API_SECRET requiredsecret Required secret paired with the OPNsense API key; obtain it after enabling API access in OPNsense.
OPNSENSE_SSH_PASSWORD optionalsecret Password for SSH login to OPNsense.
Other optional settings (6)
OPNSENSE_VERIFY_SSL optional Controls TLS certificate verification; set according to the certificate configuration of the OPNsense endpoint.
OPNSENSE_SSH_HOST optional OPNsense hostname or address for SSH features.
OPNSENSE_SSH_USERNAME optional Username for SSH login to OPNsense.
OPNSENSE_SSH_KEY_PATH optional Path to the SSH private key file; omit if using an SSH password.
OPNSENSE_READ_ONLY optional Set to true to reject changes and hide write-capable tools; useful for initial setup or production.
OPNSENSE_DRY_RUN optional Set to true to simulate changes without sending requests to the router.

Requires Node.js 18+, an OPNsense firewall, and API credentials; SSH is optional for advanced features. Install the npm package with npm install -g opnsense-mcp-server. Add the README's JSON configuration to Claude Desktop and provide the OPNsense host, API key, and secret. Before connecting to a live device, the README recommends setting OPNSENSE_READ_ONLY=true; OPNSENSE_DRY_RUN=true can simulate write operations.

claude_desktop_config.json
{
  "mcpServers": {
    "opnsense": {
      "command": "npx",
      "args": [
        "opnsense-mcp-server"
      ],
      "env": {
        "OPNSENSE_HOST": "https://your-opnsense-host:port",
        "OPNSENSE_API_KEY": "your-api-key",
        "OPNSENSE_API_SECRET": "your-api-secret",
        "OPNSENSE_VERIFY_SSL": "false"
      }
    }
  }
}

Shown for Claude Desktop. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "opnsense": {
      "command": "npx",
      "args": [
        "opnsense-mcp-server"
      ],
      "env": {
        "OPNSENSE_HOST": "https://your-opnsense-host:port",
        "OPNSENSE_API_KEY": "your-api-key",
        "OPNSENSE_API_SECRET": "your-api-secret",
        "OPNSENSE_VERIFY_SSL": "false"
      }
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

~/.codex/config.toml
[mcp_servers.opnsense]
command = "npx"
args = ["opnsense-mcp-server"]

[mcp_servers.opnsense.env]
OPNSENSE_HOST = "https://your-opnsense-host:port"
OPNSENSE_API_KEY = "your-api-key"
OPNSENSE_API_SECRET = "your-api-secret"
OPNSENSE_VERIFY_SSL = "false"

Append to ~/.codex/config.toml (OpenAI Codex CLI uses TOML).

Terminal
claude mcp add opnsense -e OPNSENSE_HOST=https://your-opnsense-host:port -e OPNSENSE_API_KEY=your-api-key -e OPNSENSE_API_SECRET=your-api-secret -e OPNSENSE_VERIFY_SSL=false -- npx opnsense-mcp-server

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

Confirm `firewall_list_rules` and `routing_diagnostics` appear in the client's MCP tool list. Call `firewall_list_rules` and check that it returns firewall rules to verify the connection.

Troubleshooting

  1. For API authentication failures, check the API key and secret, confirm API access is enabled in OPNsense, and ensure firewall rules allow API access.
  2. For SSH failures, check the SSH credentials, confirm SSH is enabled, and verify the user's privileges.
  3. If NAT features fail, confirm SSH access is configured; the README suggests running scripts/test/test-nat-ssh.ts.

Things to try

Once connected, you can ask your AI assistant things like:

  • List the current firewall rules.
  • Analyze the NAT configuration and identify potential issues.
  • Diagnose routing from 10.0.6.0/24 to 10.0.0.0/24.
  • Create a firewall rule allowing the DMZ network to access the NAS over NFS.

Tools 18

firewall_list_rules read-only
List firewall rules.
firewall_create_rule writes
Create a firewall rule.
firewall_update_rule writes
Update an existing firewall rule.
firewall_delete_rule destructive
Delete a firewall rule.
firewall_apply_changes writes
Apply pending firewall changes.
nat_list_outbound read-only
List outbound NAT rules.
nat_set_mode writes
Set the NAT mode.
nat_create_outbound_rule writes
Create an outbound NAT rule.
Show 10 more tools
nat_fix_dmz writes
Fix DMZ NAT issues.
nat_analyze_config read-only
Analyze the NAT configuration.
arp_list read-only
List ARP table entries.
routing_diagnostics read-only
Diagnose routing issues.
routing_fix_all writes
Automatically fix routing problems.
interface_list read-only
List network interfaces.
vlan_create writes
Create a VLAN.
system_execute_command writes
Execute an OPNsense CLI command.
backup_create writes
Create a configuration backup.
service_restart writes
Restart a service.

Use cases

View and manage firewall rules.
Configure outbound NAT or diagnose DMZ NAT issues.
Analyze routing and inspect ARP entries and network interfaces.
Run OPNsense CLI operations, create backups, or restart services.

Supported clients

Claude Desktop

Listed from the project's documentation, not tested by this site.

Overview

OPNsense MCP Server is an MCP server for managing OPNsense firewalls. It lets AI assistants manage firewall rules and NAT, diagnose network issues, and perform system operations. The README lists 50+ tools covering firewall, routing, VLAN, DHCP, DNS blocklists, HAProxy, backups, and SSH/CLI.

Similar servers

Source revision c2313b49076a Data synced 2026-12-05 Read the FMRS scoring method Markdown

Maintainer badge: embed FMRS score

Paste this Markdown into your repository README to display a live score badge:

README.md
[![FollowMCP](https://followmcp.com/badges/opnsensemcp.svg)](https://followmcp.com/en/servers/opnsensemcp)