
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 分
请在仓库或注册中心条目中声明许可证。