OPNSense MCP

OPNSense MCP

MCP Server for OPNSense Firewall Management and API access

26
Stars
3
Forks
5
Releases

Overview

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. It exposes MCP tools across firewall, NAT, network diagnostics, SSH/CLI execution, and additional capabilities such as VLAN management, DHCP lease viewing, DNS blocklists, and HAProxy support. NAT operations are SSH-based to support outbound NAT rule management and various NAT modes with automated DMZ resolution and XML config manipulation. The server provides routing diagnostics, ARP inspection with vendor IDs, interface configuration handling, and auto-fix capabilities. It also supports executing OPNsense CLI commands, manipulating configuration files, and managing services. The project emphasizes IaC readiness, configuration backups/restores, and workload automation. The MCP server is designed to be used with Claude Desktop or other LLM-driven automation pipelines to streamline firewall administration and troubleshooting.

Details

Owner
vespo92
Language
TypeScript
License
MIT License
Updated
2025-12-07

Features

Firewall Management

CRUD operations for firewall rules, handling of API-created automation rules, inter-VLAN routing, batch rule creation, and robust persistence with multiple fallback methods.

NAT Configuration (SSH-based)

Outbound NAT rule management, NAT mode control (automatic/hybrid/manual/disabled), No-NAT exception rules for inter-VLAN traffic, automated DMZ NAT issue resolution, and direct XML configuration manipulation.

Network Diagnostics

Comprehensive routing analysis, ARP table inspection with vendor identification, interface configuration management, network connectivity troubleshooting, and auto-fix capabilities for common issues.

SSH/CLI Execution

Direct command execution on OPNsense, configuration file manipulation, system-level operations not available via API, and service management and restarts.

Additional Capabilities

VLAN management, DHCP lease viewing and management, DNS blocklist configuration, HAProxy load balancer support, configuration backup and restore, and Infrastructure as Code (IaC) support.

Audience

AI assistantEnable Claude or similar LLMs to directly manage OPNsense firewall configurations via MCP.
Network administratorsUse MCP to automate firewall rules, NAT configurations, and diagnostic workflows for OPNsense deployments.
Developers / integratorsIntegrate MCP-enabled OPNsense control into automation workflows and IaC pipelines.

Tags

OPNsenseMCPfirewallNATSSHCLIVLANDHCPDNSHAProxyAutomationIaCClaude