Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@UniFi Network MCP Serverlist all connected clients on my network"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 | bashThis 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:
# Reconfigure credentials
~/.local/share/unifi-network-mcp/install.sh --reconfigure
# Uninstall
~/.local/share/unifi-network-mcp/install.sh --uninstallFeatures
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
# Clone the repository
git clone https://github.com/Ruashots/unifi-network-mcp.git
cd unifi-network-mcp
# Install dependencies
npm install
# Build
npm run buildUsage
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.jsScope 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
{
"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
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:
"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 modeAPI 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