OPNsense MCP Server logo

OPNsense MCP Server

Community
Pixelworlds

Modular MCP server for OPNsense firewall management - 88 tools providing access to 2000+ methods through AI assistants

PublisherPixelworlds
Repositoryopnsense-mcp-server
LanguageJavaScript
Forks
23
Stars
86
Available tools
170
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    OPNsense MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 170 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    86 stars and 23 forks from the linked repository.

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 OPNsense MCP Server Network Architecture

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

bash
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

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:

json
{
  "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"
  • "Use firewall_manage to search for all aliases"
  • "Use interfaces_manage to list all network interfaces"

Troubleshooting Claude Desktop Setup

Connection Issues:

  1. Verify your OPNsense API is enabled
  2. Check that the API key has appropriate permissions
  3. Ensure the IP/hostname is accessible from your machine
  4. For self-signed certificates, use --no-verify-ssl or set "OPNSENSE_VERIFY_SSL": "false"

View Server Logs: Check Claude Desktop logs for any error messages from the MCP server.

Test Manually: You can test the server manually before using with Claude Desktop:

bash
node /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

This should output:

OPNsense MCP server v0.6.0 (modular) started
Core tools: 24 modules
Plugin tools: 64 modules (disabled)
Total available: 24 modules

Cursor Configuration

Add to your Cursor settings (.cursor/mcp.json in your project or ~/.cursor/mcp.json globally):

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

Configuration Options

The server accepts configuration through environment variables:

  • OPNSENSE_URL - OPNsense host URL (required)
  • OPNSENSE_API_KEY - API key for authentication (required)
  • OPNSENSE_API_SECRET - API secret for authentication (required)
  • INCLUDE_PLUGINS - Set to "true" to enable 64 plugin module tools (optional)
  • OPNSENSE_VERIFY_SSL - Set to "false" to disable SSL verification (development only)

How It Works

The modular MCP server provides your AI assistant with 88 module-based tools. Each tool represents an OPNsense module and accepts a method parameter to specify the operation.

Tool Usage Pattern:

json
{
  "tool": "firewall_manage",
  "arguments": {
    "method": "aliasSearchItem",
    "params": {
      "searchPhrase": "web"
    }
  }
}

Example prompts:

  • "Use core_manage to check system status"
  • "Use firewall_manage to list all firewall aliases"
  • "Use interfaces_manage to get network interface information"
  • "Use plugin_nginx_manage to check the web server configuration"
  • "Use diagnostics_manage to view the ARP table"

The modular approach makes it easy to discover related functionality - all firewall operations are in firewall_manage, all VPN operations in their respective modules (openvpn_manage, ipsec_manage, wireguard_manage).

Available Module Tools

Core Modules (24 tools)

Each tool provides access to all methods within that module:

Tool NameDescriptionExample Methods
core_manageCore system functionsbackupBackups, systemReboot, firmwareInfo
firewall_manageFirewall rules & aliasesaliasSearchItem, filterAddRule, natSearchRule
interfaces_manageNetwork interfacesgetInterfaces, vlanAddItem, setInterface
diagnostics_manageSystem diagnosticsinterfaceGetArp, systemActivityGetActivity
auth_manageAuthenticationuserSearchUser, groupSearchGroup
firmware_manageFirmware updatescheck, update, upgrade, changelog
openvpn_manageOpenVPNinstancesSearch, instancesAdd, serviceReconfigure
ipsec_manageIPsec VPNtunnelSearchPhase1, connectionStatus
wireguard_manageWireGuard VPNserverSearchServer, clientSearchClient
unbound_manageDNS resolverhostOverrideSearchItem, serviceReconfigure
dhcpv4_manageDHCP serversearchLease, addReservation

Plugin Modules (64 tools when enabled)

Popular plugin modules:

Tool NameDescriptionExample Methods
plugin_nginx_manageNginx web servergeneralGet, upstreamSearchUpstream
plugin_haproxy_manageHAProxy load balancerserverSearchServer, statsGet
plugin_caddy_manageCaddy web serverreverseProxySearchDomain, serviceStatus
plugin_bind_manageBIND DNSdomainSearchDomain, recordSearchRecord
plugin_acmeclient_manageLet's EncryptcertificatesSearch, certificatesIssue

Building from Source

If you want to contribute or customize the server:

bash
# Clone the repository
git clone https://github.com/richard-stovall/opnsense-mcp-server.git
cd opnsense-mcp-server

# Install dependencies with Yarn 4.9.2
yarn install

# Build the project
yarn build

# Run locally
yarn start

Development

Development Scripts

bash
yarn generate-tools  # Generate tool definitions
yarn build          # Build the server
yarn build:all      # Generate tools and build
yarn dev            # Run with hot reload
yarn type-check     # Type check without emitting
yarn start          # Start the server

Technology Stack

  • Runtime: Node.js with tsx for TypeScript execution
  • Package Manager: Yarn 4.9.2 with Plug'n'Play
  • Build System: Simple TypeScript compilation to single file
  • Language: TypeScript 5.3+
  • MCP SDK: @modelcontextprotocol/sdk
  • API Client: @richard-stovall/opnsense-typescript-client
  • Validation: Zod for schema validation
  • Testing: Jest with TypeScript support

API Integration

The server uses the @richard-stovall/opnsense-typescript-client package which provides:

  • Complete type safety for all API calls
  • Built-in error handling and retries
  • Support for all 601 OPNsense API endpoints
  • Modern Fetch API based implementation

Example Tool Implementation

typescript
const response = await client.system.getStatus();
return {
  content: [
    {
      type: 'text',
      text: JSON.stringify(response.data, null, 2),
    },
  ],
};

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments


Made with love for the OPNsense community

Installation

TypingMind
{
  "mcpServers": {
    "opnsense-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@richard-stovall/opnsense-mcp-server"
      ],
      "env": {
        "OPNSENSE_URL": "<OPNSENSE_URL>",
        "OPNSENSE_API_KEY": "<OPNSENSE_API_KEY>",
        "OPNSENSE_API_SECRET": "<OPNSENSE_API_SECRET>"
      }
    }
  }
}

Available Tools

  • get_system_status

    Get comprehensive OPNsense system status including uptime, CPU, memory, and disk usage

  • system_reboot

    Reboot the OPNsense system with optional delay

  • system_halt

    Halt (power off) the OPNsense system

  • dismiss_system_status

    Dismiss system status notifications and alerts

  • get_system_health

    Get system health metrics and monitoring data

  • get_memory_usage

    Get detailed memory usage statistics

  • get_disk_usage

    Get disk usage information for all mounted filesystems

  • get_system_temperature

    Get system temperature readings from sensors

  • get_cpu_usage

    Get CPU usage statistics and load information

  • get_system_routes

    Get system routing table information

  • firewall_get_rules

    Get OPNsense firewall rules with pagination and search

  • firewall_add_rule

    Add a new firewall rule

  • firewall_delete_rule

    Delete a firewall rule by UUID

  • firewall_toggle_rule

    Enable or disable a firewall rule

  • get_interfaces

    Get network interfaces information

  • get_dhcp_leases

    Get active DHCP leases

  • get_openvpn_instances

    Get OpenVPN server instances

  • configure_opnsense_connection

    Configure OPNsense connection parameters

  • backup_config

    Create a backup of the current configuration

  • backup_get_list

    Get list of backups for a host

  • backup_delete

    Delete a specific backup

  • backup_compare

    Compare two backups and show differences

  • backup_download

    Download a backup file

  • backup_get_providers

    Get available backup providers

  • backup_revert

    Revert to a specific backup

  • dashboard_get_config

    Get dashboard configuration

  • dashboard_get_picture

    Get dashboard picture/logo

  • dashboard_get_product_info

    Get product information feed for dashboard

  • dashboard_restore_defaults

    Restore dashboard to default configuration

  • dashboard_save_widgets

    Save dashboard widget configuration

  • hasync_get_config

    Get high availability sync configuration

  • hasync_set_config

    Set high availability sync configuration

  • hasync_reconfigure

    Reconfigure high availability sync

  • hasync_remote_service_action

    Perform action on remote HA service

  • hasync_restart_service

    Restart HA sync service

  • hasync_restart_all_services

    Restart all HA sync services

  • hasync_get_services

    Get list of HA sync services

  • hasync_start_service

    Start HA sync service

  • hasync_stop_service

    Stop HA sync service

  • hasync_get_version

    Get HA sync version information

  • menu_search

    Search menu items

  • menu_get_tree

    Get menu tree structure

  • service_restart

    Restart a specific service

  • snapshots_search

    Search configuration snapshots

  • snapshots_add

    Add a new configuration snapshot

  • snapshots_delete

    Delete a configuration snapshot

  • snapshots_get

    Get specific configuration snapshot

  • snapshots_set

    Update configuration snapshot

  • snapshots_activate

    Activate a configuration snapshot

  • snapshots_is_supported

    Check if snapshots are supported on this system

  • tunables_get_config

    Get system tunables configuration

  • tunables_set_config

    Set system tunables configuration

  • tunables_search_items

    Search tunable items

  • tunables_add_item

    Add a new tunable item

  • tunables_get_item

    Get specific tunable item

  • tunables_set_item

    Update tunable item

  • tunables_delete_item

    Delete tunable item

  • tunables_reconfigure

    Reconfigure system tunables

  • tunables_reset

    Reset system tunables to defaults

  • firmware_audit

    Perform security audit of installed packages

  • firmware_get_changelog

    Get changelog for specific firmware version

  • firmware_check_updates

    Check for available firmware updates

  • firmware_get_info

    Get firmware information and status

  • firmware_upgrade

    Upgrade firmware to latest version

  • firmware_update

    Update package repository and installed packages

  • firmware_get_config

    Get firmware configuration settings

  • firmware_set_config

    Set firmware configuration settings

  • firmware_get_health

    Get firmware health status

  • firmware_get_history

    Get firmware update history

  • firmware_get_log

    Get firmware operation logs

  • firmware_poweroff

    Schedule system poweroff after updates

  • firmware_reboot

    Schedule system reboot after updates

  • diagnostics_ping_start

    Start network ping test

  • diagnostics_ping_get

    Get ping test configuration

  • diagnostics_ping_set

    Set ping test configuration

  • diagnostics_traceroute_start

    Start network traceroute test

  • diagnostics_traceroute_get

    Get traceroute test configuration

  • diagnostics_traceroute_set

    Set traceroute test configuration

  • diagnostics_firewall_stats

    Get firewall statistics

  • diagnostics_firewall_log

    Get firewall logs

  • diagnostics_firewall_flush_states

    Flush firewall states

  • diagnostics_interface_get_statistics

    Get network interface statistics

  • diagnostics_interface_flush_arp

    Flush ARP table

  • firewall_rules_search

    Search firewall rules with advanced filters

  • firewall_rule_get

    Get specific firewall rule

  • firewall_rule_set

    Update firewall rule

  • firewall_rule_move

    Move firewall rule to different position

  • firewall_apply_changes

    Apply pending firewall configuration changes

  • firewall_create_savepoint

    Create firewall configuration savepoint

  • firewall_revert_savepoint

    Revert to firewall configuration savepoint

  • firewall_aliases_search

    Search firewall aliases

  • firewall_alias_add

    Add new firewall alias

  • firewall_alias_get

    Get specific firewall alias

  • firewall_alias_set

    Update firewall alias

  • firewall_alias_delete

    Delete firewall alias

  • firewall_alias_toggle

    Enable or disable firewall alias

  • auth_users_search

    Search system users

  • auth_user_add

    Add new system user

  • auth_user_get

    Get specific system user

  • auth_user_set

    Update system user

  • auth_user_delete

    Delete system user

  • auth_groups_search

    Search system groups

  • auth_group_add

    Add new system group

  • auth_group_get

    Get specific system group

  • auth_group_set

    Update system group

  • auth_group_delete

    Delete system group

  • openvpn_instances_search

    Search OpenVPN instances

  • openvpn_instance_add

    Add new OpenVPN instance

  • openvpn_instance_get

    Get specific OpenVPN instance

  • openvpn_instance_set

    Update OpenVPN instance

  • openvpn_instance_delete

    Delete OpenVPN instance

  • openvpn_instance_toggle

    Enable or disable OpenVPN instance

  • interfaces_overview_get

    Get network interfaces overview

  • interfaces_vlan_search

    Search VLAN configurations

  • interfaces_vlan_add

    Add new VLAN configuration

  • interfaces_vlan_get

    Get specific VLAN configuration

  • interfaces_vlan_set

    Update VLAN configuration

  • interfaces_vlan_delete

    Delete VLAN configuration

  • interfaces_vlan_reconfigure

    Reconfigure VLAN interfaces

  • system_health_check

    Comprehensive system health check combining multiple metrics

  • firewall_backup_rules

    Backup all firewall rules and aliases to a configuration snapshot

  • firewall_restore_rules

    Restore firewall rules from a configuration snapshot

  • system_config_deploy

    Deploy a complete system configuration from backup

  • vpn_client_provision

    Comprehensive VPN client provisioning workflow

  • bulk_user_management

    Bulk user operations for efficient user management

  • network_topology_scan

    Scan and analyze network topology and connectivity

  • security_audit_full

    Comprehensive security audit of the entire system

  • performance_monitoring

    Real-time performance monitoring dashboard

  • backup_management_wizard

    Automated backup management and scheduling workflow

  • firmware_update_wizard

    Guided firmware update with pre-checks and rollback

  • interface_diagnostics_full

    Complete interface diagnostics and troubleshooting

  • certificate_management_bulk

    Bulk certificate operations and lifecycle management

  • log_analysis_advanced

    Advanced log analysis with pattern detection and alerts

  • traffic_analysis_real_time

    Real-time traffic analysis and bandwidth monitoring

  • config_validation_comprehensive

    Comprehensive configuration validation and conflict detection

  • plugin_lifecycle_management

    Complete plugin lifecycle management workflow

  • ha_cluster_management

    High availability cluster management and synchronization

  • service_dependency_check

    Check service dependencies and startup order

  • network_troubleshooting_wizard

    Automated network troubleshooting workflow

  • compliance_reporting

    Generate compliance reports for security standards

  • capacity_planning_analysis

    System capacity planning and resource utilization analysis

  • automated_incident_response

    Automated incident response and mitigation workflow

  • configuration_drift_detection

    Detect configuration drift from baseline

  • multi_wan_optimization

    Multi-WAN configuration optimization and load balancing

  • security_baseline_enforcement

    Enforce security baseline configurations

  • api_usage_analytics

    Analyze API usage patterns and performance metrics

  • disaster_recovery_planning

    Disaster recovery planning and preparation workflow

  • bandwidth_management_optimization

    Optimize bandwidth allocation and traffic shaping

  • threat_intelligence_integration

    Integrate threat intelligence feeds for enhanced security

  • custom_dashboard_builder

    Build custom monitoring dashboards with widgets

  • vpn_performance_optimization

    Optimize VPN performance and throughput

  • configuration_template_engine

    Template-based configuration generation and deployment

  • system_migration_assistant

    Assist with system migration and configuration transfer

  • plugin_compatibility_checker

    Check plugin compatibility and dependency resolution

  • network_security_hardening

    Apply network security hardening best practices

  • license_management_tracker

    Track and manage software licenses and subscriptions

  • automated_testing_suite

    Run automated tests for system functionality

  • cost_optimization_analysis

    Analyze system costs and suggest optimizations

  • change_management_workflow

    Manage configuration changes with approval workflow

  • api_gateway_management

    Manage API gateway configuration and routing

  • data_retention_management

    Manage data retention policies and cleanup

  • service_mesh_configuration

    Configure and manage service mesh infrastructure

  • edge_computing_management

    Manage edge computing nodes and distribution

  • zero_trust_implementation

    Implement zero trust security architecture

  • container_orchestration

    Orchestrate container deployments and management

  • advanced_threat_hunting

    Advanced threat hunting and anomaly detection

  • iot_device_management

    Manage IoT device connectivity and security

  • blockchain_integration

    Integrate blockchain services and validation

  • ai_ops_automation

    AI-powered operations automation and optimization

  • quantum_safe_cryptography

    Implement quantum-safe cryptographic algorithms

Use OPNsense MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once OPNsense MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add OPNsense MCP Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the OPNsense MCP Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "opnsense-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@richard-stovall/opnsense-mcp-server"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the OPNsense MCP Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the OPNsense MCP Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use OPNsense MCP Server to help me with this task?
OPNsense MCP Server
Sure. I read it.
Here is what I found using OPNsense MCP Server.

Frequently asked questions

What is the OPNsense MCP Server MCP server used for?

OPNsense MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use OPNsense MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use OPNsense MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use OPNsense MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With OPNsense MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect OPNsense MCP Server MCP to TypingMind?

OPNsense MCP Server runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does OPNsense MCP Server MCP provide in TypingMind?

OPNsense MCP Server exposes 170 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use OPNsense MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If OPNsense MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇