UniFi MCP
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 MCPshow me all devices 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 MCP
An MCP server that lets Claude interact with your UniFi infrastructure. Covers four UniFi APIs with 146 tools:
Site Manager API (cloud) — hosts, sites, devices, ISP metrics, SD-WAN.
Mobility API (cloud) — UMR mobile routers: workspaces, admins, devices, clients, and device name/network/WiFi updates.
Network API — devices, clients, networks, WiFi, firewall, ACL rules, DNS, switching, traffic-matching lists, vouchers, and more.
Protect API — cameras (incl. PTZ, RTSPS, snapshots, talkback), lights, sensors, sirens, speakers, fobs, relays, bridges, link stations, alarm hubs, arm profiles, events, users.
The Network and Protect APIs can be reached either through the cloud connector (a single unifi.ui.com key proxied through api.ui.com — no LAN access needed) or by connecting directly to a local console. See Reaching a console.
Features
Site Manager API (cloud)
Read-only access to your UniFi account via https://api.ui.com:
Tool | Description |
| List all consoles/gateways |
| Get detailed host information |
| List all sites |
| List all network devices |
| Get ISP performance metrics (latency, bandwidth, uptime) |
| Query ISP metrics for specific sites |
| List or inspect SD-WAN configurations |
Mobility API (cloud)
UniFi Mobile Router (UMR) management via https://api.ui.com/v1/mobility (requires the mobility scope on your key):
Tool | Description |
| List mobility workspaces (cloud sites) |
| List a workspace's admins and permissions |
| List UMR devices in a workspace |
| Full device detail (WAN, cellular, WiFi, VPN, GPS) |
| List clients connected to a device |
| Rename a device (write scope, Admin) |
| Update LAN / DHCP settings (Admin) |
| Replace WiFi SSID + password (Admin) |
Network API
Full CRUD access to a UniFi console (UDM, UCG, etc.), via the cloud connector or a local connection:
Tool | Description |
Info | |
| Application info and site discovery |
Devices | |
| List all adopted devices |
| Get device details and statistics |
| Restart, locate, or adopt a device |
Clients | |
| List all connected clients |
| Get client details |
| Block or reconnect a client |
Networks | |
| List configured networks (VLANs) |
| Get network details |
| Create a network |
| Update a network |
| Delete a network |
WiFi | |
| List WiFi broadcasts (SSIDs) |
| Get WiFi broadcast details |
| Create a WiFi broadcast |
| Update a WiFi broadcast |
| Delete a WiFi broadcast |
Firewall | |
| List firewall zones |
| List firewall policies |
| Create a firewall policy |
| Update a firewall policy |
| Delete a firewall policy |
| Get a firewall policy |
| Firewall zone CRUD |
| Get/set firewall policy ordering |
ACL rules | |
| ACL rule CRUD |
| Get/set ACL rule ordering |
DNS | |
| DNS policy CRUD |
Traffic matching lists | |
| IP/port list CRUD |
Switching | |
| Link Aggregation Groups |
| MC-LAG domains |
| Switch stacks |
Adoption | |
| List devices pending adoption |
| Adopt a device |
| Remove (unadopt) a device |
| Port action (e.g. PoE power-cycle) |
Vouchers | |
| List hotspot vouchers |
| Create hotspot vouchers |
| Delete a hotspot voucher |
Supporting | |
| List WAN interfaces |
| List site-to-site VPN tunnels |
| List VPN servers |
| List RADIUS profiles |
| What references a network |
| List device tags |
| List ISO country codes |
| List DPI applications |
| List DPI categories |
Protect API
Access to UniFi Protect devices, via the cloud connector or a local connection:
Tool | Description |
Info | |
| Application info and NVR status |
Cameras | |
| List all cameras |
| Get camera details |
| Update camera settings |
| Get a JPEG snapshot from a camera |
| Move a PTZ camera to a preset |
| Start/stop a PTZ patrol |
| Get/create/delete RTSPS stream URLs |
| Create a talkback session |
| Permanently disable the mic |
Lights | |
| List all lights |
| Get light details |
| Update light settings |
Sensors | |
| List all sensors |
| Get sensor details |
| Update sensor settings |
Chimes | |
| List all chimes |
| Get chime details |
| Update chime settings |
Sirens | |
| Siren info & settings |
| Play / stop / test a siren |
Speakers | |
| Speaker info & settings |
| Test speaker sound |
Fobs | |
| Key fob info & settings |
Relays | |
| Relay info & settings |
| Control a relay output (on/off/pulse) |
Bridges & Link Stations | |
| Bridge info & settings |
| Link station info & settings |
Alarm Hubs | |
| Alarm hub info & settings |
| Trigger an alarm hub output |
Arm Profiles & Alarm Manager | |
| Arm profile CRUD |
| Enable/disable arm alarm, set profile |
| Trigger alarms via webhook |
Events | |
| List recent events (motion, detections) |
Liveviews | |
| Liveview info & CRUD |
Viewers | |
| Viewer info & settings |
Users | |
| Protect users |
| UniFi Identity users |
Related MCP server: unifi-mcp
Prerequisites
UniFi API key — generate at unifi.ui.com → API. Enable the Site Manager and UniFi Applications (Network, Protect) scopes; add mobility if you use UMR routers. The same key drives every API.
Reaching a console
Site Manager and Mobility are always available (they are cloud APIs). The Network and Protect tools need to reach a specific console, in one of two ways:
Cloud connector (recommended). Set
UNIFI_CONSOLE_IDto the console (host) ID. Requests are proxied throughapi.ui.comwith yourunifi.ui.comkey — nothing needs LAN access. Find the ID via thelist_hoststool (theidfield, e.g.900A6F…:123456789).Local console. Set
UNIFI_NETWORK_HOST/UNIFI_PROTECT_HOSTto the console IP/hostname to connect directly over the LAN (self-signed certs, verification off by default).
If neither is configured for an application, its tools are simply not registered.
Quick start
Docker Compose (recommended — remote HTTP endpoint)
Runs the server as a streamable-HTTP service reachable from other machines:
cp .env.example .env # set UNIFI_API_KEY and UNIFI_CONSOLE_ID
docker compose up -d --build
# MCP endpoint: http://<this-host>:8000/mcpPut a TLS-terminating reverse proxy in front before exposing it publicly.
Docker (one-off / stdio)
docker build -t unifi-mcp .
# Cloud connector: one key drives all four APIs
docker run --rm -i \
-e UNIFI_API_KEY=your-key \
-e UNIFI_CONSOLE_ID=900A6F...:123456789 \
unifi-mcpLocal (with uv)
uv sync
# stdio (default)
UNIFI_API_KEY=your-key UNIFI_CONSOLE_ID=... uv run unifi-mcp
# remote HTTP
UNIFI_API_KEY=your-key uv run unifi-mcp --transport streamable-http --host 0.0.0.0 --port 8000Configuration
Variable | Required | Default | Description |
| Yes | — | UniFi cloud API key (shared across all APIs) |
| No |
| Site Manager API base URL |
| No |
| HTTP timeout in seconds |
| No | — | Console (host) ID for Network + Protect via the cloud connector |
| No |
| Console ID override for Network only |
| No |
| Console ID override for Protect only |
| No | — | Local console IP/hostname for Network (instead of console ID) |
| No | — | Local console IP/hostname for Protect (instead of console ID) |
| No |
| Verify SSL for a local Network console |
| No |
| Verify SSL for a local Protect console |
| No |
| Mobility API key (if different) |
| No |
| Network API key (if different) |
| No |
| Protect API key (if different) |
| No |
| Host port the HTTP endpoint is published on (compose) |
When both a local host and a console ID are set for an application, local mode wins. By default UNIFI_API_KEY is used everywhere; set a per-API key only if a console needs a different one.
Multi-user web GUI (self-service SaaS mode)
The default docker compose up runs a hosted, multi-user service — no configuration required. Users self-register with a passkey and manage their own MCP connections through a web page; each connection maps one UniFi API key to the shared, OAuth-protected /mcp endpoint for Claude.
docker compose up -d --build
# open http://<host>:8000/ → register a passkey → add a connectionBehind HTTPS in production (passkeys require it), point a reverse proxy at the container and optionally set UNIFI_PUBLIC_URL.
Endpoints served on one port:
Path | Purpose |
| Passwordless accounts (WebAuthn passkeys only) |
| Your connections + a form to add one |
| Create a connection → MCP URL + OAuth |
| Revoke one of your connections |
| Shared, OAuth-protected MCP endpoint |
| OAuth 2.1 authorization server |
Accounts: passwordless, WebAuthn passkeys only — no default account. Anyone can self-register (optionally gate with UNIFI_ONBOARD_CODE). Each user owns as many connections as they want and can revoke any of them at any time (revoking also invalidates that connection's OAuth tokens).
Per-connection auth: each connection is a confidential OAuth client. Claude runs the authorization-code + PKCE flow with the issued id/secret and receives an access token bound to that connection; tool calls resolve its UniFi credentials from the token.
Consoles: onboarding loads the account's consoles (via list_hosts) so you can pick a default. A single connection can reach every console the account owns — each network_* / protect_* tool takes an optional console_id (discover IDs with list_hosts); omit it to use the default.
Zero-config by default:
The Fernet encryption key is auto-generated and persisted to the data volume (
secret.key) on first run — setUNIFI_SECRET_KEYonly to supply your own.The public base URL (OAuth issuer, passkey origin, MCP URL shown to users) is auto-detected from each request (honoring
X-Forwarded-Proto/Host). SetUNIFI_PUBLIC_URLto pin it.
Data at rest (JSON on the unifi-data volume):
UniFi API keys and OAuth client secrets are encrypted (Fernet).
OAuth access/refresh tokens and authorization codes are stored hashed (SHA-256) — raw bearer secrets are never written to disk.
Passkey public keys, ownership, and console IDs are non-secret metadata.
Security notes:
Passkeys require HTTPS (except
localhost) — terminate TLS in front.Keep the
unifi-datavolume (andsecret.key/UNIFI_SECRET_KEY) backed up, or stored data becomes unreadable.Redirect URIs are restricted to Claude's web callbacks by default; override with
UNIFI_OAUTH_REDIRECT_URIS.
All variables are optional: UNIFI_PUBLIC_URL, UNIFI_SECRET_KEY, UNIFI_TENANT_STORE, UNIFI_RP_NAME, UNIFI_ONBOARD_CODE, UNIFI_OAUTH_REDIRECT_URIS (see .env.example).
Claude integration
Remote connector (no local config file)
Run the HTTP endpoint (docker compose up -d), expose it (ideally behind HTTPS), then in Claude add a custom connector: paste the MCP server URL https://<your-host>/mcp. For the single-tenant server no OAuth is needed; for the multi-tenant service paste the client_id/client_secret from onboarding into the connector's OAuth fields.
Claude Desktop (via mcp-remote)
To bridge the remote endpoint into Claude Desktop's config instead:
{
"mcpServers": {
"unifi": {
"command": "npx",
"args": ["mcp-remote", "http://localhost:8000/mcp"]
}
}
}Claude Desktop / Claude Code (stdio)
Run the container or uv directly over stdio:
{
"mcpServers": {
"unifi": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "UNIFI_API_KEY=your-key",
"-e", "UNIFI_CONSOLE_ID=900A6F...:123456789",
"unifi-mcp"
]
}
}
}Project structure
src/unifi_mcp/
server.py # MCP server and tool definitions (143 tools)
client.py # Site Manager API client (cloud)
formatting.py # Site Manager response formatters
mobility_client.py # Mobility API client (cloud)
mobility_formatting.py # Mobility response formatters
network_client.py # Network API client (cloud connector or local)
network_formatting.py # Network response formatters
protect_client.py # Protect API client (cloud connector or local)
protect_formatting.py # Protect response formatters
tenant.py # Multi-tenant: encrypted store, client bundles, registry
oauth.py # Multi-tenant: OAuth 2.1 authorization-server provider
web.py # Multi-tenant: onboarding UI + combined ASGI appLicense
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables managing UniFi networks through natural language, allowing users to monitor clients, check network health, and perform device actions like blocking or restarting access points. It securely connects UniFi Controllers to MCP clients with features like Google OAuth authentication.52Apache 2.0
- AlicenseAqualityCmaintenanceMCP server that turns Claude into a UniFi network specialist. Manage devices, optimize WiFi, audit security, and troubleshoot your network through natural language.31362MIT
- AlicenseNot gradedqualityBmaintenanceA Model Context Protocol (MCP) server for UniFi Network Controllers that enables LLMs to interact with UniFi infrastructure for monitoring and control.MIT
- AlicenseAqualityDmaintenanceControl your UniFi network via AI with a lightweight 2-tool MCP server that supports both cloud and local UniFi controllers.320MIT
Related MCP Connectors
An MCP server that integrates with Discord to provide AI-powered features.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/frousselet/unifi-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server