VO

vespo92/opnsensemcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

99 stars 19 forks 品質 81 トレンド 8MIT

vespo92/opnsensemcp は [https://github.com/vespo92/opnsensemcp.] からインポートされた MCP サーバーの候補です

概要

vespo92/opnsensemcp は [https://github.com/vespo92/opnsensemcp.] からインポートされた MCP サーバーの候補です

概要(AI 翻訳)

包括的な OPNsense ファイアウォール管理のためのモデルコンテキストプロトコル (MCP) サーバー。 このサーバーでは、ClaudeのようなAIアシスタントがファイアウォールの設定を直接管理し、ネットワークの問題を診断し、複雑なネットワークタスクを自動化することができます。

##特徴

◀ ファイアウォール管理

  • ファイアウォールルールの完全なCRUD操作
  • API作成の「自動化ルール」の適切な処理
  • Inter-VLANルーティング設定
  • バッチルールの作成と管理
  • 複数のフォールバックメソッドで永続性を強化

インポート NAT 設定 (SSH ベース)

  • アウトバウンドNATルール管理
  • NATモード制御(自動/ハイブリッド/マニュアル/無効)
  • VLAN間トラフィックのNAT例外ルール
  • 自動DMZ NATの問題解決
  • 直接XML構成操作

ANSIネットワーク診断

  • 包括的なルーティング解析
  • ベンダー識別によるARPテーブル検査
  • インターフェイス構成管理
  • ネットワーク接続のトラブルシューティング
  • 共通の問題のための自動修正機能

################################################################################################################################################################################################################################################################

  • OPNsense の直接コマンド実行
  • 設定ファイル操作
  • API で利用できないシステムレベルの操作
  • サービス管理と再起動

####の追加機能

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

OPNsense MCP Server

A Model Context Protocol (MCP) server for comprehensive OPNsense firewall management. This server enables AI assistants like Claude to directly manage firewall configurations, diagnose network issues, and automate complex networking tasks.

Features

🔥 Firewall Management

  • Complete CRUD operations for firewall rules
  • Proper handling of API-created “automation rules”
  • Inter-VLAN routing configuration
  • Batch rule creation and management
  • Enhanced persistence with multiple fallback methods

🌐 NAT Configuration (SSH-based)

  • Outbound NAT rule management
  • NAT mode control (automatic/hybrid/manual/disabled)
  • No-NAT exception rules for inter-VLAN traffic
  • Automated DMZ NAT issue resolution
  • Direct XML configuration manipulation

🔍 Network Diagnostics

  • Comprehensive routing analysis
  • ARP table inspection with vendor identification
  • Interface configuration management
  • Network connectivity troubleshooting
  • Auto-fix capabilities for common issues

🖥️ SSH/CLI Execution

  • Direct command execution on OPNsense
  • Configuration file manipulation
  • System-level operations not available via API
  • Service management and restarts

📊 Additional Capabilities

  • VLAN management
  • DHCP lease viewing and management
  • DNS blocklist configuration
  • HAProxy load balancer support
  • Configuration backup and restore
  • Infrastructure as Code support

Installation

Prerequisites

  • Node.js 18+ to run the server (Bun 1.1.39+ to develop on it)
  • OPNsense firewall (v24.7+ recommended)
  • API credentials for OPNsense
  • SSH access (optional, for advanced features)

Quick Start with npm

  1. Install the package:
npm install -g opnsense-mcp-server
  1. Create a .env file with your credentials:
# Required
OPNSENSE_HOST=https://your-opnsense-host:port
OPNSENSE_API_KEY=your-api-key
OPNSENSE_API_SECRET=your-api-secret
OPNSENSE_VERIFY_SSL=false

# Optional - for SSH features
OPNSENSE_SSH_HOST=your-opnsense-host
OPNSENSE_SSH_USERNAME=root
OPNSENSE_SSH_PASSWORD=your-password
# Or use SSH key
# OPNSENSE_SSH_KEY_PATH=~/.ssh/id_rsa

# Recommended for a new/production router — see "Safety Modes" below
# OPNSENSE_READ_ONLY=true
  1. Start the MCP server:
opnsense-mcp-server

⚠️ Safety Modes (read this before pointing at a production router)

By default this server can make live, immediate changes to your firewall — add/delete rules, change NAT, restart services, run whitelisted shell commands over SSH. Two environment variables (operator-only — a tool call can never set or override them) add a safety net:

Variable Effect
GitHub で README 全文を見る

インストール

npx opnsense-mcp-server
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "opnsense": { "command": "bun", "args": ["run", "/path/to/OPNSenseMCP/src/index.ts"], "env": { "OPNSENSE_HOST": "https://your-opnsense:port", "OPNSENSE_API_KEY": "your-key", "OPNSENSE_API_SECRET": "your-secret", "OPNSENSE_VERIFY_SSL": "false" } } } }