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
This will:
Clone the repository to
~/.local/share/unifi-network-mcpInstall dependencies and build
Prompt for your UniFi Console URL and API key
Configure Claude Code automatically
Other commands:
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
Log into your UniFi Console
Click your profile icon (bottom left)
Go to API section
Click Create API Key
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
Usage
Claude Code CLI
Scope options:
Flag | Description |
(default) | Local to current directory |
| Available across all your projects |
| Shared with team via |
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
Environment Variables
Variable | Description |
| Your UniFi Console URL (e.g., |
| API key from your UniFi Console |
Available Tools
Application
Tool | Description |
| Get application version and type |
Sites
Tool | Description |
| List all sites |
Devices
Tool | Description |
| List all devices at a site |
| Get device details |
| Get latest device statistics |
| Adopt a pending device |
| Restart a device |
| Flash device LED |
| List devices pending adoption |
Clients
Tool | Description |
| List all connected clients |
| Get client details |
| Authorize guest on hotspot |
Networks
Tool | Description |
| List all networks |
| Get network details |
| Create a network |
| Update a network |
| Delete a network |
WiFi
Tool | Description |
| List all WiFi networks (SSIDs) |
| Get WiFi network details |
| Create WiFi network |
| Update WiFi network |
| Delete WiFi network |
Hotspot Vouchers
Tool | Description |
| List all vouchers |
| Get voucher details |
| Create vouchers |
| Update voucher |
| Delete voucher |
Firewall Zones
Tool | Description |
| List firewall zones |
| Get zone details |
| Create zone |
| Update zone |
| Delete zone |
ACL Rules (Firewall)
Tool | Description |
| List all ACL rules |
| Get rule details |
| Create ACL rule |
| Update ACL rule |
| Delete ACL rule |
| Batch update rules |
Traffic Matching Lists
Tool | Description |
| List all matching lists |
| Get list details |
| Create matching list |
| Update matching list |
| Delete matching list |
Supporting Resources
Tool | Description |
| List WAN interfaces |
| List VPN configurations |
| List RADIUS profiles |
| Get system log entries |
| List DPI categories |
| List DPI applications |
| List countries for geo rules |
Example Prompts
Once configured, use natural language:
Development
API Endpoint
The MCP server connects to the UniFi Network Integration API at:
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