mcp-unifi is a Model Context Protocol server for self-hosted UniFi gateways, built around the assumption that LLM-driven infrastructure calls need guardrails. Every destructive tool ships with a dry_run preview that returns the predicted change set without writing. Every call — preview or real — lands in a JSONL audit log with secrets scrubbed. Composite tools (e.g. “create an IoT VLAN with isolation rule”) capture pre-state and roll back applied steps if any sub-step fails.
Beyond the safety substrate: Network tools for devices, VLANs, WLANs, firewall, switch ports, port forwards, DHCP reservations, AP groups, observability, Threat Management / IDS-IPS, Honeypot, and Teleport VPN, plus opt-in Protect (cameras, motion events, smart detections, recording config) and Access (doors, credentials, visitors, badge events, hubs / readers) modules. One container runs all three, and one process manages multiple UniFi sites in parallel via a controller parameter. The full, always-current tool list is in the Tool Manifest. Works on any UniFi OS gateway running UniFi Network 9.x or newer (UDM, UDM Pro, UDM SE, UCG-Fiber, UCG-Ultra, UDR, UDW, UniFi OS Server) using a local API key. No Site Manager or cloud account required.
The HTTP transport refuses to start without a bearer token. All Docker / Helm examples below mint one and pass it through. For a full walkthrough, follow the linked install guide.
Docker
Long-running container for homelab and multi-client setups.
dry_run=True on every destructive op returns the predicted change set without writing. Composites capture pre-state and roll back applied steps on partial failure. Every tool call lands in a JSONL audit log with secrets scrubbed.
Single image, multi-controller
One container runs Network, Protect, and Access together; one process manages multiple UniFi sites in parallel via the controller parameter and a YAML controllers file.
API-key-first auth
Uses the local API key from Settings → Control Plane → Integrations. No username/password storage, no cloud account, no Site Manager dependency.
Network + Protect + Access
Network on by default; opt in to Protect and Access via MCP_UNIFI_MODULES_ENABLED=network,protect,access. See the Tool Manifest for the current tool count per module.
The dispatcher gates which modules are loaded at startup via MCP_UNIFI_MODULES_ENABLED; everything else (composite tools, audit log, rollback) is module-agnostic plumbing. The current per-module tool count is in the auto-generated Tool Manifest.