Safe-by-default UniFi MCP: Network + Protect + Access, multi-site, dry-run, audit log.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Safety-first MCP server for self-hosted UniFi. Dry-run previews, JSONL audit log, composite rollback. Network + Protect + Access.
An MCP server built around the assumption that LLM-driven infrastructure calls need guardrails. Every destructive tool accepts dry_run=True and returns the predicted change set without writing. Composite tools (create_iot_network, create_guest_network, provision_homelab_service, provision_camera) capture pre-state and roll back applied steps on partial failure. Every call β dry-run or real β lands in a JSONL audit log with secrets scrubbed; the included mcp-unifi-replay CLI can re-issue a log against a fresh controller.
Beyond the safety substrate: Network tools for devices, AP radio tuning, 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). Every tool accepts a controller parameter so one server instance manages multiple UniFi sites. Speaks both stdio (Claude Desktop, uvx, .dxt) and Streamable HTTP (Docker, Helm). The full, always-current tool list is in the auto-generated 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), authenticated with a local API key from Settings β Control Plane β Integrations. Verified against UCG-Fiber fw 5.1.12.33296. No Site Manager or cloud account required.
Four supported paths. Pick the one that matches how you run Claude.
Long-running container, Streamable HTTP on port 3714. Best for homelab and multi-client setups.
HTTP transport refuses to start without a bearer token, so supply one:
Clients then send Authorization: Bearer $MCP_UNIFI_TOKEN. For throwaway local
testing on loopback only, -e MCP_UNIFI_AUTH_REQUIRED=false skips auth entirely;
never use it on an interface reachable by anything else, because every connected
client gets admin-equivalent access to the controller.
Download mcp-unifi-<version>.dxt from the latest release and double-click. Configuration is through a built-in UI in Claude Desktop. The bundle ships the Python runtime; no separate install needed. Uses stdio transport.
The chart ships auth.required: true with auth.tokens: "", so the pod will not
start until you set a token (or --set auth.required=false, which is only
appropriate for a trusted single-tenant cluster).
Quick one-off runs straight from the GitHub repo. Stdio transport.
Pin a release with @v0.5.0-rc.2 (or any tag) appended to the URL.
Full guides for each install path live in the docs site.
MCP_UNIFI_READONLY=true makes the server structurally unable to change anything: mutating tools are hidden from tools/list and refused on tools/call, so naming a hidden tool gets a normal error envelope instead of a write. Classification is declared per tool at registration (@audited("list_networks", mutates=False)), never inferred from tool names β twelve mutating tools, confirm_destructive_action among them, carry no create_/update_/delete_/set_ prefix. Registration fails if a tool has not declared a classification, so a new tool cannot default into being callable. Defense in depth on top of a read-only UniFi API key, not a replacement for it.dry_run=True and returns the predicted change set without writing. Composite tools (create_iot_network, create_guest_network, provision_homelab_service, provision_camera) capture pre-state and roll back applied steps on partial failure. Every tool call lands in a JSONL audit log with secrets scrubbed; the included mcp-unifi-replay CLI can re-issue a log against a fresh controller.controller parameter and a YAML controllers file (MCP_UNIFI_CONTROLLERS_FILE). No need to run a separate process per controller./proxy/network/api endpoint. No username/password storage, no cloud account, no Site Manager dependency.MCP_UNIFI_MODULES_ENABLED=network,protect,access. Access ships read-only (door unlocks and credential issuance require session-token auth and are deferred). UniFi Drive is not in scope.Fastest cold-start: Docker + Claude Code in stub mode, no hardware required.
Start the container. Auth is on by default, so mint a token first:
Register it with Claude Code, passing the token:
Verify the connection:
In a Claude Code session, ask: "list my UniFi devices". You'll get two stubbed devices back.
When you're ready to point at a real gateway, drop stub mode:
Generate the API key under Settings β Control Plane β Integrations β Create API Key on the gateway.
All config is read from environment variables (and .env when present). The six most common:
| Variable | Default | Notes |
|---|---|---|
STUB_MODE | true | When false, real-mode controller config is required. |
UNIFI_HOST | (empty) | Gateway IP or hostname. Required in real mode. |
UNIFI_API_KEY | (empty) | Local API key. Required in real mode. |
MCP_UNIFI_READONLY | false | When true, mutating tools are hidden and refused. See the Security guide. |
MCP_UNIFI_MODULES_ENABLED | network | Set to network,protect,access to enable all three modules. |
MCP_UNIFI_CONTROLLERS_FILE | (unset) | YAML file with named controllers for multi-site. |
MCP_UNIFI_OTEL_ENABLED | false | Optional OpenTelemetry tracing, one span per tool call. Off by default and the SDK is not a dependency. See Operations. |
Full env var reference and the multi-site YAML schema are in the Configuration docs.
The engineering scaffolding around the tool surface (see the Tool Manifest for the current count), in case you want to know what's holding it up:
Test discipline. ~880 tests across unit, integration, and property-based (Hypothesis) β see pytest --collect-only for the current count. HTTP is mocked with respx so tests don't hit a real controller. Coverage gated at 80% branch coverage in CI; current floor is 90%.
Code quality gates. Ruff (pycodestyle, pyflakes, isort, flake8-bugbear, pyupgrade, simplify, flake8-bandit security ruleset, comprehensions) plus mypy strict (no implicit Any, unreachable code flagged, unused ignores flagged). Pre-commit hooks run lint, format, types, and regenerate the tool manifest with a drift check, so bad code never reaches CI.
CI pipeline (5 gated jobs). Every PR runs lockfile-drift check β lint + type check β tests + coverage β multi-arch Docker build β Trivy filesystem and image scan (HIGH/CRITICAL fails the build). Each gates the next.
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/unifi-gateway)<a href="https://allmcps.com/mcp/unifi-gateway"><img src="https://allmcps.com/api/badge/unifi-gateway?style=directory" alt="UniFi Gateway on AllMCPs" /></a>