coreyhines/opnsense-mcp
An MCP server for querying and administering an OPNsense firewall from MCP clients, locally via STDIO or centrally via authenticated streamable HTTP at /mcp.
Inspect network state: ARP/NDP, DHCP leases, LLDP, interfaces, system status, PF states/statistics, logs, packet captures, and ping/reachability.
Manage firewall aliases and filter rules, including create/update/toggle/delete/apply and interface groups.
Manage DHCP reservations, ranges, options, per-subnet DNS, router advertisements, and lease deletion.
Administer static routes, gateways, and FRR/BGP peering status and neighbors.
Configure IPv6 NPTv6, virtual IPs, router advertisements, and ULA planning/application.
Create/manage 802.1Q VLANs, loopbacks, and interface addressing.
Control outbound NAT and traffic shaping: pipes, queues, rules, presets, audits, and snapshots.
Manage Unbound DNS overrides and configuration backups/revisions/snapshots/diffs/downloads.
Support confirmation-token safety flows and Bearer-token authentication for HTTP deployment.
Provides tools for managing OPNsense firewall operations, including ARP, DHCP, logs, rules, interfaces, system status, and packet capture.

OPNsense MCP Server
MCP server for OPNsense firewall operations (ARP, DHCP, logs, rules, interfaces, system status, packet capture).
Use one of two deployment modes:
STDIO(local): best for Cursor/Claude Code/Continue running the server process directly.Streamable HTTP (centralized): best for a shared, long-lived service over HTTPS, at
/mcp.
Demo
Query your firewall with Claude Code CLI. Live example with real network data:

Related MCP server: OPNSense MCP Server
Why This Exists
Built this because SSH'ing into the firewall to check logs or grab ARP data got old fast. Now you can ask Claude:
"What's happening on the network right now?"
"Show me the latest firewall blocks"
"Tell me about that host"
"Capture packets from the suspicious traffic"
Claude handles the firewall query via MCP and gives you analysis + context in one shot. Works on homelab or business deployments equally well.
Quick Start
1) Local setup (required for both modes)
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
cp examples/.env.example ~/.envEdit ~/.env:
OPNSENSE_API_KEY=your_api_key
OPNSENSE_API_SECRET=your_api_secret
OPNSENSE_FIREWALL_HOST=your.firewall.host
# HTTP transports only; stdio ignores it. Generate with: openssl rand -hex 32
MCP_SECRET_KEY=2) Choose mode
Mode A: STDIO (local IDE/client)
Configure your MCP client to launch mcp_start.sh:
{
"mcpServers": {
"opnsense-mcp": {
"command": "/bin/bash",
"args": ["/absolute/path/to/opnsense-mcp/mcp_start.sh"],
"cwd": "/absolute/path/to/opnsense-mcp"
}
}
}See full guide: docs/GETTING_STARTED.md.
Mode B: streamable HTTP (centralized service)
Run the Linux installer (Podman + quadlet + Caddy TLS):
sudo bash deploy/install.shClients connect to:
https://<your-hostname>/mcpThe deployed container serves streamable HTTP only. There is no /sse
endpoint and no /health route; both answer 404.
Every request must send Authorization: Bearer <MCP_SECRET_KEY>. The server
refuses to start on an HTTP transport when the key is blank or a placeholder.
See deployment docs:
What Is Available
Primary tools:
Discovery:
arp,dhcp,lldpMonitoring:
system,get_logs,packet_captureFirewall rules:
fw_rules,mkfw_rule,set_fw_rule,toggle_fw_rule,rmfw_ruleInterfaces:
interface_list
Full reference: docs/REFERENCE/FUNCTION_REFERENCE.md
What's New (June 2026)
Five PRs landed recently. See docs/FEATURES_UPDATE.md for full details and usage examples.
Streamable HTTP transport — native FastMCP server supports
stdioandstreamable-http(MCP spec 2025-03-26).deploy/install.shdeploys streamable HTTP at/mcp.DHCP client_id (DUID) support —
mk_dhcp_hostandmove_dhcp_hostaccept an optional DUID for stateful DHCPv6 matching.Semver image tags — main builds are tagged as a prerelease of the next patch after the
pyproject.tomlversion (1.0.1-dev.a1b2c3dafter 1.0.0) or release tags (1.0.0).Container registry — pinned tags only;
:latestis rejected. SetOPNSENSE_MCP_IMAGE_REPO, or build locally with--build-local.install.sh readonly fix — Bash
readonlyclash betweeninstall.shandlib.shresolved.
Use Cases
Homelab network troubleshooting — Query firewall logs from terminal, get Claude's take on what's happening
Security operations — Automate incident triage: "Analyze the last hour of blocks"
Infrastructure automation — Write MCP-aware scripts that query firewall state dynamically
DevOps troubleshooting — Quick VLAN/interface status checks without SSH sessions
Feedback
First 10 users get feedback incorporated into the tool. If you find bugs or have ideas, file an issue or discussion.
Where to look first when reviewing
scripts/risk_map.py ranks source files by defect likelihood from git history —
churn times fix density — so a review reads the risky files first and can stop
early. It finds no bugs; it finds where they concentrate.
python3 scripts/risk_map.py --top 15CI runs it on every pull request alongside a complexity report (radon) and a
security-pattern pass (bandit) in the advisory Insights workflow, which
never blocks a merge. Thresholds that gate the build come later, once the
numbers are trusted.
Documentation Map
Start here:
docs/GETTING_STARTED.mdClaude Code specifics:
docs/CLAUDE_CODE_INTEGRATION.mdCentralized deploy spec:
docs/CENTRALIZED_DEPLOY_SPEC.mdContributor guide:
docs/DEVELOPMENT/CONTRIBUTING.mdBrand assets:
docs/assets/
License
This project is released under the MIT License.
Available Tools
14 toolsaliasB
Manage firewall aliases, the named address and port groups rules reference. Call action='help' for each action's fields and rules.
Inputs: action (required), name, type, uuid, +6 more.
arpC
Show ARP/NDP table
Inputs: ip, mac, search.
bgpC
FRR BGP: peering state and neighbours. FRR ships disabled, so an empty result usually means it has not been turned on yet. Call action='help' for each action's fields and rules.
Inputs: action (required), bfd, uuid, apply, +11 more.
config_backupC
Configuration backups, revision history and boot environment snapshots. Call action='help' for each action's fields and rules.
Inputs: action (required), limit, rev_a, rev_b, +3 more.
dhcpB
DHCP: leases, static reservations, ranges, options and per-subnet DNS. Call action='help' for each action's fields and rules.
Inputs: action (required), ip, mac, tag, +27 more.
diagnosticsA
Read-only views of what the firewall currently sees: neighbours, interfaces, state table, logs, captures, and reachability. Call action='help' for each action's fields and rules.
Inputs: action (required), ip, raw, count, +27 more.
dns_overrideA
Manage Unbound host overrides. Call action='help' for each action's fields and rules.
Inputs: action (required), mode, uuid, apply, +6 more.
fw_ruleC
Firewall filter rules, and the interface groups a rule can target so one rule covers several networks. Call action='help' for each action's fields and rules.
Inputs: action (required), log, uuid, apply, +20 more.
interface_deviceC
Create the devices interfaces are built on: 802.1Q VLANs and loopbacks. Call action='help' for each action's fields and rules.
Inputs: action (required), pcp, tag, uuid, +11 more.
ipv6C
IPv6: NPTv6 prefix translation, virtual IPs, router advertisements, and planning or applying a ULA conversion. Call action='help' for each action's fields and rules.
Inputs: action (required), mode, uuid, vhid, +18 more.
nat_outboundC
Outbound source NAT rules and how they are generated. Call action='help' for each action's fields and rules.
Inputs: action (required), mode, uuid, apply, +9 more.
routingA
Static routes and gateways. Note routes use enabled and gateways use disabled, so a toggle means the opposite thing on each. Call action='help' for each action's fields and rules.
Inputs: action (required), name, uuid, apply, +9 more.
shaperB
Traffic shaper: pipes, queues, rules, and applying or auditing them. Call action='help' for each action's fields and rules.
Inputs: action (required), uuid, apply, proto, +27 more.
systemA
Show system status information
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Each tool generally maps to a distinct OPNsense module, so firewall rules, NAT, aliases, routing, DHCP, and other concerns are clearly separated. Minor overlap exists among system, diagnostics, and arp for read-only status information, and ipv6 is broad, but the descriptions provide enough boundaries.
Tool names follow a consistent lowercase domain-module convention, with snake_case for compound names like config_backup, dns_override, and nat_outbound. They do not use a verb-noun pattern, but the naming is predictable and uniform across the set.
Fourteen tools is well within the ideal range, and each tool represents a coherent functional area of an OPNsense firewall. There are no redundant or filler tools that make the surface feel bloated.
The set covers core firewall workflows: filtering, NAT, aliases, routing, DHCP, DNS overrides, traffic shaping, diagnostics, and backups. However, major OPNsense areas such as VPN configuration, certificate management, interface assignment, and general Unbound settings are absent, which could create dead ends for common tasks.
Maintenance
Related MCP Connectors
Tailscale device, route, DNS, key, user, and ACL management over MCP and CLI.
Manage CloudPepper servers, Odoo instances, backups, and deployments over MCP.
Remote MCP firewall with barter protocol: identity, threat-intel, IoC lookup.
Syslog receiver and MCP server for homelab log intelligence.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server implementation for managing OPNsense firewalls. This server allows Claude and other MCP-compatible clients to interact with all features exposed by the OPNsense API.1AGPL 3.0
- AlicenseCqualityBmaintenanceA server that enables managing OPNSense firewalls through natural language interactions with Claude Desktop, supporting VLAN management, firewall rules configuration, and network interface queries.64102 npm97MIT
- AlicenseNot gradedqualityDmaintenanceA modular MCP server that provides access to over 2,000 OPNsense firewall management methods through 88 specialized tools. It enables AI assistants to securely manage firewall rules, network interfaces, and system diagnostics using a type-safe TypeScript interface.126 npm95MIT
- AlicenseAqualityDmaintenanceSlim OPNsense MCP Server — 62 tools for managing firewall infrastructure via the OPNsense REST API. Covers DNS/Unbound, Firewall rules, Diagnostics, Interfaces, DHCP (ISC + Kea), System/Backups, ACME/Let's Encrypt, and Firmware. No SSH, no shell, API-only with 3 runtime dependencies. AGPL-3.0 + Commercial dual-licensed.10054 npm2AGPL 3.0