UniFi Network MCP Server
Click on "Deploy 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 Server list 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 --uninstallRelated MCP server: UniFi MCP Server
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
# 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
Links
Available Tools
52 toolsunifi_adopt_deviceC
Adopt a pending device
Inputs: siteId (required), deviceId (required).
unifi_authorize_guestC
Authorize a guest client on a hotspot network
Inputs: siteId (required), clientId (required), timeLimitMinutes, dataUsageLimitMBytes, +2 more.
unifi_bulk_delete_vouchersB
Bulk delete hotspot vouchers based on filter criteria (e.g., 'expired.eq(true)' to delete all expired vouchers)
Inputs: siteId (required), filter (required).
unifi_create_acl_ruleC
Create a new ACL (firewall) rule
Inputs: siteId (required), type (required), name (required), enabled (required), +4 more.
unifi_create_firewall_zoneC
Create a new custom firewall zone
Inputs: siteId (required), name (required), networkIds (required).
unifi_create_networkC
Create a new network
Inputs: siteId (required), name (required), management (required), enabled (required), +1 more.
unifi_create_traffic_matching_listC
Create a new traffic matching list
Inputs: siteId (required), type (required), name (required), items (required).
unifi_create_voucherC
Create hotspot vouchers
Inputs: siteId (required), name (required), timeLimitMinutes (required), count, +4 more.
unifi_create_wifiC
Create a new WiFi network (SSID)
Inputs: siteId (required), name (required), enabled (required), type (required), +1 more.
unifi_delete_acl_ruleC
Delete an ACL rule
Inputs: siteId (required), aclRuleId (required).
unifi_delete_firewall_zoneC
Delete a custom firewall zone
Inputs: siteId (required), firewallZoneId (required).
unifi_delete_networkC
Delete a network
Inputs: siteId (required), networkId (required), cascade, force.
unifi_delete_traffic_matching_listC
Delete a traffic matching list
Inputs: siteId (required), trafficMatchingListId (required).
unifi_delete_voucherC
Delete a hotspot voucher
Inputs: siteId (required), voucherId (required).
unifi_delete_wifiC
Delete a WiFi network
Inputs: siteId (required), wifiBroadcastId (required), force.
unifi_get_acl_ruleC
Get a specific ACL rule by ID
Inputs: siteId (required), aclRuleId (required).
unifi_get_clientB
Get a specific client by ID
Inputs: siteId (required), clientId (required).
unifi_get_deviceB
Get a specific device by ID
Inputs: siteId (required), deviceId (required).
unifi_get_device_statisticsC
Get latest statistics for a device
Inputs: siteId (required), deviceId (required).
unifi_get_firewall_zoneC
Get a specific firewall zone by ID
Inputs: siteId (required), firewallZoneId (required).
unifi_get_infoB
Get application information including version and whether it's a UniFi OS Console
Inputs: no named parameters.
unifi_get_networkC
Get a specific network by ID
Inputs: siteId (required), networkId (required).
unifi_get_network_referencesB
Get references to a network (what WiFi broadcasts, firewall zones, etc. use this network)
Inputs: siteId (required), networkId (required).
unifi_get_traffic_matching_listC
Get a specific traffic matching list by ID
Inputs: siteId (required), trafficMatchingListId (required).
unifi_get_voucherB
Get a specific hotspot voucher by ID
Inputs: siteId (required), voucherId (required).
unifi_get_wifiC
Get a specific WiFi network by ID
Inputs: siteId (required), wifiBroadcastId (required).
unifi_list_acl_rulesB
List all ACL (firewall) rules at a site
Inputs: siteId (required), offset, limit, filter.
unifi_list_clientsC
List all connected clients (wired, wireless, VPN) at a site
Inputs: siteId (required), offset, limit, filter.
unifi_list_countriesB
List all countries/regions for geo-based rules (ISO codes and names)
Inputs: offset, limit, filter.
unifi_list_devicesB
List all adopted devices at a site
Inputs: siteId (required), offset, limit, filter.
unifi_list_device_tagsC
List all device tags at a site (used for WiFi broadcast assignments)
Inputs: siteId (required), offset, limit, filter.
unifi_list_dpi_applicationsC
List all DPI applications for traffic identification and filtering
Inputs: offset, limit, filter.
unifi_list_dpi_categoriesC
List all DPI (Deep Packet Inspection) categories for traffic identification
Inputs: offset, limit, filter.
unifi_list_firewall_zonesB
List all firewall zones at a site
Inputs: siteId (required), offset, limit, filter.
unifi_list_networksB
List all networks at a site
Inputs: siteId (required), offset, limit, filter.
unifi_list_pending_devicesB
List devices pending adoption (global, not site-specific)
Inputs: offset, limit, filter.
unifi_list_radius_profilesB
List all RADIUS profiles at a site
Inputs: siteId (required), offset, limit, filter.
unifi_list_sitesC
List all sites available to the API key
Inputs: offset, limit, filter.
unifi_list_traffic_matching_listsB
List all traffic matching lists at a site (port groups, IP groups)
Inputs: siteId (required), offset, limit, filter.
unifi_list_vouchersB
List all hotspot vouchers at a site
Inputs: siteId (required), offset, limit, filter.
unifi_list_vpn_serversB
List all VPN servers at a site
Inputs: siteId (required), offset, limit, filter.
unifi_list_vpn_tunnelsC
List all site-to-site VPN tunnels at a site
Inputs: siteId (required), offset, limit, filter.
unifi_list_wansB
List all WAN interfaces at a site
Inputs: siteId (required), offset, limit.
unifi_list_wifiC
List all WiFi broadcasts (SSIDs) at a site
Inputs: siteId (required), offset, limit, filter.
unifi_locate_deviceC
Enable or disable the locate function (flashing LED) on a device
Inputs: siteId (required), deviceId (required), enabled (required).
unifi_power_cycle_portB
Power cycle a specific port on a device (PoE restart)
Inputs: siteId (required), deviceId (required), portIdx (required).
unifi_restart_deviceC
Restart a device
Inputs: siteId (required), deviceId (required).
unifi_update_acl_ruleC
Update an ACL rule
Inputs: siteId (required), aclRuleId (required), type, name, +4 more.
unifi_update_firewall_zoneC
Update a firewall zone
Inputs: siteId (required), firewallZoneId (required), name (required), networkIds (required).
unifi_update_networkC
Update an existing network
Inputs: siteId (required), networkId (required), name, management, +2 more.
unifi_update_traffic_matching_listC
Update a traffic matching list
Inputs: siteId (required), trafficMatchingListId (required), type, name, +1 more.
unifi_update_wifiC
Update an existing WiFi network
Inputs: siteId (required), wifiBroadcastId (required), name, enabled.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 52 tools
Most tools have distinct purposes targeting specific resources and actions, such as unifi_get_acl_rule for retrieving a rule and unifi_update_acl_rule for modifying it. However, some overlap exists, like unifi_list_acl_rules and unifi_get_acl_rule, which could cause confusion if an agent needs to differentiate between listing all rules and fetching a specific one by ID, though descriptions help clarify this.
All tool names follow a consistent verb_noun pattern with a 'unifi_' prefix, such as unifi_create_network, unifi_delete_wifi, and unifi_list_devices. This uniformity makes the tool set predictable and easy to navigate, with no deviations in naming conventions.
With 52 tools, the count is excessive for a network management server, making it overwhelming and difficult for agents to manage. While the domain is broad, this many tools suggests poor scoping, as many operations could be consolidated or streamlined, leading to potential confusion and inefficiency.
The tool set provides comprehensive coverage for UniFi network management, including CRUD operations for key resources like networks, WiFi, ACL rules, and vouchers, along with monitoring, configuration, and maintenance tasks. No obvious gaps are present, ensuring agents can handle full lifecycle workflows without dead ends.
Maintenance
Related MCP Connectors
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
IP intelligence, network diagnostics, and AI service availability tools for AI agents.
One place to build, share, and govern the skills and tools your AI agents use at work.
Image and video AI tools and your own pipelines, run from any AI assistant.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI assistants to interact with Ubiquiti UniFi network infrastructure for monitoring devices, managing clients, and performing configuration tasks like blocking/unblocking devices and viewing network health.101GPL 3.0
- AlicenseDqualityNot gradedmaintenanceEnables comprehensive management of UniFi network infrastructure through the UniFi Cloud API, including device control, client management, camera settings, and access door control through natural language.39MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to manage and monitor UniFi Network Controllers through natural language. Provides 25 read-only tools for discovering devices and clients, viewing security configurations, analyzing network statistics, and exporting configuration data.41MIT
- AlicenseCqualityAmaintenanceEnables AI agents to manage UniFi network infrastructure via the Model Context Protocol, supporting device management, network configuration, security, and QoS through local or cloud APIs.7143 npm493 PyPI369Apache 2.0