- Home
- MCP servers
- UniFi Network
UniFi Network
- typescript
0
GitHub Stars
typescript
Language
6 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"ruashots-unifi-network-mcp": {
"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"
}
}
}
}You can run a dedicated MCP server to manage UniFi Network through AI assistants. It exposes a large set of tools to interact with sites, devices, networks, WiFi, vouchers, firewall rules, and more, letting you automate and streamline common network operations from natural language prompts.
How to use
Once you have the MCP server running, you can connect a client (such as Claude) and start issuing natural language prompts. Your prompts can request actions like listing sites, viewing device details, adopting a device, creating a network, provisioning a new WiFi SSID, generating guest vouchers, or blocking specific traffic. The server translates these requests into UniFi Network API calls and returns structured results that you can use in your automation workflows.
Practical usage patterns you can try include: asking for an overview of your sites, checking which devices are online, creating a guest WiFi network with secure settings, generating time-limited hotspot vouchers, and applying firewall rules to segment traffic between networks.
How to install
# Prerequisites
- Node.js v18+
- Optional: jq for Claude Code automation
# Install the MCP server locally
curl -fsSL https://raw.githubusercontent.com/Ruashots/unifi-network-mcp/master/install.sh | bash
# Reconfigure credentials later if needed
~/.local/share/unifi-network-mcp/install.sh --reconfigure
# Uninstall when you’re done
~/.local/share/unifi-network-mcp/install.sh --uninstall
Manual installation steps if you prefer to set things up by hand: clone, install dependencies, and build.
# Clone the repository
git clone https://github.com/Ruashots/unifi-network-mcp.git
cd unifi-network-mcp
# Install dependencies
npm install
# Build the project
npm run build
Additional setup and configuration
The MCP server connects to the UniFi Network Integration API to perform actions. You will need your UniFi Console URL and an API key with at least Site Admin or Super Admin permissions. Use these values to configure your MCP client so it can pass authentication to UniFi.
Environment variables you commonly configure include the base URL of your UniFi Console and the API key. These values are used by the MCP client to authorize requests.
{
"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"
}
}
}
}
Security and maintenance
Use dedicated API credentials with the least privilege necessary for automation. Keep API keys secure and rotate them periodically. Use environment variables to avoid exposing secrets in code or configuration files.
Regularly review your connected clients, pending device adoptions, and firewall configurations to ensure they align with your security policies.
Troubleshooting and notes
If you encounter connection issues, verify the UniFi Console URL is reachable from the MCP host and that the API key has the required permissions. Check that the MCP server has network access to the UniFi Controller.
When upgrading the MCP server, rebuild and restart the service to ensure all tools and endpoints are up to date.
Example prompts to try
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
Available tools
unifi_get_info
Get application version and type
unifi_list_sites
List all sites accessible to the API key
unifi_list_devices
List all devices at a site
unifi_get_device
Get device details
unifi_get_device_statistics
Get latest device statistics
unifi_adopt_device
Adopt a pending device
unifi_restart_device
Restart a device
unifi_locate_device
Flash device LED
unifi_list_pending_devices
List devices pending adoption
unifi_list_clients
List all connected clients
unifi_get_client
Get client details
unifi_authorize_guest
Authorize guest on hotspot
unifi_list_networks
List all networks
unifi_get_network
Get network details
unifi_create_network
Create a network
unifi_update_network
Update a network
unifi_delete_network
Delete a network
unifi_list_wifi
List all WiFi networks (SSIDs)
unifi_get_wifi
Get WiFi network details
unifi_create_wifi
Create WiFi network
unifi_update_wifi
Update WiFi network
unifi_delete_wifi
Delete WiFi network
unifi_list_vouchers
List all vouchers
unifi_get_voucher
Get voucher details
unifi_create_voucher
Create vouchers
unifi_update_voucher
Update voucher
unifi_delete_voucher
Delete voucher
unifi_list_firewall_zones
List firewall zones
unifi_get_firewall_zone
Get zone details
unifi_create_firewall_zone
Create zone
unifi_update_firewall_zone
Update zone
unifi_delete_firewall_zone
Delete zone
unifi_list_acl_rules
List all ACL rules
unifi_get_acl_rule
Get rule details
unifi_create_acl_rule
Create ACL rule
unifi_update_acl_rule
Update ACL rule
unifi_delete_acl_rule
Delete ACL rule
unifi_batch_update_acl_rules
Batch update rules
unifi_list_traffic_matching_lists
List all matching lists
unifi_get_traffic_matching_list
Get list details
unifi_create_traffic_matching_list
Create matching list
unifi_update_traffic_matching_list
Update matching list
unifi_delete_traffic_matching_list
Delete matching list
unifi_list_wans
List WAN interfaces
unifi_list_vpns
List VPN configurations
unifi_list_radius_profiles
List RADIUS profiles
unifi_get_system_log
Get system log entries
unifi_list_dpi_categories
List DPI categories
unifi_list_dpi_applications
List DPI applications
unifi_list_countries
List countries for geo rules