UniFi

io.github.mattoddie由 GitHub 账号 mattoddie 发布v0.6.1更新于 Oct 29, 2026

Manage a Ubiquiti UniFi network: devices, clients, WiFi, firewall and VPN. Read-only by default.

概览

AI 生成的概览

让助手查看并在开启写入后管理 Ubiquiti UniFi 网络:站点、设备、客户端、WiFi、防火墙、VPN 等。

可以做什么
  • 查看站点、控制器信息与站点健康状态,列出设备、客户端和交换机端口
  • 管理 WiFi 网络、VLAN、WAN、DNS 记录和带宽配置
  • 审查防火墙规则、端口转发、流量路由、IDS/IPS 以及 VPN 与 RADIUS 设置
  • 创建热点访客凭证并管理访客授权
  • 读取事件、告警、流量报告、DPI 和测速结果,管理管理员与备份
  • 用 dry run 预览变更,并通过 raw 工具调用任意控制器 API 路径
适用场景
适合用自然语言询问 UniFi 网络情况:健康检查、弱信号客户端、防火墙与端口转发风险审查、固件状态或创建访客凭证。适用于家庭实验室和受管站点,让助手读取网络,并可选地做出变更。
运行要求
以 stdio 本地运行,可用 Docker 镜像或 Claude Desktop 扩展包。需要 UNIFI_URL 指定控制器地址,并提供 UNIFI_API_KEY,或使用 UNIFI_USERNAME 与 UNIFI_PASSWORD 的本地账户。https 控制器需设置 UNIFI_TLS_FINGERPRINT 或 UNIFI_VERIFY_SSL。使用容器方式需要 Docker。
安装前请注意
默认只读;写入需开启 UNIFI_ALLOW_WRITES,删除还需 UNIFI_ALLOW_DELETES,可能重启设备、封禁客户端或删除配置。raw 工具可调用任意控制器 API 路径。UNIFI_VERIFY_SSL=false 会跳过证书校验,并不安全,建议改用 UNIFI_TLS_FINGERPRINT 固定证书。API 密钥和密码属敏感信息;在生产网络开启写入前先用 dry run 并启用 UNIFI_AUDIT_LOG。

安装

在 SourceWeft 中

  1. 打开 控制台中的 UniFi,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[unifi-mcp logo]

unifi-mcp

Talk to your UniFi network.

An open-source Model Context Protocol server for Ubiquiti UniFi Network. It lets Claude and other AI assistants monitor and manage your sites, devices, clients, WiFi, firewall and more, all from one Docker container.

[CI] [Release] [Container image] [License: MIT]

unifi-mcp.mattoddie.dev

Quick start · Documentation · Tool reference · Contributing


"Why is the lounge TV buffering?" The TV is on the Lounge AP at -78 dBm and 12 Mbps, and that AP's 5 GHz radio is at 81% channel utilisation on channel 36. Moving the AP to channel 149 or adding a wired backhaul should fix it. Want me to change the channel?

Ask about your network in plain English. The assistant picks from 145 tools to look things up and, if you allow it, make changes. Some examples:

  • 🩺 "Give me a health check of the network."
  • 🔎 "Which clients have a weak WiFi signal right now?"
  • 🔐 "Review my firewall and port forwards for anything risky."
  • 🔄 "Which devices have firmware updates, and when were they last rebooted?"
  • 🎟️ "Create 10 one-day guest vouchers limited to 5 Mbps."
  • 🧱 "Block the device called 'kids-tablet' until I unblock it."

Highlights

  • 🐳 Docker-first. There's one small distroless image (ghcr.io/mattoddie/unifi-mcp, about 22 MB) for linux/amd64 and linux/arm64. It serves Streamable HTTP for a long-running service, or stdio for docker run -i. For Claude Desktop there's also a one-click extension bundle (.mcpb) that needs no Docker.
  • 🛡️ Safe by default. The server is read-only unless you turn on writes, and deleting configuration needs a second switch. Destructive tools are labelled so your MCP client asks before running them, and passwords and keys are redacted from output.
  • 🔍 Preview and audit. Every write tool takes dry_run: true to show the request it would send, with a field-level diff of what would change, without changing anything. UNIFI_AUDIT_LOG records each change in a JSON Lines audit log.
  • 🧰 Broad coverage. It covers 14 toolsets: devices, clients, switch ports and PoE, WiFi, networks and VLANs, WAN, DNS, legacy and zone-based firewall, traffic rules and routes, IDS/IPS, VPN, RADIUS, hotspot vouchers, statistics, logs, admins and backups.
  • 🎛️ Tunable. Expose only the toolsets you need, which keeps the model's context small and focused. See Keeping the tool list small.
  • 🔌 Works with your controller. Supports UniFi OS consoles (UDM, UDM Pro/SE, UCG, UDR, UX, Cloud Key Gen2+, UniFi OS Server) and legacy self-hosted Network applications. Auth is an API key or a local account.
  • 🧪 Tested. The test suite runs against a mock controller on every build.

Quick start

You need Docker, a UniFi controller and an MCP client such as Claude Code.

1. Get credentials. On a UniFi OS console, create an API key: UniFi Network → Settings → Control Plane → Integrations → Create API Key. On older controllers, use a local account instead.

2. Start the server.

sh
mkdir unifi-mcp && cd unifi-mcpcurl -fsSLO https://raw.githubusercontent.com/mattoddie/unifi-mcp/main/compose.yamlcurl -fsSL https://raw.githubusercontent.com/mattoddie/unifi-mcp/main/example.env -o .env# Edit .env: set UNIFI_URL, UNIFI_API_KEY and a random MCP_AUTH_TOKEN (required; e.g. `openssl rand -hex 32`).# For an https controller, also say how to check its certificate, or the server won't start.# Recommended: pin it with UNIFI_TLS_FINGERPRINT (see docs/security.md). example.env sets# UNIFI_VERIFY_SSL=false, which skips the check: remove it once the fingerprint is set.docker compose up -d

3. Connect your assistant.

sh
claude mcp add --transport http unifi http://<docker-host>:8080/mcp \  --header "Authorization: Bearer <MCP_AUTH_TOKEN>"

Now ask "How's my network doing?" in Claude Code.

Using Claude Desktop, VS Code, Cursor or Codex? See Connecting MCP clients. Prefer not to run a service? Use stdio mode with docker run -i.

Claude Desktop in one click

On a Mac or Windows PC with Claude Desktop, you don't need Docker at all. Download the .mcpb bundle for your computer from the latest release, open it, and enter your controller URL, API key and certificate fingerprint in the settings. See Claude Desktop.

unifi-mcp is also listed in the MCP Registry as io.github.mattoddie/unifi-mcp, with the image (over stdio) and the bundles, so clients and directories that read the registry can install it.

Turning on changes

Out of the box the assistant can look but not touch. To let it make changes, add these to .env and run docker compose up -d:

sh
UNIFI_ALLOW_WRITES=true      # restart devices, block clients, edit WiFi/firewall/networks…UNIFI_ALLOW_DELETES=true     # also allow deleting configuration, forgetting clients… (needs writes too)UNIFI_TOOLSETS=overview,devices,clients,wifi,monitoring   # optional: expose fewer toolsUNIFI_AUDIT_LOG=stderr       # optional: log every change (or a file path; see docs/configuration.md)

Ask for a dry run to preview a change first: "Dry run: disable the guest WiFi. What would change?" Read Security before turning on writes for a production network.

What it can do

ToolsetWhat's covered
overviewSites, controller info, site health
devicesDevice status and details, restart/locate/provision, firmware upgrades (also rolling), radios, PoE outlets, adoption, RF scans, AP groups
clientsOnline and known clients, block/unblock, reconnect, names, fixed IPs, lock to an AP, forget
switchingSwitch ports, port profiles, PoE power-cycling, port mirroring, link aggregation, LLDP neighbours
wifiWLANs (SSIDs, security, VLANs, bands), WiFi QR codes
networksNetworks/VLANs and DHCP, WAN, local DNS records, bandwidth profiles, dynamic DNS
firewallPort forwards, firewall rules and groups, zone-based policies and zones, traffic rules, QoS rules, NAT rules, switch ACL rules, object-oriented network policies
routingStatic routes, policy-based traffic routes
securityIDS/IPS threat management, threat log, country blocking, content filtering
vpnVPN servers and site-to-site VPNs, RADIUS profiles and accounts
hotspotVouchers, hotspot operators, guest authorization, guest portal
monitoringEvents, alarms, traffic reports, traffic flows, DPI, speed tests, rogue APs, system log, sessions, anomalies, dashboards
adminSite settings (including SNMP, mDNS and auto-backup), admins, backups, controller updates, sites
rawAn escape hatch that calls any controller API path

See the tool reference for every tool and argument. Ready-made prompts like network_health_check, troubleshoot_client and security_review chain the tools together for common jobs.

Documentation

The docs are also published at unifi-mcp.mattoddie.dev/docs, with search.

🚀 Getting startedStep-by-step setup, from credentials to first question
🔌 Connecting MCP clientsClaude Code, Claude Desktop, VS Code, Cursor, Codex, stdio mode
⚙️ ConfigurationEvery environment variable, Docker secrets, toolsets
🐳 DeploymentCompose, image tags, upgrades, TLS reverse proxy, hardening
💬 Using unifi-mcpExample conversations, prompts, how saves and secrets work
🧰 Tool referenceAll 145 tools and 5 prompts, generated from the code
🛡️ SecurityThreat model, least privilege, safe write setups
📡 CompatibilitySupported controllers and versions, API caveats
🩹 TroubleshootingCommon errors and how to fix them
🛠️ DevelopmentArchitecture, adding a tool, testing

Contributing

Contributions are very welcome, whether that's bug reports, compatibility reports from your hardware, docs or new tools. Read the contributing guide to get started, and please follow the code of conduct. To report a vulnerability, see the security policy. Please don't open a public issue for one.

License

MIT © Matt Oddie

unifi-mcp is an independent community project. It is not affiliated with, endorsed by or sponsored by Ubiquiti Inc. UniFi and Ubiquiti are trademarks of Ubiquiti Inc.

来源:README.md,提交 076263d

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:该软件包类型无法在沙箱中运行。

版本历史

1
  1. v0.6.1最新Oct 22, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分