PO

pixelworlds/opnsense-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

95 stars 28 forks 质量 69 趋势 0MIT

pixelworlds/opnsense-mcp-server 是从 https://github.com/pixelworlds/opnsense-mcp-server. 导入的 MCP 服务器候选

概览

pixelworlds/opnsense-mcp-server 是从 https://github.com/pixelworlds/opnsense-mcp-server. 导入的 MCP 服务器候选

概述(AI 翻译)

一台模块化模型上下文协议(MCP)服务器,提供88个基于模块的工具,通过类型安全TypeScript接口访问超过2000种OPNsense防火墙管理方法。

特色

  • 模块化架构 - 88个逻辑工具(每个模块一个),取代2000+个独立工具
  • 完整的API覆盖 - 访问752个核心方法和1271个插件方法
  • Type-Safe - 支持@richard-stovall/opnsense-typescript-client v0.5.3的完整TypeScript
  • 插件支持 - 可选支持 64 个插件模块
  • 智能组织 - 相关操作按模块分组,便于发现

MCP服务器作为AI助手(如Claude Desktop)与OPNsense防火墙之间的桥梁,通过模块化工具界面提供安全的API访问。

在 Claude Desktop 中的应用

Claude 代码中的使用

安装

作为MCP服务器

该软件包设计为作为MCP(模型上下文协议)服务器,配合Claude Desktop、Cursor或其他兼容MCP的客户端。

先决条件

  • Node.js 18岁及以上
  • 启用 API 访问的 OPNsense 防火墙
  • API 密钥和 OPNsense 安装的秘密

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

OPNsense MCP Server

A modular Model Context Protocol (MCP) server that provides 88 module-based tools giving access to over 2000 OPNsense firewall management methods through a type-safe TypeScript interface.

Features

  • Modular Architecture - 88 logical tools (one per module) instead of 2000+ individual tools
  • Complete API Coverage - Access to 752 core methods and 1271 plugin methods
  • Type-Safe - Full TypeScript support with @richard-stovall/opnsense-typescript-client v0.5.3
  • Plugin Support - Optional support for 64 plugin modules
  • Smart Organization - Related operations grouped by module for easier discovery

The MCP server acts as a bridge between AI assistants (like Claude Desktop) and your OPNsense firewall, providing secure API access through a modular tool interface.

Usage in Claude Desktop

Usage in Claude Code

Installation

As an MCP Server

This package is designed to be used as an MCP (Model Context Protocol) server with AI assistants like Claude Desktop, Cursor, or other MCP-compatible clients.

Prerequisites

  • Node.js 18 or higher
  • An OPNsense firewall with API access enabled
  • API key and secret from your OPNsense installation

Install from npm

npm install -g @richard-stovall/opnsense-mcp-server

Usage as an MCP Server

Claude Desktop Configuration

Add the following to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "opnsense": {
      "command": "npx",
      "args": ["-y", "@richard-stovall/opnsense-mcp-server"],
      "env": {
        "OPNSENSE_URL": "https://192.168.1.1",
        "OPNSENSE_API_KEY": "your-api-key",
        "OPNSENSE_API_SECRET": "your-api-secret",
        "OPNSENSE_VERIFY_SSL": "false"
      }
    }
  }
}

Alternative Configuration Methods

Using Command Line Arguments:

{
  "mcpServers": {
    "opnsense": {
      "command": "node",
      "args": [
        "/path/to/opnsense-mcp-server/index.js",
        "--url",
        "https://YOUR-OPNSENSE-IP",
        "--api-key",
        "YOUR-API-KEY",
        "--api-secret",
        "YOUR-API-SECRET",
        "--no-verify-ssl"
      ]
    }
  }
}

Enable Plugin Tools: To include all 64 plugin module tools, add "--plugins" to the args or set "INCLUDE_PLUGINS": "true" in env.

Testing the Setup

Once configured, you can test the connection by asking Claude:

  • “What MCP tools are available?”
  • “Use core_manage to get the system status”
在 GitHub 查看完整 README

安装

npx -y @richard-stovall/opnsense-mcp-server
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "opnsense": { "command": "npx", "args": ["-y", "@richard-stovall/opnsense-mcp-server"], "env": { "OPNSENSE_URL": "https://192.168.1.1", "OPNSENSE_API_KEY": "your-api-key", "OPNSENSE_API_SECRET": "your-api-secret", "OPNSENSE_VERIFY_SSL": "false" } } } }