OPNsense MCP Server 标志

OPNsense MCP Server

社区
lucamarien

A secure MCP server for managing OPNsense firewalls through AI assistants. 62 tools across 10 domains with read-only default, savepoint rollback, and security auditing.

发布者lucamarien
代码仓库opnsense-mcp-server
语言Python
复刻数
9
星标数
21
可用工具
0
传输类型stdio
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    OPNsense MCP Server 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 21 个星标和 9 个复刻。

OPNsense MCP Server

A secure Model Context Protocol (MCP) server for managing OPNsense firewalls through AI assistants like Claude Code, Cursor, and other MCP-compatible tools.

81 tools across 10 domains: system, firewall, network, DNS, DHCP, VPN, HAProxy, services, diagnostics, and security.

Requirements

  • Python 3.11+
  • OPNsense 24.7 or newer — the MCP server relies on the MVC-based API endpoints introduced in OPNsense 24.7. Older versions use a different API structure that is not compatible. The server auto-detects the OPNsense version on first connect and selects the correct endpoint naming (camelCase for pre-25.7, snake_case for 25.7+). OPNsense 26.x is fully supported, including its changed firmware status response format.

Security Model

This MCP server is designed with security as the primary concern:

  • Read-only by default — write operations require explicit opt-in via OPNSENSE_ALLOW_WRITES=true
  • Savepoint/rollback (OPNsense < 26.7 only) — where OPNsense still offers the savepoint API, firewall modifications use its built-in 60-second auto-revert; changes must be explicitly confirmed or they roll back automatically. OPNsense 26.7 removed that API upstream — the server detects the missing endpoint at runtime and applies firewall changes immediately, with no automatic rollback
  • Endpoint blocklist — dangerous endpoints (halt, reboot, poweroff, firmware update/upgrade) are hard-blocked at the API client level and can never be called
  • API-only — no SSH access, no command execution, no direct config file manipulation
  • Local transport — STDIO only, no network-exposed HTTP/SSE endpoints
  • No credential exposure — API keys are never included in tool output, logs, or error messages
  • Input validation — hostname parameters are validated against shell metacharacter injection
  • Sensitive data stripping — config backup strips passwords and keys by default

Quick Start

1. Create an OPNsense API Key

  1. Log in to your OPNsense web interface
  2. Go to System > Access > Users
  3. Either edit an existing user or create a dedicated API user:
    • For production use, create a dedicated user (e.g., mcp-api) with only the privileges needed
    • For read-only access, assign the user to a group with read-only API access
  4. Scroll down to the API keys section and click the + button
  5. A key/secret pair will be generated and a file (apikey.txt) will be downloaded
  6. The file contains two lines — key=your-api-key-here and secret=your-api-secret-here
  7. Store these credentials securely — the secret cannot be retrieved again from OPNsense

Tip: For a read-only setup (recommended for getting started), you don't need to change any permissions — the default API access is sufficient for all read-only tools.

2. Install

bash
# 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 image: the official image is uhlenheide/opnsense-mcp-server, published from this repository by .github/workflows/publish-docker.yml on every v* tag. There is no lucamarien/opnsense-mcp-server image — earlier README versions named it by mistake.

3. Configure Your AI Assistant

Claude Code

Add to your project's .mcp.json:

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"
      }
    }
  }
}

Alternative: Use "command": "python", "args": ["-m", "opnsense_mcp"] if the opnsense-mcp CLI is not on your PATH.

Or add it globally to ~/.claude/claude_code_config.json.

Claude Code (Docker)

json
{
  "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

Add to your Cursor MCP settings (Settings > 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"
      }
    }
  }
}

Configuration

Environment VariableDefaultDescription
OPNSENSE_URL(required)OPNsense API base URL (must end with /api)
OPNSENSE_API_KEY(required)API key from OPNsense user settings
OPNSENSE_API_SECRET(required)API secret from OPNsense user settings
OPNSENSE_VERIFY_SSLtrueVerify SSL certificate (false for self-signed certs)
OPNSENSE_ALLOW_WRITESfalseEnable write operations (firewall rules, service control)

Custom ports: If your OPNsense web GUI runs on a non-standard port (e.g., 10443), include it in the URL: https://192.168.1.1:10443/api

Available Tools (81)

System (7 tools)

ToolDescription
opn_system_statusSystem info including firmware version, product name, and architecture
opn_list_servicesList all services and their running status. Params: search, limit
opn_gateway_statusGateway availability, latency, and dpinger health checks
opn_download_configDownload config.xml backup with optional sensitive data stripping. Params: include_sensitive (default: false — passwords and keys are redacted)
opn_scan_configScan the full configuration, parse it into sections, and collect runtime inventory (firmware, plugins, DHCP, DNS, interfaces, services). Results are cached per session. Params: force
opn_get_config_sectionGet a specific config section as structured JSON. Params: section, include_sensitive
opn_mcp_infoMCP server version, write mode status, detected OPNsense version, API style, and whether firewall writes still get savepoint/rollback protection

Network (5 tools)

ToolDescription
opn_interface_statsPer-interface traffic statistics (bytes in/out, packets, errors)
opn_arp_tableARP table showing IP-to-MAC address mappings
opn_ndp_tableNDP (Neighbor Discovery Protocol) table showing IPv6-to-MAC address mappings
opn_ipv6_statusIPv6 configuration and address status for all interfaces (method, live addresses, summary)
opn_list_static_routesConfigured static routes. Params: search, limit

Firewall (21 tools)

ToolDescriptionWrites
opn_list_firewall_rulesList MVC firewall filter rules. Params: search, limitNo
opn_list_firewall_aliasesList alias definitions (IP lists, port groups, GeoIP, URLs). Params: search, limitNo
opn_list_nat_rulesList NAT port forwarding (DNAT) rules. Params: search, limitNo
opn_list_firewall_categoriesList firewall rule categories and their UUIDs. Params: search, limitNo
opn_firewall_logRecent firewall log entries with client-side filtering. Params: source_ip, destination_ip, action, interface, limitNo
opn_confirm_changesConfirm pending changes, cancelling 60-second auto-rollback (OPNsense < 26.7; a no-op returning not_applicable on 26.7+). Params: revisionYes
opn_toggle_firewall_ruleToggle a rule's enabled/disabled state with savepoint (OPNsense < 26.7). Params: uuidYes
opn_add_firewall_ruleCreate a new filter rule with savepoint (OPNsense < 26.7). Params: action, direction, interface, ip_protocol, protocol, source_net, destination_net, destination_port, descriptionYes
opn_delete_firewall_ruleDelete a filter rule by UUID with savepoint (OPNsense < 26.7). Params: uuidYes
opn_add_aliasCreate a new alias. Params: name, alias_type, content, descriptionYes
opn_add_nat_ruleCreate a NAT port forwarding rule with savepoint (OPNsense < 26.7). Params: destination_port, target_ip, interface, protocol, target_port, descriptionYes
opn_add_firewall_categoryCreate a new firewall rule category. Params: name, colorYes
opn_delete_firewall_categoryDelete a firewall rule category by UUID with savepoint (OPNsense < 26.7). Params: uuidYes
opn_set_rule_categoriesAssign categories to a firewall rule with savepoint (OPNsense < 26.7). Params: uuid, categoriesYes
opn_add_icmpv6_rulesCreate essential ICMPv6 rules required for IPv6 operation (NDP, RA, ping6) per RFC 4890. Params: interfaceYes
opn_update_aliasUpdate an existing alias (name, content, type, description). Read-modify-write. Params: uuid, name, content, description, alias_type, enabledYes
opn_delete_aliasDelete an alias by UUID. Check rule references first. Params: uuidYes
opn_toggle_aliasToggle alias enabled/disabled state. Params: uuidYes
opn_update_firewall_ruleUpdate filter rule fields with savepoint (OPNsense < 26.7). Params: uuid, action, direction, interface, ip_protocol, protocol, source_net, source_not, source_port, destination_net, destination_not, destination_port, gateway, log, quick, sequence, categories, description, enabledYes
opn_update_nat_ruleUpdate NAT port forwarding rule with savepoint (OPNsense < 26.7). Params: uuid, interface, protocol, destination_port, target_ip, target_port, description, enabledYes
opn_delete_nat_ruleDelete a NAT port forwarding rule by UUID with savepoint (OPNsense < 26.7). Params: uuidYes

Note: Savepoint protection only exists on OPNsense < 26.7. On 26.7+ these tools apply changes immediately and permanently — see Write Operations and Savepoints.

DNS (13 tools)

ToolDescriptionWrites
opn_list_dns_overridesUnbound host overrides (local DNS records). Params: search, limitNo
opn_list_dns_forwardsDNS forward zones (domain-specific servers). Params: search, limitNo
opn_dns_statsUnbound resolver statistics (queries, cache hits, uptime)No
opn_reconfigure_unboundApply pending DNS resolver configuration changesYes
opn_add_dns_overrideAdd an Unbound DNS host override (A/AAAA record) and apply immediately. Params: hostname, domain, server, descriptionYes
opn_list_dnsblList DNSBL blocklist configurations with providers and status. Params: search, limitNo
opn_get_dnsblGet full DNSBL configuration by UUID (providers, allowlists, settings). Params: uuidNo
opn_set_dnsblUpdate DNSBL settings (read-modify-write). Params: uuid, enabled, providers, allowlists, blocklists, wildcards, etc.Yes
opn_add_dnsbl_allowlistAdd domains to DNSBL allowlist without overwriting. Params: uuid, domainsYes
opn_remove_dnsbl_allowlistRemove domains from DNSBL allowlist. Params: uuid, domainsYes
opn_update_dnsblReload DNSBL blocklist files and restart Unbound (no config change, recovery tool)Yes
opn_update_dns_overrideUpdate an Unbound DNS host override and apply immediately. Params: uuid, hostname, domain, server, description, enabledYes
opn_delete_dns_overrideDelete an Unbound DNS host override and apply immediately. Params: uuidYes

DHCP (8 tools)

ToolDescriptionWrites
opn_list_dhcp_leasesActive DHCPv4 leases from the ISC DHCP serverNo
opn_list_kea_leasesDHCPv4 leases from the Kea DHCP server. Params: search, limitNo
opn_list_dnsmasq_leasesDHCPv4 and DHCPv6 leases from the dnsmasq DNS/DHCP server. Params: search, limitNo
opn_list_dnsmasq_rangesConfigured DHCP address ranges (both DHCPv4 and DHCPv6 with RA config). Params: search, limitNo
opn_add_dnsmasq_rangeCreate a new DHCP range (IPv4 or IPv6 with Router Advertisement configuration). Params: interface, start_addr, end_addr, prefix_len, ra_mode, lease_time, descriptionYes
opn_reconfigure_dnsmasqApply pending dnsmasq DNS/DHCP configuration changesYes
opn_update_dnsmasq_rangeUpdate a DHCP range (addresses, lease time, RA config) and apply. Params: uuid, interface, start_addr, end_addr, prefix_len, ra_mode, lease_time, description, enabledYes
opn_delete_dnsmasq_rangeDelete a DHCP range by UUID and apply. Params: uuidYes

VPN (3 tools)

ToolDescription
opn_wireguard_statusWireGuard tunnel and peer status (requires os-wireguard plugin)
opn_ipsec_statusIPsec VPN tunnel status — IKE (Phase 1) and ESP/AH (Phase 2) sessions
opn_openvpn_statusOpenVPN connection status — instances, sessions, and routes

HAProxy (8 tools)

Full configuration management for the HAProxy load balancer (requires os-haproxy plugin).

ToolDescriptionWrites
opn_haproxy_statusHAProxy service status and backend healthNo
opn_haproxy_searchSearch HAProxy resources by type. Params: resource_type (frontends/backends/servers/actions/acls/healthchecks/errorfiles/resolvers/mailers), search, limitNo
opn_haproxy_getGet detailed configuration for a specific resource. Params: resource_type, uuidNo
opn_haproxy_configtestValidate HAProxy configuration syntax before applyingNo
opn_haproxy_addCreate a new HAProxy resource. Params: resource_type, config (dict of field values)Yes
opn_haproxy_updateUpdate an existing HAProxy resource (partial updates). Params: resource_type, uuid, configYes
opn_haproxy_deleteDelete a HAProxy resource by UUID. Params: resource_type, uuidYes
opn_reconfigure_haproxyApply pending HAProxy configuration changesYes

Note: HAProxy changes do NOT use savepoint protection — they apply immediately on reconfigure. Always call opn_haproxy_configtest before opn_reconfigure_haproxy.

Services (11 tools)

ToolDescriptionWrites
opn_list_acme_certsACME/Let's Encrypt certificates and their status. Params: search, limitNo
opn_list_cron_jobsScheduled cron jobs. Params: search, limitNo
opn_crowdsec_statusCrowdSec security engine status and active decisionsNo
opn_crowdsec_alertsCrowdSec security alerts (detected threats). Params: search, limitNo
opn_list_ddns_accountsDynamic DNS accounts and their update status. Params: search, limitNo
opn_add_ddns_accountCreate a new Dynamic DNS account. Params: service, hostname, username, password, checkip, interface, descriptionYes
opn_reconfigure_ddclientApply pending Dynamic DNS configuration changesYes
opn_update_ddns_accountUpdate a Dynamic DNS account (password is write-only). Params: uuid, service, hostname, username, password, checkip, interface, description, enabledYes
opn_delete_ddns_accountDelete a Dynamic DNS account by UUID. Params: uuidYes
opn_mdns_repeater_statusmDNS Repeater status and configuration (enabled, interfaces, blocklist). Requires os-mdns-repeater pluginNo
opn_configure_mdns_repeaterConfigure mDNS Repeater for cross-VLAN device discovery (HomeKit, Chromecast, AirPlay). Params: enabled, interfacesYes

Diagnostics (4 tools)

ToolDescription
opn_pingPing a host from the firewall to test connectivity. Params: host, count (1-10, default 3)
opn_tracerouteTrace network path to a destination. Params: host, protocol (ICMP/UDP/TCP), ip_version (4/6)
opn_dns_lookupDNS lookup from the firewall. Params: hostname, server (optional custom DNS server)
opn_pf_statesQuery active PF state table. Params: search, limit (max 1000)

Security (1 tool)

ToolDescription
opn_security_auditComprehensive 11-area security audit: firmware, firewall rules (MVC + legacy, port grouping, insecure protocols), NAT forwarding, DNS security (DNSSEC, DoT), system hardening (SSH, HTTPS, syslog), services, certificates (ACME + system + CAs), VPN (WireGuard config, IPsec, OpenVPN), HAProxy (headers, health checks), gateways. Findings tagged with PCI DSS v4.0, BSI IT-Grundschutz, NIST 800-41, CIS compliance references.

Write Operations and Savepoints

Write operations require OPNSENSE_ALLOW_WRITES=true. On OPNsense < 26.7, firewall changes additionally go through OPNsense's savepoint mechanism:

  1. Before any firewall change, a savepoint is created automatically
  2. The change is applied (rule toggle, add, or delete)
  3. A 60-second countdown starts — if not confirmed, OPNsense automatically reverts the change
  4. Use opn_confirm_changes with the returned revision to make changes permanent

On those versions, if an AI assistant makes a bad firewall change that locks you out, the change reverts automatically within 60 seconds.

OPNsense 26.7 removed the savepoint/rollback API upstream, so there is no auto-revert on 26.7+. The server does not hardcode a version cut-off: it probes for the savepoint endpoint on the first firewall write and, if OPNsense answers that the endpoint does not exist, degrades to direct apply for the rest of the session. Check opn_mcp_info — its savepoint_support field reports true, false, or null if no write has probed yet. Write tools then return an empty revision, opn_confirm_changes answers with status: "not_applicable", and every firewall change is immediate and permanent.

Warning: On OPNsense 26.7+ take a config backup (opn_download_config, or System > Configuration > Backups) before enabling writes, and keep out-of-band access to the box — a rule that locks you out will not revert itself.

Note: opn_reconfigure_unbound, opn_reconfigure_haproxy, opn_reconfigure_ddclient, opn_reconfigure_dnsmasq, and opn_configure_mdns_repeater require writes but don't use savepoints — they apply service configuration changes and are not automatically revertible.

IPv6 Support

Fully Automated via MCP

  • IPv6 Firewall Rules — Create rules with ip_protocol="inet6" (savepoint-protected on OPNsense < 26.7)
  • HAProxy IPv6 Bindings — Frontends with [::]:443 or [2001:db8::1]:443 bind addresses
  • HAProxy IPv6 Backends — Servers with IPv6 addresses, resolvePrefer: ipv6 on backends
  • Dynamic DNS with IPv6 — DDNS accounts with IPv6-capable checkip methods
  • DHCPv6 Ranges (dnsmasq) — IPv6 DHCP ranges with Router Advertisement configuration
  • DNS AAAA Records — Unbound host overrides with IPv6 addresses
  • IPv6 Diagnostics — Traceroute with ip_version="6", ping via hostname

Requires Manual GUI Configuration

These settings lack MVC API support in OPNsense and must be configured via the web GUI:

  • WAN IPv6 setup — PPPoE with DHCPv6 prefix delegation, static IPv6, SLAAC
  • LAN IPv6 addressing — Track Interface mode, static /64 assignment, prefix ID
  • Interface assignment — Assigning physical ports to WAN/LAN/OPT roles
  • 6to4/6rd tunnels — Transition tunnel mechanisms

Known Limitations

  • ISC DHCP / Kea DHCPv6: Not implemented. Only dnsmasq (the modern default) is supported for DHCPv6 ranges and Router Advertisements. ISC DHCP is deprecated; Kea DHCPv6 lease visibility is limited in the API.
  • radvd: Not implemented as a separate tool set. Dnsmasq handles Router Advertisements natively via range configuration. Only one RA daemon should run per interface.
  • Dual-stack firewall rules: inet46 (dual-stack) works correctly in MVC API rules (opn_add_firewall_rule). However, inet46 in legacy XML filter rules (GUI) silently produces no PF output — this is a known OPNsense bug that only affects legacy rules.
  • Legacy GUI rules: Firewall rules created via the traditional OPNsense GUI are not accessible through the MVC API. Use opn_get_config_section("filter") for read-only access.

Recommended IPv6 Migration Workflow

  1. Manual (GUI): Configure WAN IPv6 (DHCPv6-PD from ISP or static)
  2. Manual (GUI): Configure LAN interfaces (Track Interface mode for prefix delegation)
  3. MCP: Configure Router Advertisements via opn_add_dnsmasq_range with RA flags
  4. MCP: Create IPv6 firewall rules (ICMPv6 must be allowed for NDP/RA/PMTUD)
  5. MCP: Add IPv6 DNS records via opn_add_dns_override
  6. MCP: Configure Dynamic DNS with IPv6 checkip method
  7. MCP: Add IPv6 bind addresses to HAProxy frontends
  8. MCP: Verify with opn_ping, opn_traceroute (ip_version="6"), opn_gateway_status

Version Compatibility

OPNsense VersionStatus
24.7 (Thriving Tiger)Supported
25.1 (Ultimate Unicorn)Supported
25.7 (Visionary Viper)Supported (auto-detects snake_case API)
26.1+Supported

The server automatically detects the OPNsense version on first connection and selects the correct API endpoint naming convention (camelCase for pre-25.7, snake_case for 25.7+).

Note on firewall rules: opn_list_firewall_rules shows rules managed via the MVC/automation API. Rules configured through the OPNsense GUI use a legacy format not accessible via this API. This is a known OPNsense limitation.

Troubleshooting

Connection Issues

"Connection refused" or timeout errors

  • Verify OPNSENSE_URL ends with /api (e.g., https://192.168.1.1/api)
  • If using a non-standard port, include it: https://192.168.1.1:10443/api
  • Ensure the OPNsense web GUI is accessible from the machine running the MCP server

SSL certificate errors

  • For self-signed certificates (default OPNsense setup), set OPNSENSE_VERIFY_SSL=false
  • For production, install a proper certificate on OPNsense and keep OPNSENSE_VERIFY_SSL=true

Authentication Issues

401 Unauthorized

  • Verify OPNSENSE_API_KEY and OPNSENSE_API_SECRET are correct
  • API keys are case-sensitive — copy them exactly from the downloaded apikey.txt
  • Check that the API user is not disabled in OPNsense
  • Verify the API user has sufficient privileges for the operations you're attempting

403 Forbidden

  • The API user may lack permissions for the requested endpoint
  • For write operations, ensure OPNSENSE_ALLOW_WRITES=true is set

Tool-Specific Issues

opn_list_firewall_rules returns empty results

  • This tool only shows MVC/automation rules, not legacy GUI rules
  • Create rules via the automation API or opn_add_firewall_rule to see them

opn_ping times out

  • The firewall may not have a route to the target host
  • Check gateway status with opn_gateway_status
  • Default timeout is 30 seconds (30 poll cycles)

opn_download_config shows [REDACTED] values

  • This is the default behavior for security. Pass include_sensitive=true to include passwords and keys (use with caution in AI conversations)

Write operations fail with "writes not enabled"

  • Set OPNSENSE_ALLOW_WRITES=true in your MCP server configuration
  • This is intentionally disabled by default for safety

Savepoint confirmation fails

  • The revision parameter must match exactly what was returned by the write operation
  • Confirmations must happen within 60 seconds or the change auto-reverts
  • On OPNsense 26.7+ there is no savepoint API: write tools return an empty revision and opn_confirm_changes returns status: "not_applicable". That is expected, not a failure — the change already applied permanently

Diagnostic Commands

If you need to debug the MCP server:

bash
# 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

Development

bash
# 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

Best Practices

Domain-specific guides for common firewall configuration tasks:

These guides show real-world MCP tool usage patterns and explain the security considerations behind each approach.

Contributing

See CONTRIBUTING.md for detailed guidelines. Key points:

  1. All tests must use mocked API responses — never connect to a real OPNsense
  2. No overlapping tools — each tool must have a distinct purpose
  3. Write clear docstrings — they're the AI's only guide to tool selection
  4. Return structured data (dicts), not formatted strings
  5. Run make validate before submitting

License

MIT

将 OPNsense MCP Server MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 OPNsense MCP Server 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请勿关闭终端窗口或停止其中的连接器进程。
3

将 OPNsense MCP Server 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 OPNsense MCP Server MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "lucamarien-opnsense-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 OPNsense MCP Server MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 OPNsense MCP Server MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 OPNsense MCP Server 帮我完成这项任务吗?
OPNsense MCP Server
当然,我看过了。
以下是我使用 OPNsense MCP Server 得到的结果。

常见问题

OPNsense MCP Server MCP 服务器有什么用途?

OPNsense MCP Server 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 OPNsense MCP Server MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您无需为每个模型单独配置 MCP 服务器,就能在 Claude、ChatGPT、Gemini 或您在 TypingMind 中配置的其他 AI 模型中使用 OPNsense MCP Server。

为什么在 TypingMind 中使用 OPNsense MCP Server MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是最出色的大语言模型聊天前端之一。连接 OPNsense MCP Server 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 OPNsense MCP Server MCP 连接到 TypingMind?

OPNsense MCP Server 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

OPNsense MCP Server MCP 在 TypingMind 中提供哪些工具?

OPNsense MCP Server 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 OPNsense MCP Server MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行选择模型提供商,并自行管理 API 密钥、提示词和 MCP 配置。如果 OPNsense MCP Server 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇