coreyhines/opnsense-mcp

coreyhines/opnsense-mcp

OPNsense firewall operations via API & mcp. Query ARP, DHCP, firewall rules, logs, interfaces, system status, and packet capture via STDIO or SSE.

Category
Visit Server

README

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.
  • SSE (centralized): best for shared, long-lived service over HTTPS.

Demo

Query your firewall with Claude Code CLI. Live example with real network data:

opnsense-mcp demo

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 ~/.env

Edit ~/.env:

OPNSENSE_API_KEY=your_api_key
OPNSENSE_API_SECRET=your_api_secret
OPNSENSE_FIREWALL_HOST=your.firewall.host
MCP_SECRET_KEY=replace_me

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: SSE (centralized service)

Run the Linux installer (Podman + quadlet + Caddy TLS):

sudo bash deploy/install.sh

Clients connect to:

https://<your-hostname>/sse

See deployment docs:

What Is Available

Primary tools:

  • Discovery: arp, dhcp, lldp
  • Monitoring: system, get_logs, packet_capture
  • Firewall rules: fw_rules, mkfw_rule, rmfw_rule, ssh_fw_rule
  • Interfaces: interface_list

Full reference: docs/REFERENCE/FUNCTION_REFERENCE.md

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.

Documentation Map

License

This project is released under the MIT License.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured