unifi-mcp
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-mcplist all live clients on the main site"
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
Read-only remote MCP server exposing the Example Corp / examplecorp UniFi
fleet as a Claude custom connector, via the official UniFi Site Manager
API (api.ui.com).
Sibling of odoo-ticket-mcp and the TRMM MCP servers — same architecture:
Claude (claude.ai / Claude Code)
│ OAuth 2.0 bearer token (Microsoft Entra ID)
▼
nginx — TLS, Anthropic egress-IP allowlist (160.79.104.0/21), 403 otherwise
│ http://127.0.0.1:8097
▼
unifi-mcp container (Portainer stack, FastMCP 3.x, Streamable HTTP at /mcp)
│ X-API-KEY (Site Manager API key, read-only usage)
▼
api.ui.com — Site Manager API + connector proxy into each console's Network APIClient → server auth: Microsoft Entra ID, resource-server mode. The server validates audience-bound bearer tokens; it never issues them. Access is controlled by Entra group membership on the app registration.
Server → UniFi auth: one fixed Site Manager API key (created at unifi.ui.com → API Keys with Site Manager + Network application scopes, All Sites). Caller identity is deliberately NOT forwarded to UniFi in v1.
Network path: public DNS → nginx (TLS + Anthropic IP allowlist) → container. Defense in depth: the allowlist is in addition to OAuth.
Tools (all read-only)
Site Manager (fleet-wide):
Tool | What it returns |
| Every console (UDM Pro / UNVR / Cloud Key): id, name, model, IP, state, version |
| One console's detail (optional full raw record) |
| All Network sites across consoles, with device/client counts |
| Adopted devices fleet-wide (APs, switches, gateways), optional per-console filter |
| WAN/ISP health (latency, loss, downtime, throughput) for all sites, 5m or 1h granularity |
| Same, but for specific (host, site) pairs and windows |
| SD-WAN topologies + deployment state |
Connector proxy (per-console drill-down, no VPN needed):
Tool | What it returns |
| Console-local site list (local ids differ from Site Manager ids) |
| A site's devices from the console's own Network API |
| Full device detail + latest live stats (CPU, memory, uplink, radios) |
| Live connected clients: name, MAC, IP, connection type, uplink |
Typical flow: unifi_list_hosts → pick console → unifi_network_sites →
unifi_network_clients / unifi_network_device.
Related MCP server: UniFi MCP Server
Local development
python -m venv .venv
.venv\Scripts\pip install -r requirements.txt
copy .env.example .env # fill in UNIFI_API_KEY; set MCP_AUTH_ENABLED=false
.venv\Scripts\python -m unifi_mcp
# → http://127.0.0.1:8000/mcp (test with MCP Inspector)MCP_AUTH_ENABLED=false opens the endpoint — local testing only, never in
production.
Entra ID app registration (one-time)
Follow TrmmMCPServer/ENTRA_SSO_PLAYBOOK.md for the annotated version. Summary
— do these in order:
App registrations → New registration — name
UniFi MCP, single tenant, no redirect URI yet. Copy the client id + tenant id.Expose an API → Application ID URI — set to exactly
https://unifi-mcp.example.com/mcp(prevents AADSTS9010010).Expose an API → Add a scope —
access_as_user, admins and users can consent, enabled.Certificates & secrets → New client secret —
claude-connector, 24 months. Copy the value immediately.Authentication → Add platform → Web — redirect URIs
https://claude.ai/api/mcp/auth_callbackandhttps://claude.com/api/mcp/auth_callback.Manifest — set
requestedAccessTokenVersionto2(prevents issuer-mismatch 401s).Enterprise applications → UniFi MCP → Properties — Assignment required = Yes.
Enterprise applications → Users and groups — add the
Unifi-MCP-Usersgroup. Group membership = who can use the connector.
Deploy
See PORTAINER_DEPLOY.md (Portainer Git stack + webhook redeploy) and deploy/nginx-unifi-mcp.conf (TLS + Anthropic IP allowlist).
Register the connector in claude.ai
Settings → Connectors → Add custom connector:
Field | Value |
URL |
|
Client ID | the Entra app's client id |
Client Secret | the Entra client secret |
Authorization URL |
|
Token URL |
|
Scopes |
|
Acceptance tests
# 1. Discovery doc advertises the full resource scope (not api://…)
curl -s https://unifi-mcp.example.com/.well-known/oauth-protected-resource/mcp | jq .scopes_supported
# 2. Unauthenticated /mcp is challenged
curl -i https://unifi-mcp.example.com/mcp # 401 + WWW-Authenticate: Bearer
# 3. Non-Anthropic source IP is blocked at nginx
curl -i https://unifi-mcp.example.com/mcp # from anywhere else: 403
# 4. Health (host-local, bypasses nginx)
curl http://<docker-host>:8097/healthz # {"status":"ok","service":"unifi_mcp"}
# 5. In claude.ai: connect as a Unifi-MCP-Users member → tools appear;
# non-member → AADSTS50105 at sign-in.This server cannot be deployed
Maintenance
Related MCP Connectors
Manage hosts, redirects, SSL, and traffic analytics from Claude and other AI assistants.
Manage your IoT device fleet directly from Claude. Create device templates with datastreams and events, provision new devices, read live sensor data, and control outputs. The Blynk connector integrates with the Blynk IoT platform, enabling direct configuration and monitoring of connected devices and infrastructure.
Provides capabilities that let LLM agents perform a range of infrastructure management tasks.
Unified API to query AWS, GCP, Azure and generate Terraform/CLI execution kits for AI agents.
Related MCP Servers
- AlicenseDqualityDmaintenanceEnables 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.3917Apache 2.0
- 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
- AlicenseBqualityDmaintenanceEnables AI assistants to manage UniFi network infrastructure through 50+ tools covering devices, clients, networks, WiFi, firewall rules, and guest access using the official UniFi Network API.52505MIT
- FlicenseNot gradedqualityBmaintenanceRead-only MCP server that surfaces UniFi network data from a UCG-Fiber console to Claude, enabling monitoring of hosts, sites, devices, clients, ISP metrics, and device stats via read-only API tools.-