ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที รีวิวและบัญชีผู้ใช้จะมาในขั้นถัดไป
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · อธิบายเป็นภาษาคน

OPNsense Guard

โดย d3ltasecurityรุ่น 0.1.1i★ –iรันบนเครื่อง
ชื่อใน registryio.github.d3ltasecurity/opnsense-guard-mcp

ติดตั้ง

ภาพรวม

คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)

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

สามเสาของ PopNx MCP

สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน

ใช้ทำอะไรได้

ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry

  • การเชื่อมต่อ: รันบนเครื่อง
  • ช่องทาง (transport): stdio
  • หมวด: ความปลอดภัยไซเบอร์
  • ต้องใส่ค่าเหล่านี้: OPNSENSE_URL, OPNSENSE_API_KEY, OPNSENSE_API_SECRET

ติดตั้ง

เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง

ก่อนติดตั้ง

ค่าที่ติดป้ายความลับคือกุญแจของบัญชีคุณ อย่าส่งให้ใคร และอย่าวางในแชต

ต้องเตรียมก่อน

  • PyPIติดตั้ง uv ของ Python (มีคำสั่ง uvx) ในเครื่อง

คุณใช้แอปไหน

เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”

เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json

{
  "mcpServers": {
    "opnsense-guard": {
      "command": "uvx",
      "args": [
        "opnsense-guard-mcp"
      ],
      "env": {
        "OPNSENSE_URL": "ใส่ค่าของคุณ",
        "OPNSENSE_API_KEY": "ใส่ค่าของคุณ",
        "OPNSENSE_API_SECRET": "ใส่ค่าของคุณ",
        "OPNSENSE_CA_BUNDLE": "ใส่ค่าของคุณ"
      }
    }
  }
}

พิมพ์คำสั่งนี้ใน Terminal

claude mcp add opnsense-guard --env OPNSENSE_URL='ใส่ค่าของคุณ' --env OPNSENSE_API_KEY='ใส่ค่าของคุณ' --env OPNSENSE_API_SECRET='ใส่ค่าของคุณ' --env OPNSENSE_CA_BUNDLE='ใส่ค่าของคุณ' -- uvx opnsense-guard-mcp

เติมค่าที่เว้นว่างไว้ก่อนรัน

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "opnsense-guard": {
      "command": "uvx",
      "args": [
        "opnsense-guard-mcp"
      ],
      "env": {
        "OPNSENSE_URL": "ใส่ค่าของคุณ",
        "OPNSENSE_API_KEY": "ใส่ค่าของคุณ",
        "OPNSENSE_API_SECRET": "ใส่ค่าของคุณ",
        "OPNSENSE_CA_BUNDLE": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "opnsense-guard": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "opnsense-guard-mcp"
      ],
      "env": {
        "OPNSENSE_URL": "ใส่ค่าของคุณ",
        "OPNSENSE_API_KEY": "ใส่ค่าของคุณ",
        "OPNSENSE_API_SECRET": "ใส่ค่าของคุณ",
        "OPNSENSE_CA_BUNDLE": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น

ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี

ค่าที่ต้องใส่เอง

  • OPNSENSE_URL จำเป็น env
    Firewall base URL, e.g. https://firewall.example.internal
  • OPNSENSE_API_KEY ความลับ จำเป็น env
    API key of a least-privilege read user
  • OPNSENSE_API_SECRET ความลับ จำเป็น env
    API secret of the read user
  • OPNSENSE_CA_BUNDLE env
    CA file for a self-signed firewall certificate

ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README

ทำอะไรได้บ้าง

รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง

ผลตรวจเบื้องต้นi

เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 8 พ.ย. 2569

  • ✓ ผ่าน

    ตัวตนผู้ทำตรงกับ repo

    ชื่อใน registry ยืนยันด้วยบัญชี GitHub d3ltasecurity ซึ่งเป็นเจ้าของ repo

  • … ยังไม่ตรวจ

    ยังมีคนดูแล

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • … ยังไม่ตรวจ

    มีสัญญาอนุญาต (license)

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • – ไม่เกี่ยว

    endpoint ตอบ

    ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

    ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน

  • … ยังไม่ตรวจ

    คำอธิบายเครื่องมือไม่มีคำสั่งแอบแฝง

    รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต

เทียบกับตัวอื่นในหมวด ความปลอดภัยไซเบอร์i

  • ดาวมากกว่า 0% ของอีก 996 ตัวในหมวดนี้
  • ส่งรุ่นใหม่เข้า registry ล่าสุดกว่า 77% ของอีก 996 ตัวในหมวดนี้
  • ผลตรวจเบื้องต้นดีกว่าหรือเท่ากับ 100% ของอีก 996 ตัวในหมวดนี้

เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo

คำถามที่พบบ่อย

OPNsense Guard ปลอดภัยไหม?

จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น

ต้องใช้กุญแจหรือรหัสอะไรบ้าง?

ต้องใส่ค่าเหล่านี้: OPNSENSE_URL, OPNSENSE_API_KEY, OPNSENSE_API_SECRET

ตัวนี้รันบนเครื่องหรือบนคลาวด์?

รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)

ยังมีคนดูแลอยู่ไหม?

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.1.1) เข้า registry 11 วันที่ผ่านมา

ใช้กับโปรแกรมไหนได้บ้าง?

โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Python (uv) ในเครื่องด้วย

มีตัวไหนใช้แทนได้บ้าง?

ในหมวดเดียวกันมี Action1 MCP by usefulapi, QNSQY, EchelonGraph CVE & Exposure

ตัวที่ใช้แทนได้

server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว

อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi

Read endpoints, missing updates, CVE vulnerabilities, installed software and reports in Action1.

รันบนคลาวด์อัปเดต วันนี้
ติดตั้ง

QNSQY

โดย quantumsequrity

Linux only, local: post-quantum CBOM scan, encrypt to public keys, verify. Takes no secrets

รันบนเครื่องอัปเดต วันนี้
ติดตั้ง

EchelonGraph CVE & Exposure

โดย echelongraph

CVE, KEV, EPSS, SBOM and advisory lookups; per-CVE exposure from Shodan data (© Shodan). Keyless.

บนเครื่องหรือคลาวด์อัปเดต วันนี้
ติดตั้ง

README จากผู้ทำ

เปิดอ่าน README

ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ

opnsense-guard-mcp

A safety-first MCP server for OPNsense 26.7+.

**Read-only by default. Every write is planned, policy-checked, logged, and

auto-reverted unless you confirm it.**

Status: alpha. Tested against a live OPNsense 26.7.4 with least-privilege API users: read tools, policy file, change planning with diffs, applying changes with verification and automatic revert, crash recovery, and a hash-chained audit log, over stdio or authenticated HTTPS. See DESIGN.md.

Not affiliated with Deciso B.V. "OPNsense" is a trademark of Deciso B.V.

What makes it different

opnsense-guard-mcp
Default moderead-only
Read pathGET, plus POST to exactly two search endpoints (states, rules) with a fixed three-field body; path allowlist, verb denylist, traversal/encoding rejected, redirects not followed
Writesseparate API user, exact endpoint allowlist, plan → policy check → human approval → apply → verify → auto-revert unless confirmed
Rollback on 26.7+own object-level snapshots + revert (the savepoint API is gone in 26.7); survives restarts
Guardrailsallowlist policy file: interfaces, networks, rule limits, anti-lockout
Audithash-chained JSONL (audit verify detects edits); syslog planned
Transportstdio, or Streamable HTTP that always needs a bearer token; optional TLS / mTLS
Dangerous toolsnone exist: no reboot, firmware, service control, SSH or XML edits

Quick start (read-only)

  1. In OPNsense (System → Access → Users), create a user with a scrambled password, no group (not admins) and these privileges, then create an API key for it. Skip any that aren't installed; the matching tool just reports "forbidden".
PrivilegeUsed by
Firewall: Rules [new]firewall_rules, firewall_rule_get, planning
Firewall: Aliases (view-only)firewall_aliases, planning
Status: Interfacesinterfaces
Status: Servicesservice_list
Diagnostics: ARP Tablearp_table
Diagnostics: Routing tablesrouting_table
Diagnostics: Show Statesfirewall_states
Diagnostics: Logs: Firewall: Live Viewfirewall_log
Diagnostics: Logs: Systemsystem_log
Lobby: Dashboardsystem_information, system_resources, health probe
Services: Intrusion Detectionsuricata_*
Services: DHCP: Kea(v4) / Services: Dnsmasq DNS/DHCP: Settings / Status: DHCP leases (ISC)dhcp_leases: only the one you use
System: Firmware *(optional)*system_status. It also allows installing updates, so leave it out unless you need it.

Most OPNsense privileges are not view-only (*Firewall: Aliases* is an exception): several of these also allow edits through the API. The server only sends GET requests with this key, except a search POST to two exact endpoints (diagnostics/firewall/query_states, firewall/filter/searchRule) with a body it builds itself (current, rowCount, searchPhrase); OPNsense answers those lists properly only over POST. Still keep the list short: the privileges are what OPNsense itself enforces.

  1. Install:
   pipx install opnsense-guard-mcp
  1. Configure (copy .env.example to .env, or set env vars):
   OPNSENSE_URL=https://firewall.example.internal

OPNSENSE_API_KEY=... OPNSENSE_API_SECRET=... OPNSENSE_CA_BUNDLE=/path/to/firewall-ca.pem # or OPNSENSE_VERIFY_SSL=false

  1. Check the config (does not contact the firewall):
   opnsense-guard-mcp --check
  1. Add to your MCP client, e.g. Claude Code:
   claude mcp add opnsense -- opnsense-guard-mcp --env-file /path/to/.env

HTTP mode (shared server)

HTTP never runs without authentication. The server refuses to start if:

  • there are no tokens, or
  • it binds to a non-loopback address without TLS (override with MCP_ALLOW_PLAINTEXT=true only behind a TLS proxy).
  1. Create a token per client. It is printed once; only its SHA-256 is stored:
   opnsense-guard-mcp token new --name laptop --scope read

token list shows names and scopes; token revoke --name laptop takes effect on the next request, no restart needed.

  1. Start the server:
   MCP_TRANSPORT=http MCP_HOST=0.0.0.0 MCP_PORT=8848 \

MCP_TLS_CERT=server.pem MCP_TLS_KEY=server.key \ opnsense-guard-mcp

  1. Point the client at https:// :8848/mcp with header Authorization: Bearer .
VariableDefaultPurpose
MCP_HOST / MCP_PORT127.0.0.1 / 8848listen address
OPNSENSE_GUARD_TOKENS_FILE./tokens.jsontoken hashes
MCP_TLS_CERT / MCP_TLS_KEY–serve HTTPS
MCP_TLS_CLIENT_CA–require client certificates (mTLS)
MCP_ALLOWED_HOSTSlocalhost/127.0.0.1/MCP_HOST on the portaccepted Host headers (DNS-rebinding guard)
MCP_ALLOWED_ORIGINSnonebrowser origins allowed; any other Origin is refused
MCP_RATE_LIMIT_PER_MIN120requests per token per minute
MCP_ALLOW_PLAINTEXTfalseallow plain HTTP on a non-loopback address

Repeated failed logins from one IP (10 a minute) are throttled with HTTP 429.

Claude Code and a private CA: Claude Code (Node) ignores the Windows/macOS certificate store for MCP servers. Point NODE_EXTRA_CA_CERTS at your CA file in the env block of ~/.claude/settings.json, then fully quit and reopen Claude, or the connection fails with UNABLE_TO_VERIFY_LEAF_SIGNATURE.

Running in Docker

The image runs as a non-root user and keeps its audit log, change journal and tokens in /data.

docker build -t opnsense-guard-mcp .

stdio, for a local MCP client

docker run -i --rm --env-file .env -v guard-data:/data opnsense-guard-mcp

HTTP: create a token, then serve (put the TLS files in the volume or mount them)

docker run --rm -v guard-data:/data opnsense-guard-mcp token new --name laptop --scope read docker run -d --name opnsense-guard --env-file .env -v guard-data:/data -p 8848:8848 \ -e MCP_TRANSPORT=http -e MCP_HOST=0.0.0.0 -e MCP_ALLOWED_HOSTS=mcp.example.internal:8848 \ -e MCP_TLS_CERT=/data/tls/server.pem -e MCP_TLS_KEY=/data/tls/server.key \ opnsense-guard-mcp

Mount a policy file and set OPNSENSE_GUARD_POLICY to enable writes. Stop the container with docker stop (not kill) so unconfirmed changes are reverted.

Policy and planning

Without a policy.yaml the server is read-only. To enable planning, copy policy.example.yaml to policy.yaml (or point OPNSENSE_GUARD_POLICY at it) and edit it. Unknown keys are an error.

Planning tools (rule_plan, alias_plan) read the current state, apply every policy check, and return a diff plus the reasons for any refusal. They never change the firewall. Example result for a refused rule:

+ [wan] pass in inet any from any to any '[mcp]'

interface 'wan' is not in the allowed interfaces any -> any pass rules are forbidden inbound pass rules on WAN are forbidden every rule written by this server must have logging on

Built-in guardrails: only listed interfaces/actions/directions; every IP inside allow_networks; no any→any pass, WAN inbound pass, floating rules or rules without logging; edit only rules tagged [mcp] (unless only_modify_own: false); anti-lockout (no block rule that matches this server's own IP, and only new pass rules on the interface it reaches the API through). A new block or reject rule there is allowed when the same plan adds a pass rule with a lower sequence that provably lets every MCP host reach the API (source covers the host IP, destination any/(self)/the API IP, TCP, port covers the API port); both rules need a sequence.

Applying changes

Change tools appear only when both the policy is in write mode and a second, write-capable API user is configured:

OPNSENSE_WRITE_API_KEY=...      # a different OPNsense user than the read one

OPNSENSE_WRITE_API_SECRET=...

Give that user exactly two privileges: Firewall: Rules [new] and Firewall: Alias: Edit, no group. (Plain *Firewall: Aliases* is view-only: it allows search/get but not addItem/setItem/delItem/reconfigure.) Over HTTP, the change tools need a token with --scope write.

The flow:

  1. rule_plan / alias_plan → diff + plan_id (changes nothing).
  2. change_apply(plan_id) → asks the human to approve the diff (MCP elicitation where the client supports it; otherwise the tool returns the diff and must be called again with user_confirmed=true). Then it re-reads the firewall (refuses if anything drifted since planning), stores the before-state, writes, applies, reads everything back to verify, and checks the API is still reachable. Any failure → everything is reverted.
  3. The change is pending: it is reverted automatically after confirm_timeout_s (default 60 s) unless change_confirm is called.
  4. change_rollback undoes a pending or confirmed change. A revert never overwrites an object someone else edited meanwhile (status conflict).

Unconfirmed changes are also reverted when the server stops and, after a crash, when it starts again. Only one change can be open at a time, and max_changes_per_hour is enforced.

Limits, stated plainly

  • The revert timer runs on the MCP host. If a change cuts that host off from the firewall API, the revert cannot reach it. The anti-lockout policy and the health probe right after apply exist to prevent and catch this, but they are not the same as the firewall-side savepoint older OPNsense versions had.
  • Without elicitation, user_confirmed=true is the model's word that the user agreed. The audit log records which method was used.

Audit log

Every plan (allowed or refused) and server start is written to $OPNSENSE_GUARD_DATA_DIR/audit.jsonl (default ./data). Each line holds the hash of the previous one, so edits, deletions and reordering are detectable:

opnsense-guard-mcp audit verify

opnsense-guard-mcp audit tail -n 20

Credentials are never written to it.

Tools (read-only)

system_status, system_information, system_resources, service_list, posture_check, suricata_status, suricata_settings, suricata_alert_status, firewall_rules, firewall_rule_get, firewall_aliases, firewall_log, firewall_states, system_log, interfaces, arp_table, routing_table, dhcp_leases, raw_get, policy_show, security_audit.

In write mode also: rule_plan, alias_plan, plan_get, audit_tail. With write credentials also: change_apply, change_confirm, change_rollback, change_list, change_get.

firewall_rules returns one line per rule (50 by default) so a full ruleset fits in a chat; pass detail=true for the raw OPNsense rows, or use firewall_rule_get for one rule.

Over HTTP, a read token still sees the change tools in the tool list, but calling one is refused (needs a token with scope 'write').

Development

python -m venv .venv && . .venv/bin/activate

pip install -e ".[dev]" ruff check . && mypy && pytest

Security

See SECURITY.md. Please report vulnerabilities privately.

Licence

MIT. See LICENSE.

ถาม PopNx