Skip to main content
Glama

unifi-mcp

MCP server that turns Claude into a UniFi network specialist. Manage devices, optimize WiFi, audit security, and troubleshoot your network through natural language.

Quick Start

1. Get your API key from your UniFi controller: Settings > Integrations > Create API Key

2. Add to Claude Code:

claude mcp add unifi -e UNIFI_API_URL=https://YOUR-CONTROLLER-IP -e UNIFI_API_KEY=YOUR-KEY -- npx unifi-mcp

3. Ask Claude anything about your network:

> What's the health of my network?
> Run a security audit
> Optimize my WiFi
> Show me all connected clients
> Set up a guest network with 24h vouchers

That's it. No config files, no cloning, no build step.

Related MCP server: UniFi MCP

What It Does

Claude gets 31 tools (29 direct tools + 2 agent-routing tools) that cover the full UniFi Network API, plus specialist prompts that guide it to think like a network engineer:

Ask

What happens

"Is my network healthy?"

Checks all devices, stats, firmware, client distribution, WAN status

"Why is my WiFi slow?"

Correlates AP radio stats, TX retries, channel congestion, client counts

"Is my network secure?"

Audits VLANs, firewall zones/policies, WiFi security types, DNS filtering

"Optimize my WiFi"

Analyzes channels, power, data rates, band steering, SSID count

"Create a guest network"

Orchestrates network + SSID + firewall rules + vouchers

The specialist knowledge is in the tool descriptions and server instructions -- Claude knows what to check, what "good" looks like, and what to recommend.

Tools

Read (safe, no confirmation needed)

Tool

What it reads

get_system_info

Controller version

list_sites

All managed sites

list_devices

Devices with state, firmware, model

get_device

Single device: radios, ports, topology

get_device_stats

Real-time CPU, memory, load, TX/RX, radio stats

list_pending_devices

Devices awaiting adoption

list_clients

Connected clients with type, AP, IP

get_client

Single client detail

list_networks

VLANs and network configs

list_wifi

SSIDs with security, rates, isolation

list_firewall_zones

Firewall zone definitions

list_firewall_policies

Policies with ordering

get_wan_status

WAN interface status

list_vpn

VPN tunnels and servers

list_dpi_apps

DPI application categories

Write (Claude will ask for confirmation)

Tool

What it does

device_action

Restart, upgrade, locate, adopt

client_action

Authorize, block, reconnect

manage_network

Create/update/delete VLANs

manage_wifi

Create/update/delete SSIDs

manage_firewall_zone

Create/update/delete zones

manage_firewall_policy

Create/update/delete/reorder policies

manage_acl_rule

Create/update/delete/reorder ACL rules

manage_dns_policy

Create/update/delete DNS policies

manage_traffic_rule

Create/update/delete traffic rules

manage_vouchers

Create/delete hotspot vouchers

save_network_profile

Save personalized network profile to ~/.unifi-mcp/profile.json

Agent Routing

Tool

What it does

search_actions

Search an action catalog by query/category/read-only to find the right action

execute_action

Execute any catalog action by actionId with a generic params object

Prompts

Prompt

What it does

init

First-time setup: discover your network, agree on conventions, assess security, save a profile

doctor

Diagnose issues: check devices, clients, connectivity, and performance

optimize

Full optimization: WiFi, client placement, firewall hygiene, device health, architecture

security-review

Threat model: attack chains, systemic findings, reachability tracing, live remediation

Environment Variables

Variable

Required

Description

UNIFI_API_URL

Yes

Controller URL, e.g. https://192.168.1.1

UNIFI_API_KEY

Yes

API key from Settings > Integrations

UNIFI_SITE_ID

No

Site ID (auto-detects first site)

UNIFI_VERIFY_TLS

No

Set to true to enforce TLS (default: false for self-signed certs)

Requirements

  • UniFi controller with API access (Network 10.x+)

  • Node.js >= 18

  • An API key (generated in your controller's Integrations settings)

Your controller also has built-in API docs at https://YOUR-CONTROLLER-IP/unifi-api/network — useful for exploring endpoints and schemas.

Development

git clone https://github.com/pproenca/unifi-mcp.git
cd unifi-mcp
npm install
npm run generate:openapi-types
npm run build
npm test
npm run test:coverage
npm run test:mcp-smoke
npm run verify

# Test with MCP Inspector
mise run dev

# Or run directly
UNIFI_API_URL=https://192.168.1.1 UNIFI_API_KEY=xxx node dist/index.js

npm run build emits the publishable server into dist/. Test runs compile into dist-test/ so the npm package only ships runtime assets.

License

MIT

Available Tools

31 tools
client_actionA
Destructive

Execute hotspot guest access actions on a connected client. AUTHORIZE_GUEST_ACCESS grants guest WiFi access, UNAUTHORIZE_GUEST_ACCESS revokes it.

Inputs: clientId (required), action (required).

device_actionA
Destructive

Execute an action on an adopted device. Currently supports RESTART (reboot). WARNING: restart will briefly disconnect all clients on that device.

Inputs: deviceId (required), action (required).

execute_actionA
Destructive

Execute a UniFi action by actionId using a generic params object. This is useful for agents that prefer a stable two-tool interface: search_actions + execute_action.

Inputs: actionId (required), params.

get_clientA
Read-onlyIdempotent

Get detailed info for a single connected client. Shows which AP/switch it's connected to, signal strength, connection type, and network membership. Use this to troubleshoot a specific device's connectivity.

Inputs: clientId (required).

get_deviceA
Read-onlyIdempotent

Get full details for a single adopted device including uplink topology, radio interfaces, port configuration, features, and provisioning info. Use this to inspect a specific device after list_devices identifies one of interest. The response includes interfaces.radios (for APs) and interfaces.ports (for switches).

Inputs: deviceId (required).

get_device_statsA
Read-onlyIdempotent

Get real-time performance statistics for a device: CPU utilization, memory usage, load averages (1/5/15 min), uptime, uplink TX/RX rates, and radio stats. Key for diagnosing performance issues — high CPU or memory on an AP often explains client disconnects. Compare load averages across devices to spot overloaded APs.

Inputs: deviceId (required).

get_system_infoA
Read-onlyIdempotent

Get UniFi Network application version and basic info. Use this first to verify the connection is working and check the controller version. If this fails, check UNIFI_API_URL and UNIFI_API_KEY.

Inputs: no named parameters.

get_wan_statusA
Read-onlyIdempotent

List WAN (internet uplink) interfaces with status, IP, and throughput. Use this to diagnose internet connectivity issues or check multi-WAN setups. Shows each WAN port's connection state and current bandwidth.

Inputs: no named parameters.

list_clientsA
Read-onlyIdempotent

List all currently connected clients (wired, wireless, VPN, guest). Shows client type, MAC, IP, connection time, and authorization status. Use this to check client distribution across APs — if one AP has 20 clients and another has 3, there may be a roaming or placement issue. Also check for unauthorized guests that may need attention. To identify unknown clients, check: (1) MAC address — if bit 1 of the first octet is set (second hex char is 2/3/6/7/a/b/e/f), the MAC is randomized (modern phone/laptop/tablet); if not, the first 3 octets are an OUI identifying the manufacturer. (2) IP address — cross-reference with list_networks to determine which VLAN/network the client is on. (3) Connection type — WIRED clients are typically infrastructure (servers, smart hubs, media devices); WIRELESS with randomized MAC are personal devices. (4) Name — a descriptive hostname means the device announced itself via DHCP; a raw MAC address means the device didn't announce a name and needs an alias.

Inputs: filter, limit.

list_devicesA
Read-onlyIdempotent

List all adopted UniFi devices (APs, switches, gateways, etc.) with their state, firmware version, model, IP, and MAC. Use this to assess fleet health: look for OFFLINE devices, firmware that needs updating (firmwareUpdatable=true), and feature/interface differences across your deployment. Determine each device's role from its features: switching+accessPoint = gateway combo (UDM/UDR/UXG), accessPoint only = AP, switching only = switch. Supports filtering — e.g. filter="state.eq('OFFLINE')" to find down devices.

Inputs: filter, limit.

list_dpi_appsA
Read-onlyIdempotent

List DPI (Deep Packet Inspection) application categories and applications. Returns the catalog of recognized traffic types (e.g. Streaming, Gaming, Social Media) and specific applications (e.g. Netflix, YouTube, Zoom). Use this to understand traffic classification for creating traffic rules or analyzing what's consuming bandwidth on the network.

Inputs: no named parameters.

list_firewall_policiesA
Read-onlyIdempotent

List all firewall policies with their source/destination zones, actions, and ordering. Policies are evaluated in order — first match wins. Check for: - Overly permissive rules (any→any allow) - Missing inter-zone rules (IoT should not reach LAN) - Disabled policies that may need attention Use manage_firewall_policy to create/modify/reorder policies.

Inputs: no named parameters.

list_firewall_zonesA
Read-onlyIdempotent

List all firewall zones. Zones group network interfaces for policy enforcement. A well-segmented network has separate zones for LAN, IoT, Guest, and WAN. Policies are defined between zone pairs (source → destination).

Inputs: no named parameters.

list_known_clientsA
Read-onlyIdempotent

List ALL historically known clients (not just currently connected) with rich metadata from the classic REST API. Returns fields the integration API doesn't expose: oui (manufacturer from MAC OUI lookup), hostname (DHCP hostname), last_radio (ng=2.4GHz, na=5GHz), last_connection_network_name, first_seen, last_seen. Use this as the FIRST identification tool for unknown clients — the oui field identifies the manufacturer without any network scanning. Works across VLANs (no firewall limitations like nmap/dns-sd).

Inputs: no named parameters.

list_networksA
Read-onlyIdempotent

List all network configurations including VLAN IDs, DHCP settings, and status. Check for proper network segmentation — IoT devices should be on a separate VLAN from your main network. The 'default' network (VLAN 1) is the untagged LAN. Additional networks use VLAN IDs >= 2.

Inputs: filter.

list_pending_devicesA
Read-onlyIdempotent

List devices discovered on the network but not yet adopted. These are new devices plugged in or factory-reset devices waiting for adoption. Use device_action with action 'adopt' to bring them under management.

Inputs: no named parameters.

list_sitesA
Read-onlyIdempotent

List all UniFi sites on this controller. Most controllers have a single 'default' site, but multi-site setups exist. The site ID is required for nearly all other tools — call this first if you need it. If UNIFI_SITE_ID is set, that site is used automatically.

Inputs: no named parameters.

list_vpnA
Read-onlyIdempotent

List VPN tunnels and servers. Returns both site-to-site VPN tunnels (connecting remote sites) and VPN servers (for remote client access). Check tunnel status and uptime for connectivity monitoring.

Inputs: no named parameters.

list_wifiA
Read-onlyIdempotent

List all WiFi SSIDs (broadcasts) with their security config, data rates, client isolation, multicast settings, and associated network. Key things to check for optimization: - Security type (WPA3 preferred over WPA2) - Data rates (higher minimum rates improve airtime efficiency) - Client isolation (should be ON for guest networks) - Multicast-to-unicast conversion (ON improves performance with smart home devices) - Hidden SSID (avoid — causes probe request overhead)

Inputs: filter.

manage_acl_ruleA
Destructive

List, create, update, delete, or reorder ACL (Access Control List) rules. ACL rules provide fine-grained network access control beyond firewall policies. LIST: returns all ACL rules with ordering. CREATE: define source/destination criteria and allow/deny action. REORDER: pass { ruleIds: ['id1', 'id2', ...] } — order matters, first match wins.

Inputs: action (required), ruleId, name, type, +7 more.

manage_clientA
DestructiveIdempotent

Set or update the friendly name (alias) for a network client. Use this to replace MAC-only or generic hostnames with descriptive names. Convention: {type}-{owner-or-purpose} — e.g. 'phone-pedro', 'laptop-work', 'tv-living-room', 'speaker-kitchen'. Identify the client's MAC from list_clients first. Uses the classic Network Application REST API (the integration API v1 does not support client updates).

Inputs: action (required), macAddress (required), name (required).

manage_deviceA
Destructive

Update properties of an adopted device — primarily for renaming. Use this to give devices self-documenting names following the {role}-{location} convention. Determine the role from the device's features array: switching+accessPoint (UDM/UDR/UXG combo) → gw, accessPoint only → ap, switching only → sw. Then append the physical location: gw-office, ap-living-room, sw-desk. Call list_devices or get_device first to check the current name and features. Uses the classic Network Application REST API (the integration API v1 does not support device updates).

Inputs: action (required), deviceId (required), name.

manage_dns_policyA
Destructive

List, create, update, or delete DNS filtering policies. DNS policies control which domains clients can resolve — use for content filtering, ad blocking, or security (blocking known malicious domains). LIST: returns all DNS policies. CREATE/UPDATE: define filtering rules and target clients/networks.

Inputs: action (required), policyId, name, type, +2 more.

manage_firewall_policyA
Destructive

Create, update, delete, or reorder firewall policies. Policies define traffic rules between zone pairs. CREATE requires: enabled, name, action, source (with zoneId), destination (with zoneId), ipProtocolScope, loggingEnabled. REORDER: pass data as { policyIds: ['id1', 'id2', ...] } to set evaluation order. CRITICAL: Policy order matters — first match wins. Always verify order after changes.

Inputs: action (required), policyId, enabled, name, +7 more.

manage_firewall_zoneA
Destructive

Create, update, or delete a custom firewall zone. Zones are containers for network interfaces — create one per security boundary (e.g. 'IoT', 'Guest', 'Cameras'). Default zones (LAN, WAN) cannot be deleted. After creating a zone, assign networks to it and create policies between zones.

Inputs: action (required), zoneId, name, networkIds.

manage_networkA
Destructive

Create, update, or delete a network. CREATE: provide name, vlanId (>=2 for non-default), enabled, management type. UPDATE: provide networkId + fields to change. DELETE: provide networkId — WARNING: disconnects all clients on that network. Use list_networks to see existing configs before modifying. For VLAN segmentation (e.g. IoT isolation), create a new network with a unique VLAN ID, then assign a WiFi SSID to it with manage_wifi.

Inputs: action (required), networkId, name, enabled, +2 more.

manage_traffic_ruleA
Destructive

List, create, update, or delete traffic matching lists. Traffic rules define patterns for matching network traffic — used by firewall policies and QoS rules to identify specific traffic types (e.g. gaming, video streaming). LIST: returns all traffic matching lists. CREATE/UPDATE: define matching criteria (ports, protocols, IP ranges, DPI apps).

Inputs: action (required), ruleId, name, type, +1 more.

manage_vouchersA
Destructive

List, create, or delete hotspot vouchers for guest WiFi access. LIST: returns all active vouchers. CREATE: generate one or more vouchers with time limit, optional data cap, and optional rate limiting. Each voucher is a unique code guests enter to get online. CREATE params: count (number to generate), name (note), timeLimitMinutes (required), authorizedGuestLimit, dataUsageLimitMBytes, rxRateLimitKbps, txRateLimitKbps. DELETE: remove a single voucher by ID, or delete all vouchers (use with caution).

Inputs: action (required), voucherId, name, count, +6 more.

manage_wifiA
Destructive

Create, update, or delete a WiFi SSID (broadcast). CREATE requires: type, name, enabled, securityConfiguration, multicastToUnicastConversionEnabled, clientIsolationEnabled, hideName, uapsdEnabled. Key config fields for optimization: - basicDataRateKbpsByFrequencyGHz: set 2.4GHz min to 12000+ and 5GHz to 12000+ to reduce legacy rate overhead - clientIsolationEnabled: true for guest SSIDs - multicastToUnicastConversionEnabled: true for better smart home performance - broadcastingDeviceFilter: limit which APs broadcast this SSID - network: associate with a VLAN network for segmentation Use list_wifi to see existing configs before modifying.

Inputs: action (required), wifiId, type, name, +8 more.

save_network_profileA

Save the network profile generated during init. This persists the profile to ~/.unifi-mcp/profile.json so it's available as the unifi://network/profile resource in all future conversations. Only call this after completing the init discovery flow.

Inputs: profile (required).

search_actionsA
Read-onlyIdempotent

Search the UniFi action catalog and return action IDs that can be executed via execute_action. Use this when the direct tool list is too large or when you want category-focused discovery.

Inputs: query, category, readOnly, limit.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 31 tools

    Disambiguation4/5

    Most tools have distinct purposes with detailed descriptions. Potential overlap between client_action/manage_client and device_action/manage_device is clarified by their descriptions. List vs get tools are properly differentiated.

    Naming Consistency4/5

    Predominantly verb_noun with underscore (list_, get_, manage_). Some deviations like client_action and device_action (noun_verb) and execute_action/search_actions (verb_noun with 'action' suffix). Overall pattern is clear but not perfectly uniform.

    Tool Count3/5

    31 tools is high but justified by the broad scope of UniFi network management (clients, devices, WiFi, firewall, VPN, DNS, etc.). However, it exceeds the recommended 15-tool threshold, making it feel slightly heavy.

    Completeness4/5

    Covers most aspects of UniFi management: clients, devices, networks, WiFi, firewall, VPN, DNS, DPI, traffic rules, vouchers. Minor gaps like firmware upgrade and backup/restore are missing but core workflows are complete.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server providing Claude Code with full UniFi network management capabilities -- devices, clients, ports, bandwidth auditing, firewall policies, and traffic rules -- all through natural language.
      50 npm
      1
      MIT
    • F
      license
      Not graded
      quality
      B
      maintenance
      An MCP server to manage your UniFi network via Claude, providing tools to list devices and clients and block/unblock clients. It runs as a Docker container and is designed for local network use only.
      -