UniFi MCP

io.github.ServosityPublished by GitHub account Servosityv0.1.9Updated Nov 6, 2026

Every UniFi Network API operation, plus drift detection, topology, and rule prediction no other

Overview

AI-generated overview

Local MCP server that gives an assistant the full UniFi Network API surface plus config drift, first-seen devices, topology and firewall rule prediction.

What you can do
  • Query sites, devices, clients, WiFi, firewall policies, DNS, ACL rules and hotspot vouchers through the UniFi Network API
  • Detect configuration drift against a locally kept snapshot and list devices and clients first seen since a given period
  • Inspect per-port link and PoE status, and group clients under the device they attach to
  • Predict which firewall policy would match traffic between two host IPs
  • Run routine writes such as creating networks, firewall or DNS policies, and updating WiFi broadcasts
  • Adopt devices, run device or port actions, and delete networks, policies or broadcasts
When to use it
Useful for network operators and MSPs managing a self-hosted UniFi OS gateway who want an assistant to answer historical questions the console cannot, such as what changed on a site or which hardware is new. Also handy for checking switch port and PoE headroom or previewing firewall matches before a change.
Requirements
Runs as a local process (stdio) on desktop; a .mcpb bundle is provided, and tools shell out to a companion unifi-network-cli binary. Needs a self-hosted UniFi OS gateway reachable over the network, an API key minted in the gateway UI, and the UNIFI_API_KEY and UNIFI_GATEWAY_HOST credentials; optional UNIFI_BASE_URL, UNIFI_BASE_PATH and PRINTING_PRESS_CLIENT_PROFILE. Node.js is needed for the npx-based multi-agent install path.
Before you install
The API key's permissions bound every command: the same credential that runs read-only checks can also factory-reset a device or delete networks, and the CLI applies no privilege separation, so gating must live in the agent's policy. Response bodies are not redacted, so WiFi passphrase and guest voucher commands return live secrets. Writes and destructive actions exist and should be previewed with dry-run and confirmed by a human. The README warns against HTTP transport mode, which has no…

Installation

In SourceWeft

  1. Open UniFi MCP in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

UniFi + AI - for Claude, the ChatGPT desktop app, GitHub Copilot, Gemini CLI, and any agent that speaks MCP

Unofficial. Community-built Claude Code Skill and MCP server for the UniFi API. Not affiliated with, endorsed by, or sponsored by Ubiquiti Inc.

[UniFi Network - MCP server and Claude Code Skill]

Full skill page - install, outcomes, safety model.

Every UniFi Network API operation, plus drift detection, topology, and rule prediction no other UniFi tool has. Works with the AI you already use - ChatGPT (desktop app), Claude Desktop, Codex, Claude Code, Claude Cowork, and GitHub Copilot - plus Gemini CLI. Free, open source, runs on your laptop. Built for MSP owners. No code required.

Works with your agent

Security note (until this connector is reprinted). Do not run HTTP mode (--transport http), not even on localhost. This build has no password, listens on every network interface, and predates the browser-rebinding guard, so a web page you open can reach it. The MCP tools can also make changes with your credentials. Use the default stdio transport. If you set up a tunnel for a remote agent, shut it down. A fix is on the way.

The six agents MSP owners actually use (self-serve, works today):

Your AI agentHow to install the UniFi skill
Claude DesktopRun installer, then Settings > Extensions to register unifi-network-mcp (no JSON editing).
ChatGPT (desktop app)Run installer, then add unifi-network-mcp in Settings > MCP servers as a local (STDIO) server. ChatGPT on the web is not supported yet.
Codex CLIPaste the install prompt below.
Claude CodePaste the install prompt below.
Claude CoworkPaste the install prompt below.
GitHub Copilot (VS Code)Run installer, add unifi-network-mcp to mcp.json under the servers key, then pick Agent mode.

The ChatGPT desktop app runs unifi-network-mcp locally and shares MCP configuration with Codex (OpenAI). ChatGPT on the web needs a remote (HTTP) server, and this connector's HTTP mode is paused until it is reprinted (see the security note in mcp-install.md), so msp-skills does not support it yet. If your team works there, a hosted gateway is the better pick; check that your AI app is on the gateway's setup list.

Also for the Microsoft and Google stacks

Big install base, but an honest heads-up: Gemini CLI runs the local binary you just installed, while Microsoft 365 Copilot and the Gemini app need a remote server, which msp-skills does not support yet.

AgentWhat it takes
Microsoft 365 Copilot / Copilot StudioNot supported by msp-skills yet: it needs a remote server. A hosted gateway is the better pick; check that your AI app is on the gateway's setup list.
Google GeminiGemini CLI is local - same as Claude Code. See mcp-install.md. The Gemini app needs a remote server and is not supported by msp-skills yet.

Skill-native agents (also covered): Hermes and OpenClaw read this skill's SKILL.md directly and speak MCP - see their install sections below. Also works with Cursor, Windsurf, Cline, Continue.dev, and Zed via MCP. Full per-tool wire-up: docs/which-agent.md.

Run more than one agent? Install across all 51+ supported agents in one command: npx skills add Servosity/msp-skills@latest (requires Node.js, then run the per-skill installer for the CLI/MCP binaries). See docs/which-agent.md.

Install in 60 seconds

Fastest for Claude Desktop - one-click .mcpb

Claude Desktop bundle: the .mcpb launches on macOS (Intel and Apple Silicon), Windows x64 and Linux x64. Every tool shells out to the companion unifi-network-cli. Releases cut from 2026-09-18 on ship that CLI inside the bundle; older bundles contain only the MCP server, so if yours lacks the companion, run the Path A or Path B installer below first (or set UNIFI_CLI_PATH to an existing binary). Details: #331.

Download UniFi MCP (.mcpb) - then open Claude Desktop > Settings > Extensions and select the file. One click, no JSON, no shell. (Browse every UniFi release on the releases page.)

Prefer the Claude Code plugin? Add the marketplace once, then install - works immediately, no directory listing required:

/plugin marketplace add Servosity/msp-skills/plugin install unifi-network@msp-skills

Path A - paste one prompt into your AI agent (recommended)

Copy this into Claude Code, Codex CLI, or Claude Cowork:

Install the UniFi Skill and MCP server from Servosity/msp-skills in this agent workspace. If this workspace uses a POSIX shell (macOS, Linux, WSL, or Bash), run bash <(curl -fsSL https://raw.githubusercontent.com/Servosity/msp-skills/main/skills/unifi-network/install.sh). If it uses Windows PowerShell, run iwr -useb https://raw.githubusercontent.com/Servosity/msp-skills/main/skills/unifi-network/install.ps1 | iex. Then authenticate per the README and run unifi-network-cli --help to explore.

The same prompt works in any agent that can run shell.

Path B - run the installer yourself

Windows (PowerShell):

powershell
iwr -useb https://raw.githubusercontent.com/Servosity/msp-skills/main/skills/unifi-network/install.ps1 | iex

macOS / Linux:

bash
bash <(curl -fsSL https://raw.githubusercontent.com/Servosity/msp-skills/main/skills/unifi-network/install.sh)

The installer drops both unifi-network-cli (the CLI) and unifi-network-mcp (the MCP server) into your user bin path. Claude Code, Codex, and Cowork discover the Skill via SKILL.md in this directory.

Verify:

bash
unifi-network-cli --version

Upgrade to the latest version

The installer always fetches the current release - re-run it to upgrade:

macOS / Linux:

bash
bash <(curl -fsSL https://raw.githubusercontent.com/Servosity/msp-skills/main/skills/unifi-network/install.sh)

Windows (PowerShell):

powershell
iwr -useb https://raw.githubusercontent.com/Servosity/msp-skills/main/skills/unifi-network/install.ps1 | iex

Claude Desktop .mcpb users: download the latest .mcpb (top of this section) and re-select it in Settings > Extensions. Claude Code plugin users: /plugin update unifi-network@msp-skills.

Add to Claude Desktop, the ChatGPT desktop app, GitHub Copilot, Gemini CLI, or another MCP client

After the installer runs, see mcp-install.md and docs/which-agent.md for the per-agent wire-up - one section per agent, including the GitHub Copilot servers key and the ChatGPT desktop app. Claude Desktop's Settings > Extensions panel is the simplest path; the MCP config block (for users who prefer editing JSON) is documented in mcp-install.md.

Install for Hermes

From the Hermes CLI:

bash
hermes skills install servosity/msp-skills/skills/unifi-network --force

Inside a Hermes chat session:

/skills install servosity/msp-skills/skills/unifi-network --force

Hermes speaks MCP natively, so it can also use the unifi-network-mcp server directly - same install path, same env vars.

Install for OpenClaw

Tell your OpenClaw agent (copy this):

Install the unifi-network skill from https://github.com/servosity/msp-skills/tree/main/skills/unifi-network. The skill defines how its required CLI (unifi-network-cli) can be installed via the openclaw: frontmatter block.

OpenClaw isn't generally available yet; the frontmatter wiring is pre-shipped and will activate the moment OpenClaw launches.

Authenticate

Set the credentials the CLI needs (from your UniFi portal):

bash
UNIFI_API_KEY=<value> UNIFI_GATEWAY_HOST=<value> unifi-network-cli doctor

doctor checks config, paths, and gateway reachability, then verifies the key itself with one authenticated read: it reports valid, rejected (HTTP 401), scope-limited (HTTP 403), or not verified when the probe never reached an endpoint that could check it. It exits 0 even when the credential is rejected, so scripts should add --fail-on error.

What this skill does

Question your MSP keeps askingCommand
What changed in this site's config since my last check?unifi-network-cli drift --site default --json
What devices and clients joined the network this week?unifi-network-cli newcomer --since 7d --json
Do I have switch port and PoE headroom before adding hardware?unifi-network-cli port-audit --site default
Which firewall policy would match traffic from this host?unifi-network-cli rule-predict --src 10.0.3.50 --dst 10.0.0.1
Which clients are sitting behind which device?unifi-network-cli topology --site default
What firewall policies are configured on this site?unifi-network-cli sites firewall get-policies <siteId> --all
Who is on the guest network, and which vouchers are live?unifi-network-cli guest report --site default
List every adopted device on the siteunifi-network-cli sites devices get-adopted-overview-page <siteId> --all

Run unifi-network-cli sync first - drift, newcomer, topology, guest report, and rule-predict all compute from the local mirror, and port-audit needs the synced device list before it can fetch port detail. On paginated reads pass --all: they default to --limit 25 (vouchers 100) and emit no truncation warning. This affects countries, pending-devices, and dpi ... too, not just the sites ... subtree.

The full surface is 137 commands; almost all of it lives under sites .... Enumerate it with unifi-network-cli sites --help for the 14 resource groups, then unifi-network-cli sites <group> --help for each group's commands. guide.md covers install, auth, and the headline commands. For the AI-agent operating contract (--agent, --dry-run, when to confirm before mutating), see AGENTS.md.

What makes this different

Most UniFi integrations and MCP servers proxy each question into a live API call. That's fine for one record. It has nothing to say the moment you ask anything historical - "what changed on this site since Friday?", "is that access point new?" - because the UniFi Network integration API exposes no config-versioning and no audit-trail endpoint. There is no history to proxy to.

This skill syncs UniFi into a local SQLite mirror with full-text search, and keeps its own snapshots on top of it. That is what makes the historical questions answerable at all: drift diffs the site's networks, firewall, WiFi, and DNS config against the state it captured on its last run, and newcomer holds a first-seen record per device and client so new hardware surfaces against a real baseline. topology and guest report bring together data the API only returns separately - topology nests each synced client under the device it's attached to, and guest report puts the site's active hotspot vouchers and its currently connected guest clients in one output instead of three console screens. Work a stateless API wrapper can't do, because the state was never kept anywhere else.

The pain this closes

UniFi gear is everywhere in small-business networks, and the thing operators keep asking it for is the one thing it won't give them: history. The Network integration API exposes no config-versioning and no audit-trail endpoint, so "what changed on this site, and when?" has nothing to query. The Ubiquiti Community has carried standing feature requests on exactly this for years - threads titled UniFi Change Logs or Change Control options?, UniFi audit/change logs supported?, and Audit log of recent changes.

The same missing-baseline problem shows up twice more. For clients there's no first-seen record at all (the API exposes only a current-session connectedAt), so nothing distinguishes a laptop that appeared this morning from one that's been there a year; for devices an adoptedAt exists, but only on the per-device detail fetch, never in the list you actually scan. And per-port interface data never appears in any list response - only in a per-device detail fetch - so "which ports are free, and which are already energizing PoE?" means opening every switch on the site one at a time.

  • unifi-network-cli drift --site default --json - diffs the site's config against the snapshot this command captured last run, then advances it. It keeps its own history precisely because the API has none.
  • unifi-network-cli newcomer --since 7d --json - first-seen record per device and client, so new hardware surfaces against a baseline instead of a flat list.
  • unifi-network-cli port-audit --site default --json - per-port link state and PoE status for every switching or gateway device. Without --json the terminal path prints a one-line N up / M down, PoE active on K port(s) summary per device.
  • unifi-network-cli rule-predict --src 10.0.3.50 --dst 10.0.0.1 - walks the synced policies in the gateway's own first-match-wins order and reports which one would match, flagging what it can't resolve as uncertain rather than guessing. Pass host IPs: a CIDR's mask is ignored and only the address you typed is tested, so it tells you nothing about the rest of the range.
  • unifi-network-cli topology --site default - groups every synced client under the device it's attached to. Device-to-device uplink chaining isn't in the list endpoints, so every device sits at the top level - a switch behind a switch isn't nested.

See pain-point.md for the longer narrative.

Frequently asked questions

Does this work with ChatGPT?

Yes, in the ChatGPT desktop app. It runs MCP servers locally (STDIO), the way unifi-network-mcp runs, and shares MCP configuration with Codex (OpenAI): add unifi-network-mcp under Settings > MCP servers as a STDIO server, or add it once to Codex's ~/.codex/config.toml. ChatGPT on the web is not supported by msp-skills yet: it needs a remote (HTTP) server, and this connector's HTTP mode is paused until it is reprinted; the security note in mcp-install.md explains why. If your team works there, a hosted gateway is the better pick; check that your AI app is on the gateway's setup list.

Does this work with Codex, Cursor, Windsurf, Cline, Copilot, or Gemini?

Yes - all of them speak MCP. Cross-tool install commands are in the matrix above and the deep-dive in docs/which-agent.md.

Do I need to know how to code?

No. The recommended install is to paste one sentence into Claude Code or Codex - your agent reads SKILL.md and does the install. The fallback is a one-line installer per OS (bash or PowerShell). Neither path requires writing code. You'll enter your UniFi credentials once.

Is my UniFi data safe?

Your data stays on your machine. The CLI and MCP server are local binaries. The SQLite mirror sits in a directory under your user account. The AI agent only sees what the CLI returns - typically a query result, not raw bulk data. Credentials are read from your environment or your agent's config; never bundled into this repo or transmitted anywhere by MSP Skills.

Does this use the UniFi Site Manager cloud API?

No. This skill talks to the local Network integration API on a self-hosted UniFi OS gateway, reached at https://<gateway>/proxy/network with an API key you mint in the gateway's own UI. It's a single-gateway tool: one CLI instance sees one controller, not a multi-tenant view across every deployment. UniFi Protect (cameras) and UniFi Access (doors) are separate APIs and are not covered.

Why do drift and newcomer report nothing on the first run?

Both maintain their own baseline, because the API offers no history to read. The first run for a site captures current state as the baseline and reports no changes - that's expected, not an error. From the second run on they report what moved since the previous run. Run unifi-network-cli sync before each check so the mirror is current.

Can I trust rule-predict before making a firewall change?

Treat it as a local simulation, not a live trace. It walks the last synced firewall policies in the same ascending-index, first-match-wins order the gateway uses, and matches on source and destination IP only - --port is echoed for reference and is not used for matching. Zone-wide policies and traffic-matching-list references it can't resolve are flagged uncertain rather than silently assumed. Sync first, and confirm the real change in the console.

Will this replace the UniFi console?

No, and it isn't meant to. The console stays the system of record and the place you make changes. This adds the surface the console doesn't have: config drift, first-seen hardware, port and PoE headroom, and firewall-match prediction as single commands that return JSON an agent can act on.

What does it cost?

Free. Apache-2.0 licensed. You pay only for whichever AI agent you use (Claude, ChatGPT, Codex, etc.), and that's billed by your AI provider, not by us.

Safety model

TierExamplesRecommended agent policy
Readdrift, newcomer, topology, port-audit, rule-predict, and non-mutating sites ... endpoints except the secret-bearing commands below. Note drift and newcomer advance their own local baseline on every run.Allow
Credential (incl. secret-returning reads)auth set-token, auth logout, and every command whose output can carry a live secret - the CLI redacts nothing: sites wifi get-broadcast-details (that SSID's cleartext passphrase), sites hotspot get-voucher / get-vouchers, guest report, search and analytics --type hotspot --group-by code (usable guest voucher codes)Human-in-the-loop only - never in a blanket "allow all reads" policy. Three writes return secrets too (sites hotspot create-vouchers, sites wifi create-broadcast / update-broadcast) - same handling for their output.
Write (routine) - 18 commandssites firewall create-policy, sites acl-rules update, sites networks create, sites wifi update-broadcast, sites dns create-policy, sites hotspot create-vouchersPreview with --dry-run, then a reviewed write
Device / port control - 4 commandssites devices adopt, sites devices execute-adopted-action, sites devices execute-port-action, sites clients execute-connected-actionHuman-in-the-loop only - a port action can power-cycle PoE and drop whatever is plugged into it
Destructive - 10 commandssites devices remove (factory-resets the device if it's online), sites firewall delete-zone, sites networks delete, sites acl-rules delete, sites wifi delete-broadcastHuman-in-the-loop only, explicit confirmation

Two caveats worth knowing up front. This CLI applies no privilege separation of its own, so whatever your API key is permitted to do, any command can do - the same credential that runs drift may also run sites devices remove, and the gate has to live in your agent's policy. And "allow all reads" is not a safe policy here: the CLI does not redact response bodies, so sites wifi get-broadcast-details returns an SSID's pre-shared key in cleartext, and guest report and search return live guest voucher codes straight from the local mirror. Full details, including how to lock it down, are in governance.md.

Status

Beta, awaiting live verification. The command surface is validated against the UniFi Network integration API's published spec and the CLI's own mock verification suite (the generation run recorded live_api_verification as unverified); no closed-loop receipt from an MSP running it against a production gateway exists yet. We validate skills with MSPs in our weekly Build Sessions - RSVP at compoundingteams.com/build-sessions.


Standards. Conforms to the open Agent Skills spec (Anthropic, Dec 2025; 40+ agents). MCP-compatible - works with any MCP-capable agent including Hermes. OpenClaw-ready (frontmatter pre-wired, awaiting OpenClaw launch).

Attribution. The underlying CLI was generated and contributed by Ricardo Cabral (@phoenix-server) and is redistributed here under Apache-2.0 with the original NOTICE preserved in cli/NOTICE.

Packaged and maintained by Servosity. Apache-2.0 licensed. Built with CLI Printing Press. Last updated: 2026-08-14.

Source: skills/unifi-network/README.md at commit 061ec05

Tools

0
SourceWeft started this package once in an isolated sandbox, without credentials, to list its tools. That failed: the package type cannot run in the sandbox.

Version history

5
  1. v0.1.9LatestOct 23, 2026
  2. v0.1.8Oct 23, 2026
  3. v0.1.7Oct 22, 2026
  4. v0.1.6Oct 16, 2026
  5. v0.1.5Sep 16, 2026

Score

40% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

    Declare a license in the repository or the registry entry.