Skip to main content
Glama
lucamarien

OPNsense MCP Server

by lucamarien

OPNsense MCP 服务器

一个安全的模型上下文协议(MCP)服务器,用于通过 AI 助手(如 Claude Code、Cursor 及其他兼容 MCP 的工具)管理 OPNsense 防火墙。

81 个工具,覆盖 10 个领域:系统、防火墙、网络、DNS、DHCP、VPN、HAProxy、服务、诊断和安全。

要求

  • Python 3.11+

  • OPNsense 24.7 或更新版本 — MCP 服务器依赖 OPNsense 24.7 中引入的基于 MVC 的 API 端点。旧版本使用不同的 API 结构,不兼容。服务器在首次连接时自动检测 OPNsense 版本,并选择正确的端点命名方式(25.7 之前为 camelCase,25.7+ 为 snake_case)。OPNsense 26.x 完全受支持,包括其更改后的固件状态响应格式。

Related MCP server: OPNsense MCP Server

安全模型

该 MCP 服务器以安全为首要设计目标:

  • 默认只读 — 写操作需要通过 OPNSENSE_ALLOW_WRITES=true 显式启用

  • 保存点/回滚(仅限 OPNsense < 26.7) — 在 OPNsense 仍提供保存点 API 的情况下,防火墙修改使用其内置的 60 秒自动还原机制;更改必须被明确确认,否则会自动回滚。OPNsense 26.7 上游移除了该 API — 服务器在运行时检测缺失的端点,并立即应用防火墙更改,无自动回滚

  • 端点阻止列表 — 危险端点(haltrebootpowerofffirmware update/upgrade)在 API 客户端层面被硬性阻止,永远无法被调用

  • 仅 API — 无 SSH 访问、无命令执行、无直接配置文件操作

  • 本地传输 — 仅 STDIO,无网络暴露的 HTTP/SSE 端点

  • 不暴露凭据 — API 密钥永远不会出现在工具输出、日志或错误消息中

  • 输入验证 — 主机名参数针对 shell 元字符注入进行验证

  • 敏感数据剥离 — 配置备份默认剥离密码和密钥

快速开始

1. 创建 OPNsense API 密钥

  1. 登录您的 OPNsense Web 界面

  2. 前往 系统 > 访问 > 用户

  3. 编辑现有用户或创建专用 API 用户:

    • 对于生产环境,创建一个专用用户(例如 mcp-api),仅授予所需权限

    • 对于只读访问,将该用户分配到具有只读 API 访问权限的组

  4. 向下滚动到 API 密钥 部分,点击 + 按钮

  5. 将生成一对密钥/机密,并下载一个文件(apikey.txt

  6. 该文件包含两行 — key=your-api-key-heresecret=your-api-secret-here

  7. 安全存储这些凭据 — 机密无法再次从 OPNsense 中检索

提示: 对于只读设置(建议入门使用),你无需更改任何权限 — 默认 API 访问足以使用所有只读工具。

2. 安装

# Using pip
pip install opnsense-mcp-server

# Using uv (recommended for isolated environments)
uv pip install opnsense-mcp-server

# Using Docker
docker pull uhlenheide/opnsense-mcp-server

# From source
git clone https://github.com/lucamarien/opnsense-mcp-server
cd opnsense-mcp-server
pip install -e .

Docker 镜像: 官方镜像是 uhlenheide/opnsense-mcp-server,由 .github/workflows/publish-docker.yml 在每个 v* 标签上从本仓库发布。不存在 lucamarien/opnsense-mcp-server 镜像 — 早期 README 版本误用了该名称。

3. 配置你的 AI 助手

Claude Code

添加到你的项目 .mcp.json

{
  "mcpServers": {
    "opnsense": {
      "command": "opnsense-mcp",
      "env": {
        "OPNSENSE_URL": "https://192.168.1.1/api",
        "OPNSENSE_API_KEY": "your-api-key-here",
        "OPNSENSE_API_SECRET": "your-api-secret-here",
        "OPNSENSE_VERIFY_SSL": "false",
        "OPNSENSE_ALLOW_WRITES": "false"
      }
    }
  }
}

替代方案: 如果 opnsense-mcp CLI 不在你的 PATH 中,可使用 "command": "python", "args": ["-m", "opnsense_mcp"]

或者全局添加到 ~/.claude/claude_code_config.json

Claude Code(Docker)

{
  "mcpServers": {
    "opnsense": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "OPNSENSE_URL=https://192.168.1.1/api",
        "-e", "OPNSENSE_API_KEY=your-api-key-here",
        "-e", "OPNSENSE_API_SECRET=your-api-secret-here",
        "-e", "OPNSENSE_VERIFY_SSL=false",
        "-e", "OPNSENSE_ALLOW_WRITES=false",
        "uhlenheide/opnsense-mcp-server"
      ]
    }
  }
}

Cursor

添加到你的 Cursor MCP 设置(设置 > MCP):

{
  "mcpServers": {
    "opnsense": {
      "command": "opnsense-mcp",
      "env": {
        "OPNSENSE_URL": "https://192.168.1.1/api",
        "OPNSENSE_API_KEY": "your-api-key-here",
        "OPNSENSE_API_SECRET": "your-api-secret-here",
        "OPNSENSE_VERIFY_SSL": "false"
      }
    }
  }
}

配置

环境变量

默认值

描述

OPNSENSE_URL

(必填)

OPNsense API 基础 URL(必须以 /api 结尾)

OPNSENSE_API_KEY

(必填)

来自 OPNsense 用户设置的 API 密钥

OPNSENSE_API_SECRET

(必填)

来自 OPNsense 用户设置的 API 机密

OPNSENSE_VERIFY_SSL

true

验证 SSL 证书(自签名证书使用 false

OPNSENSE_ALLOW_WRITES

false

启用写操作(防火墙规则、服务控制)

自定义端口: 如果你的 OPNsense Web GUI 运行在非标准端口(例如 10443),请在 URL 中包含它:https://192.168.1.1:10443/api

可用工具(81 个)

系统(7 个工具)

工具

描述

opn_system_status

系统信息,包括固件版本、产品名称和架构

opn_list_services

列出所有服务及其运行状态。参数:searchlimit

opn_gateway_status

网关可用性、延迟和 dpinger 健康检查

opn_download_config

下载 config.xml 备份,可选择剥离敏感数据。参数:include_sensitive(默认:false — 密码和密钥会被编辑)

opn_scan_config

扫描完整配置,将其解析为各节,并收集运行时清单(固件、插件、DHCP、DNS、接口、服务)。结果按会话缓存。参数:force

opn_get_config_section

获取特定配置节作为结构化 JSON。参数:sectioninclude_sensitive

opn_mcp_info

MCP 服务器版本、写模式状态、检测到的 OPNsense 版本、API 风格,以及防火墙写入是否仍受保存点/回滚保护

网络(5 个工具)

工具

描述

opn_interface_stats

每个接口的流量统计(字节入/出、数据包、错误)

opn_arp_table

ARP 表,显示 IP 到 MAC 地址的映射

opn_ndp_table

NDP(邻居发现协议)表,显示 IPv6 到 MAC 地址的映射

opn_ipv6_status

所有接口的 IPv6 配置和地址状态(方法、实时地址、摘要)

opn_list_static_routes

已配置的静态路由。参数:searchlimit

防火墙(21 个工具)

工具

描述

写入

opn_list_firewall_rules

列出 MVC 防火墙过滤规则。参数:searchlimit

opn_list_firewall_aliases

列出别名定义(IP 列表、端口组、GeoIP、URL)。参数:searchlimit

opn_list_nat_rules

列出 NAT 端口转发(DNAT)规则。参数:searchlimit

opn_list_firewall_categories

列出防火墙规则类别及其 UUID。参数:searchlimit

opn_firewall_log

最近的防火墙日志条目,支持客户端过滤。参数:source_ipdestination_ipactioninterfacelimit

opn_confirm_changes

确认待定的更改,取消 60 秒自动回滚(OPNsense < 26.7;在 26.7+ 上为无操作,返回 not_applicable)。参数:revision

opn_toggle_firewall_rule

使用保存点切换规则的启用/禁用状态(OPNsense < 26.7)。参数:uuid

opn_add_firewall_rule

使用保存点创建新的过滤规则(OPNsense < 26.7)。参数:actiondirectioninterfaceip_protocolprotocolsource_netdestination_netdestination_portdescription

opn_delete_firewall_rule

使用保存点按 UUID 删除过滤规则(OPNsense < 26.7)。参数:uuid

opn_add_alias

创建新的别名。参数:namealias_typecontentdescription

opn_add_nat_rule

使用保存点创建 NAT 端口转发规则(OPNsense < 26.7)。参数:destination_porttarget_ipinterfaceprotocoltarget_portdescription

opn_add_firewall_category

创建新的防火墙规则类别。参数:namecolor

opn_delete_firewall_category

使用保存点按 UUID 删除防火墙规则类别(OPNsense < 26.7)。参数:uuid

opn_set_rule_categories

使用保存点为防火墙规则分配类别(OPNsense < 26.7)。参数:uuidcategories

opn_add_icmpv6_rules

根据 RFC 4890 创建 IPv6 运行所需的必要 ICMPv6 规则(NDP、RA、ping6)。参数:interface

opn_update_alias

更新现有别名(name、content、type、description)。读-改-写。参数:uuidnamecontentdescriptionalias_typeenabled

opn_delete_alias

按 UUID 删除别名。先检查规则引用。参数:uuid

opn_toggle_alias

切换别名的启用/禁用状态。参数:uuid

opn_update_firewall_rule

使用保存点更新过滤规则字段(OPNsense < 26.7)。参数:uuidactiondirectioninterfaceip_protocolprotocolsource_netsource_notsource_portdestination_netdestination_notdestination_portgatewaylogquicksequencecategoriesdescriptionenabled

opn_update_nat_rule

使用保存点更新 NAT 端口转发规则(OPNsense < 26.7)。参数:uuidinterfaceprotocoldestination_porttarget_iptarget_portdescriptionenabled

opn_delete_nat_rule

使用保存点按 UUID 删除 NAT 端口转发规则(OPNsense < 26.7)。参数:uuid

注意: 保存点保护仅存在于 OPNsense < 26.7。在 26.7+ 上,这些工具会立即且永久地应用更改——请参阅写入操作与保存点

DNS(13 个工具)

工具

描述

写入

opn_list_dns_overrides

Unbound 主机覆盖(本地 DNS 记录)。参数:searchlimit

opn_list_dns_forwards

DNS 转发域(特定域服务器)。参数:searchlimit

opn_dns_stats

Unbound 解析器统计(查询、缓存命中、运行时间)

opn_reconfigure_unbound

应用待定的 DNS 解析器配置更改

opn_add_dns_override

添加 Unbound DNS 主机覆盖(A/AAAA 记录)并立即应用。参数:hostnamedomainserverdescription

opn_list_dnsbl

列出 DNSBL 黑名单配置,包含提供商和状态。参数:searchlimit

opn_get_dnsbl

按 UUID 获取完整的 DNSBL 配置(提供商、允许列表、设置)。参数:uuid

opn_set_dnsbl

更新 DNSBL 设置(读-改-写)。参数:uuidenabledprovidersallowlistsblocklistswildcards

opn_add_dnsbl_allowlist

将域名添加到 DNSBL 允许列表而不覆盖。参数:uuiddomains

opn_remove_dnsbl_allowlist

从 DNSBL 允许列表中移除域名。参数:uuiddomains

opn_update_dnsbl

重新加载 DNSBL 黑名单文件并重启 Unbound(无配置更改,恢复工具)

opn_update_dns_override

更新 Unbound DNS 主机覆盖并立即应用。参数:uuidhostnamedomainserverdescriptionenabled

opn_delete_dns_override

删除 Unbound DNS 主机覆盖并立即应用。参数:uuid

DHCP(8 个工具)

工具

描述

写入

opn_list_dhcp_leases

来自 ISC DHCP 服务器的活动 DHCPv4 租约

opn_list_kea_leases

来自 Kea DHCP 服务器的 DHCPv4 租约。参数:searchlimit

opn_list_dnsmasq_leases

来自 dnsmasq DNS/DHCP 服务器的 DHCPv4 和 DHCPv6 租约。参数:searchlimit

opn_list_dnsmasq_ranges

已配置的 DHCP 地址范围(包括带 RA 配置的 DHCPv4 和 DHCPv6)。参数:searchlimit

opn_add_dnsmasq_range

创建新的 DHCP 范围(IPv4 或带路由器通告配置的 IPv6)。参数:interfacestart_addrend_addrprefix_lenra_modelease_timedescription

opn_reconfigure_dnsmasq

应用待处理的 dnsmasq DNS/DHCP 配置更改

opn_update_dnsmasq_range

更新 DHCP 范围(地址、租约时间、RA 配置)并应用。参数:uuidinterfacestart_addrend_addrprefix_lenra_modelease_timedescriptionenabled

opn_delete_dnsmasq_range

按 UUID 删除 DHCP 范围并应用。参数:uuid

VPN(3 个工具)

工具

描述

opn_wireguard_status

WireGuard 隧道和对等体状态(需要 os-wireguard 插件)

opn_ipsec_status

IPsec VPN 隧道状态 — IKE(阶段 1)和 ESP/AH(阶段 2)会话

opn_openvpn_status

OpenVPN 连接状态 — 实例、会话和路由

HAProxy(8 个工具)

HAProxy 负载均衡器的完整配置管理(需要 os-haproxy 插件)。

工具

描述

写入

opn_haproxy_status

HAProxy 服务状态和后端健康检查

opn_haproxy_search

按类型搜索 HAProxy 资源。参数:resource_type(frontends/backends/servers/actions/acls/healthchecks/errorfiles/resolvers/mailers)、searchlimit

opn_haproxy_get

获取特定资源的详细配置。参数:resource_typeuuid

opn_haproxy_configtest

在应用前验证 HAProxy 配置语法

opn_haproxy_add

创建新的 HAProxy 资源。参数:resource_typeconfig(字段值字典)

opn_haproxy_update

更新现有 HAProxy 资源(部分更新)。参数:resource_typeuuidconfig

opn_haproxy_delete

按 UUID 删除 HAProxy 资源。参数:resource_typeuuid

opn_reconfigure_haproxy

应用待处理的 HAProxy 配置更改

注意: HAProxy 更改不使用保存点保护 — 它们在重新配置时立即生效。始终在 opn_reconfigure_haproxy 之前调用 opn_haproxy_configtest

服务(11 个工具)

工具

描述

写入

opn_list_acme_certs

ACME/Let's Encrypt 证书及其状态。参数:searchlimit

opn_list_cron_jobs

计划中的 cron 作业。参数:searchlimit

opn_crowdsec_status

CrowdSec 安全引擎状态和活动决策

opn_crowdsec_alerts

CrowdSec 安全警报(检测到的威胁)。参数:searchlimit

opn_list_ddns_accounts

动态 DNS 账户及其更新状态。参数:searchlimit

opn_add_ddns_account

创建新的动态 DNS 账户。参数:servicehostnameusernamepasswordcheckipinterfacedescription

opn_reconfigure_ddclient

应用待处理的动态 DNS 配置更改

opn_update_ddns_account

更新动态 DNS 账户(密码为只写)。参数:uuidservicehostnameusernamepasswordcheckipinterfacedescriptionenabled

opn_delete_ddns_account

按 UUID 删除动态 DNS 账户。参数:uuid

opn_mdns_repeater_status

mDNS Repeater 状态和配置(已启用、接口、阻止列表)。需要 os-mdns-repeater 插件

opn_configure_mdns_repeater

配置 mDNS Repeater 以实现跨 VLAN 设备发现(HomeKit、Chromecast、AirPlay)。参数:enabledinterfaces

诊断(4 个工具)

工具

描述

opn_ping

从防火墙 ping 主机以测试连通性。参数:hostcount(1-10,默认 3)

opn_traceroute

追踪到目的地的网络路径。参数:hostprotocol(ICMP/UDP/TCP)、ip_version(4/6)

opn_dns_lookup

从防火墙进行 DNS 查询。参数:hostnameserver(可选的自定义 DNS 服务器)

opn_pf_states

查询活动的 PF 状态表。参数:searchlimit(最大 1000)

安全(1 个工具)

工具

描述

opn_security_audit

全面的 11 个领域安全审计:固件、防火墙规则(MVC + 旧版、端口分组、不安全协议)、NAT 转发、DNS 安全(DNSSEC、DoT)、系统加固(SSH、HTTPS、syslog)、服务、证书(ACME + 系统 + CA)、VPN(WireGuard 配置、IPsec、OpenVPN)、HAProxy(标头、健康检查)、网关。发现结果标记有 PCI DSS v4.0、BSI IT-Grundschutz、NIST 800-41、CIS 合规性参考。

写入操作和保存点

写入操作需要 OPNSENSE_ALLOW_WRITES=true。在 OPNsense < 26.7 上,防火墙更改还通过 OPNsense 的保存点机制进行:

  1. 在任何防火墙更改之前,自动创建保存点

  2. 应用更改(规则切换、添加或删除)

  3. 60 秒倒计时开始 — 如果未确认,OPNsense 自动还原更改

  4. 使用 opn_confirm_changes 配合返回的 revision 使更改永久生效

在这些版本上,如果 AI 助手做出了导致您被锁定的错误防火墙更改,更改会在 60 秒内自动还原。

OPNsense 26.7 上游移除了保存点/回滚 API,因此在 26.7+ 上没有自动还原。 服务器不会硬编码版本截止点:它会在首次防火墙写入时探测保存点端点,如果 OPNsense 回答该端点不存在,则在会话的其余部分降级为直接应用。检查 opn_mcp_info — 其 savepoint_support 字段报告 truefalse,如果尚未探测写入则为 null。写入工具随后返回空的 revisionopn_confirm_changesstatus: "not_applicable" 应答,并且每个防火墙更改都是即时且永久的。

警告: 在 OPNsense 26.7+ 上,在启用写入之前请进行配置备份(opn_download_config,或 System > Configuration > Backups),并保持对设备的带外访问 — 导致您被锁定的规则不会自行还原。

注意: opn_reconfigure_unboundopn_reconfigure_haproxyopn_reconfigure_ddclientopn_reconfigure_dnsmasqopn_configure_mdns_repeater 需要写入但不使用保存点 — 它们应用服务配置更改,且不可自动还原。

IPv6 支持

通过 MCP 完全自动化

  • IPv6 防火墙规则 — 使用 ip_protocol="inet6" 创建规则(在 OPNsense < 26.7 上受保存点保护)

  • HAProxy IPv6 绑定 — 前端使用 [::]:443[2001:db8::1]:443 绑定地址

  • HAProxy IPv6 后端 — 服务器使用 IPv6 地址,后端设置 resolvePrefer: ipv6

  • 支持 IPv6 的动态 DNS — 使用支持 IPv6 的 checkip 方法的 DDNS 账户

  • DHCPv6 范围(dnsmasq) — 带有路由器通告配置的 IPv6 DHCP 范围

  • DNS AAAA 记录 — 使用 IPv6 地址的 Unbound 主机覆盖

  • IPv6 诊断 — 使用 ip_version="6" 的 traceroute,通过主机名 ping

需要手动 GUI 配置

这些设置在 OPNsense 中缺乏 MVC API 支持,必须通过 Web GUI 进行配置:

  • WAN IPv6 设置 — 使用 DHCPv6 前缀委派的 PPPoE、静态 IPv6、SLAAC

  • LAN IPv6 寻址 — 跟踪接口模式、静态 /64 分配、前缀 ID

  • 接口分配 — 将物理端口分配给 WAN/LAN/OPT 角色

  • 6to4/6rd 隧道 — 过渡隧道机制

已知限制

  • ISC DHCP / Kea DHCPv6:未实现。仅支持 dnsmasq(现代默认)用于 DHCPv6 范围和路由器通告。ISC DHCP 已弃用;Kea DHCPv6 租约在 API 中的可见性有限。

  • radvd:未作为单独的工具集实现。Dnsmasq 通过范围配置原生处理路由器通告。每个接口应只运行一个 RA 守护进程。

  • 双栈防火墙规则inet46(双栈)在 MVC API 规则(opn_add_firewall_rule)中正常工作。然而,传统 XML 过滤规则(GUI)中的 inet46 会静默地不产生 PF 输出——这是已知的 OPNsense 错误,仅影响传统规则。

  • 传统 GUI 规则:通过传统 OPNsense GUI 创建的防火墙规则无法通过 MVC API 访问。使用 opn_get_config_section("filter") 进行只读访问。

推荐的 IPv6 迁移工作流程

  1. 手动(GUI): 配置 WAN IPv6(来自 ISP 的 DHCPv6-PD 或静态)

  2. 手动(GUI): 配置 LAN 接口(用于前缀委派的跟踪接口模式)

  3. MCP: 通过 opn_add_dnsmasq_range 配置路由器通告,并设置 RA 标志

  4. MCP: 创建 IPv6 防火墙规则(必须允许 ICMPv6 以支持 NDP/RA/PMTUD)

  5. MCP: 通过 opn_add_dns_override 添加 IPv6 DNS 记录

  6. MCP: 配置使用 IPv6 checkip 方法的动态 DNS

  7. MCP: 向 HAProxy 前端添加 IPv6 绑定地址

  8. MCP: 使用 opn_pingopn_traceroute(ip_version="6")、opn_gateway_status 进行验证

版本兼容性

OPNsense 版本

状态

24.7 (Thriving Tiger)

支持

25.1 (Ultimate Unicorn)

支持

25.7 (Visionary Viper)

支持(自动检测 snake_case API)

26.1+

支持

服务器在首次连接时自动检测 OPNsense 版本,并选择正确的 API 端点命名约定(25.7 之前使用 camelCase,25.7 及之后使用 snake_case)。

关于防火墙规则的说明: opn_list_firewall_rules 显示通过 MVC/自动化 API 管理的规则。通过 OPNsense GUI 配置的规则使用传统格式,无法通过此 API 访问。这是已知的 OPNsense 限制。

故障排除

连接问题

“连接被拒绝”或超时错误

  • 验证 OPNSENSE_URL/api 结尾(例如 https://192.168.1.1/api

  • 如果使用非标准端口,请包含端口:https://192.168.1.1:10443/api

  • 确保运行 MCP 服务器的机器可以访问 OPNsense Web GUI

SSL 证书错误

  • 对于自签名证书(OPNsense 默认设置),设置 OPNSENSE_VERIFY_SSL=false

  • 对于生产环境,在 OPNsense 上安装合适的证书,并保持 OPNSENSE_VERIFY_SSL=true

身份验证问题

401 未授权

  • 验证 OPNSENSE_API_KEYOPNSENSE_API_SECRET 是否正确

  • API 密钥区分大小写——请从下载的 apikey.txt 中准确复制

  • 检查 API 用户在 OPNsense 中未被禁用

  • 验证 API 用户具有您尝试执行的操作所需的足够权限

403 禁止

  • API 用户可能缺少请求端点的权限

  • 对于写操作,确保设置了 OPNSENSE_ALLOW_WRITES=true

工具特定问题

opn_list_firewall_rules 返回空结果

  • 此工具仅显示 MVC/自动化规则,不显示传统 GUI 规则

  • 通过自动化 API 或 opn_add_firewall_rule 创建规则以查看它们

opn_ping 超时

  • 防火墙可能没有到目标主机的路由

  • 使用 opn_gateway_status 检查网关状态

  • 默认超时为 30 秒(30 个轮询周期)

opn_download_config 显示 [REDACTED]

  • 这是出于安全考虑的默认行为。传递 include_sensitive=true 以包含密码和密钥(在 AI 对话中请谨慎使用)

写操作失败并显示“未启用写入”

  • 在 MCP 服务器配置中设置 OPNSENSE_ALLOW_WRITES=true

  • 出于安全考虑,默认情况下有意禁用此功能

保存点确认失败

  • revision 参数必须与写操作返回的内容完全匹配

  • 确认必须在 60 秒内完成,否则更改将自动还原

  • 在 OPNsense 26.7+ 上没有保存点 API:写工具返回空的 revisionopn_confirm_changes 返回 status: "not_applicable"。这是预期行为,不是失败——更改已永久应用

诊断命令

如果您需要调试 MCP 服务器:

# Test API connectivity directly
curl -k -u "your-key:your-secret" https://your-opnsense-ip/api/core/firmware/status

# Run the server directly
python -m opnsense_mcp

# Run tests to verify installation
pytest -v

开发

# Clone and install dev dependencies
git clone https://github.com/lucamarien/opnsense-mcp-server
cd opnsense-mcp-server
pip install -e ".[dev]"

# Run all tests (no real OPNsense needed — all tests use mocked API)
pytest -v

# Full CI pipeline (lint, format, type check, security scan, tests)
make validate

# Individual checks
ruff check src/ tests/          # Lint (includes bandit security checks)
ruff format src/ tests/          # Format
mypy src/ --strict               # Type checking

最佳实践

针对常见防火墙配置任务的领域特定指南:

这些指南展示了真实的 MCP 工具使用模式,并解释了每种方法背后的安全考虑。

贡献

有关详细指南,请参阅 CONTRIBUTING.md。要点:

  1. 所有测试必须使用模拟的 API 响应——切勿连接到真实的 OPNsense

  2. 工具不得重叠——每个工具必须有明确的用途

  3. 编写清晰的文档字符串——它们是 AI 选择工具的唯一指南

  4. 返回结构化数据(字典),而不是格式化字符串

  5. 提交前运行 make validate

许可证

MIT

Install Server
A
license - permissive license
A
quality
B
maintenance

Maintenance

Maintainers
Response time
5wRelease cycle
5Releases (12mo)
Commit activity
Issues opened vs closed

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    F
    maintenance
    A 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.
    370
    73
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    This MCP server enables AI agents to inspect and modify an OPNsense firewall via natural language, using a compact set of generic tools and a resource registry to cover 96 CRUD operations.
    29
    AGPL 3.0

View all related MCP servers

Related MCP Connectors

  • Security-first WordPress MCP server. 129 tools for Claude, ChatGPT, Gemini. Free on wp.org.

  • MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lucamarien/opnsense-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server