Unifi-MCP-Server

MidwestMountaineer/Unifi-MCP-Server

3.2

If you are the rightful owner of Unifi-MCP-Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The UniFi MCP Server is a Model Context Protocol server designed to integrate UniFi Network Controllers with AI agents, enabling natural language interaction with network infrastructure.

Tools
5
Resources
0
Prompts
0

UniFi MCP Server

MCP server for UniFi Network Controller - manage your network with AI assistants using natural language.

Python 3.11+ MCP

Features

25 read-only tools across 4 categories:

CategoryToolsExamples
Discovery8List devices, clients, networks, WLANs
Security7Firewall rules, IPS status, port forwards
Statistics7Network stats, top clients, DPI, alerts
Migration3DHCP status, VLAN connectivity, config export

Quick Start

1. Install

# Using uvx (recommended)
uvx --from git+https://github.com/MidwestMountaineer/Unifi-MCP-Server.git unifi-mcp-server

# Or pip
pip install git+https://github.com/MidwestMountaineer/Unifi-MCP-Server.git

2. Get API Key

  1. Log into your Dream Machine
  2. SettingsSystemAdvancedAPI
  3. Create new API key with Read Only permissions
  4. Copy the key (shown only once)

3. Configure

Add to your MCP client config (e.g., .kiro/settings/mcp.json):

{
  "mcpServers": {
    "unifi": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/MidwestMountaineer/Unifi-MCP-Server.git", "unifi-mcp-server"],
      "env": {
        "UNIFI_HOST": "192.168.1.1",
        "UNIFI_API_KEY": "your-api-key-here",
        "UNIFI_VERIFY_SSL": "false"
      }
    }
  }
}

4. Test

Ask your AI assistant: "List all my UniFi devices"

Kiro Power

This repo is also a Kiro Power with guided workflows. Install via Kiro's "Add power from GitHub":

https://github.com/MidwestMountaineer/Unifi-MCP-Server

See for workflow documentation.

Configuration

VariableDescriptionDefault
UNIFI_HOSTController IP(required)
UNIFI_API_KEYAPI key(required for UniFi OS)
UNIFI_USERNAMEUsername(for traditional controllers)
UNIFI_PASSWORDPassword(for traditional controllers)
UNIFI_PORTController port443
UNIFI_SITESite namedefault
UNIFI_VERIFY_SSLVerify SSLfalse
LOG_LEVELLog verbosityINFO

Available Tools

Discovery

  • unifi_list_devices / unifi_get_device_details
  • unifi_list_clients / unifi_get_client_details
  • unifi_list_networks / unifi_get_network_details
  • unifi_list_wlans / unifi_get_wlan_details

Security

  • unifi_list_firewall_rules / unifi_get_firewall_rule_details
  • unifi_list_traffic_routes / unifi_get_route_details
  • unifi_list_port_forwards / unifi_get_port_forward_details
  • unifi_get_ips_status

Statistics

  • unifi_get_network_stats / unifi_get_system_health
  • unifi_get_client_stats / unifi_get_device_stats
  • unifi_get_top_clients / unifi_get_dpi_stats
  • unifi_get_alerts

Migration

  • unifi_get_dhcp_status
  • unifi_verify_vlan_connectivity
  • unifi_export_configuration

Docker

docker-compose up -d

See for details.

Development

# Clone and install
git clone https://github.com/MidwestMountaineer/Unifi-MCP-Server.git
cd Unifi-MCP-Server
pip install -e ".[dev]"

# Run tests
pytest

# Dev console
python devtools/dev_console.py

Troubleshooting

IssueSolution
Connection refusedCheck UNIFI_HOST and controller is reachable
401 UnauthorizedRegenerate API key with correct permissions
SSL errorsSet UNIFI_VERIFY_SSL=false
Empty resultsCheck UNIFI_SITE name, upgrade API key to Full Management

License

MIT - See