
UniFi MCP
io.github.Servosity由 GitHub 帳號 Servosity 發布v0.1.9更新於 Nov 6, 2026
Every UniFi Network API operation, plus drift detection, topology, and rule prediction no other
概覽
本機 MCP 伺服器,讓助理呼叫完整的 UniFi Network API,並提供設定漂移、新裝置首見紀錄、拓撲與防火牆規則預測。
- 可以做什麼
- 查詢站點、裝置、用戶端、WiFi、防火牆原則、DNS、ACL 規則與熱點兌換碼
- 比對本機快照偵測設定漂移,並列出指定期間內首次出現的裝置與用戶端
- 檢視每個連接埠的連線與 PoE 狀態,並把用戶端歸到所連接的裝置下
- 預測兩台主機 IP 之間的流量會命中哪條防火牆原則
- 執行例行寫入,例如建立網路、防火牆或 DNS 原則,更新 WiFi 廣播
- 採納裝置、執行裝置或連接埠動作,以及刪除網路、原則或廣播
- 適用情境
- 適合管理自架 UniFi OS 閘道的網路維運人員與 MSP,希望助理回答主控台無法提供的歷史問題,例如某站點改了什麼、哪些硬體是新加入的。也適合在變更前檢查交換器連接埠與 PoE 餘裕,或預演防火牆比對。
- 執行需求
- 以本機程序(stdio)在桌面執行,提供 .mcpb 安裝包,工具會呼叫搭配的 unifi-network-cli 執行檔。需要可連線的自架 UniFi OS 閘道、在閘道介面產生的 API 金鑰,以及 UNIFI_API_KEY 與 UNIFI_GATEWAY_HOST 兩項憑證;選用 UNIFI_BASE_URL、UNIFI_BASE_PATH 與 PRINTING_PRESS_CLIENT_PROFILE。使用 npx 多代理安裝方式另需 Node.js。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 UniFi MCP,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
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):
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.
Skill-native agents (also covered): Hermes and OpenClaw read this skill's
SKILL.mddirectly 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
.mcpblaunches on macOS (Intel and Apple Silicon), Windows x64 and Linux x64. Every tool shells out to the companionunifi-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 setUNIFI_CLI_PATHto 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:
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, runiwr -useb https://raw.githubusercontent.com/Servosity/msp-skills/main/skills/unifi-network/install.ps1 | iex. Then authenticate per the README and rununifi-network-cli --helpto explore.
The same prompt works in any agent that can run shell.
Path B - run the installer yourself
Windows (PowerShell):
macOS / Linux:
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:
Upgrade to the latest version
The installer always fetches the current release - re-run it to upgrade:
macOS / Linux:
Windows (PowerShell):
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:
Inside a Hermes chat session:
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 theopenclaw: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):
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
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--jsonthe terminal path prints a one-lineN 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
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.
來源:skills/unifi-network/README.md,提交 061ec05
工具
0版本歷史
5- v0.1.9最新Oct 23, 2026
- v0.1.8Oct 23, 2026
- v0.1.7Oct 22, 2026
- v0.1.6Oct 16, 2026
- v0.1.5Sep 16, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。