# OPNsense MCP Server

> Manage OPNsense firewalls and networks through MCP.

- **URL**: https://followmcp.com/en/servers/opnsensemcp
- **Category**: Other
- **Origin**: Community
- **Stars**: 100
- **FMRS Score**: 45/100 (Grade D)
- **Source**: https://github.com/vespo92/OPNSenseMCP
- **Transports**: stdio (local process)
- **Runtimes**: Node.js 18+, Bun 1.1.39+
- **Auth**: API key / credential required

## 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.

## 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
- 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.

## Client config (JSON)
```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"
      }
    }
  }
}
```

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