OPNsense Guard

v0.1.1
io.github.d3ltasecurity/opnsense-guard-mcp Checked 21 hours ago Published 1 month ago

Safety-first OPNsense firewall MCP: read-only by default, planned and auto-reverting writes.

Values you need

VariableWhat it is
OPNSENSE_URLrequired Firewall base URL, e.g. https://firewall.example.internal
OPNSENSE_API_KEYrequired secret API key of a least-privilege read user
OPNSENSE_API_SECRETrequired secret API secret of the read user
OPNSENSE_CA_BUNDLEoptional CA file for a self-signed firewall certificate

PyPI (uvx) discovery passed

Requires uv (https://docs.astral.sh/uv/)

Run in a terminal
claude mcp add opnsense-guard-mcp -e 'OPNSENSE_API_KEY=<OPNSENSE_API_KEY>' -e 'OPNSENSE_API_SECRET=<OPNSENSE_API_SECRET>' -e 'OPNSENSE_URL=<OPNSENSE_URL>' -- uvx opnsense-guard-mcp==0.1.1
Add to claude_desktop_config.json
{
  "mcpServers": {
    "opnsense-guard-mcp": {
      "args": [
        "opnsense-guard-mcp==0.1.1"
      ],
      "command": "uvx",
      "env": {
        "OPNSENSE_API_KEY": "<OPNSENSE_API_KEY>",
        "OPNSENSE_API_SECRET": "<OPNSENSE_API_SECRET>",
        "OPNSENSE_URL": "<OPNSENSE_URL>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "opnsense-guard-mcp": {
      "args": [
        "opnsense-guard-mcp==0.1.1"
      ],
      "command": "uvx",
      "env": {
        "OPNSENSE_API_KEY": "<OPNSENSE_API_KEY>",
        "OPNSENSE_API_SECRET": "<OPNSENSE_API_SECRET>",
        "OPNSENSE_URL": "<OPNSENSE_URL>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "OPNSENSE_API_KEY",
      "id": "opnsense-api-key",
      "password": true,
      "type": "promptString"
    },
    {
      "description": "OPNSENSE_API_SECRET",
      "id": "opnsense-api-secret",
      "password": true,
      "type": "promptString"
    },
    {
      "description": "OPNSENSE_URL",
      "id": "opnsense-url",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "opnsense-guard-mcp": {
      "args": [
        "opnsense-guard-mcp==0.1.1"
      ],
      "command": "uvx",
      "env": {
        "OPNSENSE_API_KEY": "${input:opnsense-api-key}",
        "OPNSENSE_API_SECRET": "${input:opnsense-api-secret}",
        "OPNSENSE_URL": "${input:opnsense-url}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.opnsense-guard-mcp]
command = "uvx"
args = ["opnsense-guard-mcp==0.1.1"]
env = { "OPNSENSE_API_KEY" = "<OPNSENSE_API_KEY>", "OPNSENSE_API_SECRET" = "<OPNSENSE_API_SECRET>", "OPNSENSE_URL" = "<OPNSENSE_URL>" }

For AI agents

  1. Ask the user for: OPNSENSE_URL, OPNSENSE_API_KEY, OPNSENSE_API_SECRET. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. Verify: the server should expose these tools: system_status, system_information, system_resources, service_list, posture_check, suricata_status, suricata_settings, suricata_alert_status, ….
  5. If it fails, check that the required runtime is installed (uv (https://docs.astral.sh/uv/)) and that the values above are set.

Machine-readable: install.md · manifest.json