MCP Hub
Back to servers

UniFi Network MCP Server

A comprehensive MCP server for managing UniFi network infrastructure, providing 50+ tools for devices, clients, WiFi, and firewall rule management via the official UniFi API.

Tools
50
Updated
Jan 9, 2026
Validated
Jan 9, 2026

UniFi Network MCP Server

A Model Context Protocol (MCP) server for the UniFi Network API. Manage your UniFi network infrastructure through AI assistants like Claude.

Quick Install

curl -fsSL https://raw.githubusercontent.com/Ruashots/unifi-network-mcp/master/install.sh | bash

This will:

  • Clone the repository to ~/.local/share/unifi-network-mcp
  • Install dependencies and build
  • Prompt for your UniFi Console URL and API key
  • Configure Claude Code automatically

Other commands:

# Reconfigure credentials
~/.local/share/unifi-network-mcp/install.sh --reconfigure

# Uninstall
~/.local/share/unifi-network-mcp/install.sh --uninstall

Features

50+ tools covering the complete UniFi Network API:

  • Sites - List all sites accessible to the API key
  • Devices - List, get statistics, adopt, restart, locate devices
  • Clients - View connected clients, authorize guest access
  • Networks - Full CRUD for network configurations
  • WiFi - Create and manage SSIDs with security settings
  • Hotspot Vouchers - Generate and manage guest vouchers
  • Firewall Zones - Organize networks into security zones
  • ACL Rules - Create and manage firewall rules with scheduling
  • Traffic Matching Lists - IP groups, port groups, domains, apps, regions

Prerequisites

  • Node.js 18+
  • UniFi Console with Network application (UniFi OS Console, Cloud Key, or self-hosted)
  • UniFi API key (Site Admin or Super Admin role)
  • jq (for automatic Claude Code configuration)

Getting a UniFi API Key

  1. Log into your UniFi Console
  2. Click your profile icon (bottom left)
  3. Go to API section
  4. Click Create API Key
  5. Copy the key (only shown once)

Note: Your API key inherits your user permissions. Use a Site Admin or Super Admin account for full access.

Manual Installation

# Clone the repository
git clone https://github.com/Ruashots/unifi-network-mcp.git
cd unifi-network-mcp

# Install dependencies
npm install

# Build
npm run build

Usage

Claude Code CLI

claude mcp add unifi-network \
  --transport stdio \
  -e UNIFI_API_KEY="your-api-key" \
  -e UNIFI_BASE_URL="https://your-console-ip" \
  -- node /path/to/unifi-network-mcp/dist/index.js

Scope options:

FlagDescription
(default)Local to current directory
--scope userAvailable across all your projects
--scope projectShared with team via .mcp.json

Claude Desktop

Add to your Claude Desktop config file:

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

{
  "mcpServers": {
    "unifi-network": {
      "command": "node",
      "args": ["/path/to/unifi-network-mcp/dist/index.js"],
      "env": {
        "UNIFI_API_KEY": "your-api-key",
        "UNIFI_BASE_URL": "https://your-console-ip"
      }
    }
  }
}

Environment Variables

VariableDescription
UNIFI_BASE_URLYour UniFi Console URL (e.g., https://192.168.1.1)
UNIFI_API_KEYAPI key from your UniFi Console

Available Tools

Application

ToolDescription
unifi_get_infoGet application version and type

Sites

ToolDescription
unifi_list_sitesList all sites

Devices

ToolDescription
unifi_list_devicesList all devices at a site
unifi_get_deviceGet device details
unifi_get_device_statisticsGet latest device statistics
unifi_adopt_deviceAdopt a pending device
unifi_restart_deviceRestart a device
unifi_locate_deviceFlash device LED
unifi_list_pending_devicesList devices pending adoption

Clients

ToolDescription
unifi_list_clientsList all connected clients
unifi_get_clientGet client details
unifi_authorize_guestAuthorize guest on hotspot

Networks

ToolDescription
unifi_list_networksList all networks
unifi_get_networkGet network details
unifi_create_networkCreate a network
unifi_update_networkUpdate a network
unifi_delete_networkDelete a network

WiFi

ToolDescription
unifi_list_wifiList all WiFi networks (SSIDs)
unifi_get_wifiGet WiFi network details
unifi_create_wifiCreate WiFi network
unifi_update_wifiUpdate WiFi network
unifi_delete_wifiDelete WiFi network

Hotspot Vouchers

ToolDescription
unifi_list_vouchersList all vouchers
unifi_get_voucherGet voucher details
unifi_create_voucherCreate vouchers
unifi_update_voucherUpdate voucher
unifi_delete_voucherDelete voucher

Firewall Zones

ToolDescription
unifi_list_firewall_zonesList firewall zones
unifi_get_firewall_zoneGet zone details
unifi_create_firewall_zoneCreate zone
unifi_update_firewall_zoneUpdate zone
unifi_delete_firewall_zoneDelete zone

ACL Rules (Firewall)

ToolDescription
unifi_list_acl_rulesList all ACL rules
unifi_get_acl_ruleGet rule details
unifi_create_acl_ruleCreate ACL rule
unifi_update_acl_ruleUpdate ACL rule
unifi_delete_acl_ruleDelete ACL rule
unifi_batch_update_acl_rulesBatch update rules

Traffic Matching Lists

ToolDescription
unifi_list_traffic_matching_listsList all matching lists
unifi_get_traffic_matching_listGet list details
unifi_create_traffic_matching_listCreate matching list
unifi_update_traffic_matching_listUpdate matching list
unifi_delete_traffic_matching_listDelete matching list

Supporting Resources

ToolDescription
unifi_list_wansList WAN interfaces
unifi_list_vpnsList VPN configurations
unifi_list_radius_profilesList RADIUS profiles
unifi_get_system_logGet system log entries
unifi_list_dpi_categoriesList DPI categories
unifi_list_dpi_applicationsList DPI applications
unifi_list_countriesList countries for geo rules

Example Prompts

Once configured, use natural language:

"List all my UniFi sites"

"What devices are connected to my network?"

"Create a guest WiFi network with WPA3 security"

"Show me which clients are currently connected"

"Create 10 hotspot vouchers valid for 24 hours"

"Block traffic from the IoT network to the main network"

"Restart the access point in the living room"

"What's the current status of my UDM Pro?"

Development

npm install      # Install dependencies
npm run dev      # Run in development mode
npm run build    # Build for production
npm run watch    # Watch mode

API Endpoint

The MCP server connects to the UniFi Network Integration API at:

{UNIFI_BASE_URL}/proxy/network/integration/v1/...

This is the official public API introduced in UniFi Network 9.0+.

Security

  • Keep API keys secure and never commit them to version control
  • Use environment variables for sensitive configuration
  • API keys inherit user permissions - use least privilege principle
  • Consider creating a dedicated API user for automation

License

MIT

Links

Reviews

No reviews yet

Sign in to write a review