UniFi Internal API MCP Server

UniFi Internal API MCP Server

Provides 170+ tools to manage UniFi networks via the internal controller API, enabling AI assistants to perform full network management including clients, devices, WLANs, firewall, and more.

Category
访问服务器

README

UniFi Internal API MCP Server

An MCP (Model Context Protocol) server that exposes the internal UniFi Controller API — the same API the web UI uses — as tools for AI assistants.

This wraps the cookie-authenticated controller endpoints documented in the Art-of-WiFi/UniFi-API-client PHP library, providing ~170 tools for managing UniFi networks.

Features

  • Full controller access: Clients, devices, WLANs, networks, firewall, statistics, events, admins, firmware, backups, DNS, RADIUS, DPI, hotspot/vouchers, and more
  • Cookie-based authentication: Uses the same session auth as the UniFi web UI
  • UniFi OS support: Works with UDM, UDR, UCG, and legacy standalone controllers
  • Readonly safety mode: Write operations blocked by default — enable explicitly
  • 170+ tools across 19 categories

Quick Start

  1. Clone this repository
  2. Copy .env.example to .env and fill in your controller details
  3. Run: uv run unifi-internal-api-mcp

Configuration

Variable Description Default
UNIFI_HOST Controller URL (e.g. https://192.168.1.1) required
UNIFI_USERNAME Controller username
UNIFI_PASSWORD Controller password
UNIFI_TOKEN Pre-authenticated TOKEN cookie (alternative to username/password)
UNIFI_SITE Site name default
UNIFI_IS_UNIFI_OS UniFi OS controller (UDM/UDR/UCG) true
UNIFI_READONLY Block all write operations true
UNIFI_SSL_VERIFY Verify SSL certificates false

Authentication

Option 1: Username/password — for self-hosted controllers without 2FA:

UNIFI_USERNAME=admin
UNIFI_PASSWORD=your-password

Option 2: Browser token — for cloud-hosted (ui.com) or 2FA-enabled controllers:

  1. Log into your controller in a browser
  2. Open DevTools (Cmd+Option+I) > Application > Cookies
  3. Copy the TOKEN cookie value
UNIFI_TOKEN=eyJhbGciOiJIUzI1NiIs...

The token expires after ~30 days. When using a token, the server won't log out (so your browser session stays valid).

Tool Categories

Module Tools Description
system 15 Sysinfo, health, dashboard, settings, device states
sites 13 Site management, settings (country, SNMP, NTP, etc.)
clients 20 Client management, guest auth, block/unblock
devices 23 Device adoption, restart, locate, radio settings
hotspot 9 Vouchers, hotspot operators, guest login
wlans 8 WLAN configuration, MAC filters
networks 4 Network CRUD
firewall 5 Firewall groups and rules
statistics 22 5min/hourly/daily/monthly stats, speedtest, IPS
events 4 Events and alarms
admins 8 Admin management and permissions
firmware 10 Firmware updates, rolling upgrades
backups 3 Backup generation and export
dns 3 DNS records (v2 API)
radius 5 RADIUS profiles and accounts
tags 5 Device tags
dpi 5 DPI stats, port forwarding, system log
user_groups 4 User groups (bandwidth profiles)
ap_groups 4 AP groups (v2 API)

MCP Client Configuration

Add to your MCP client config (e.g. Claude Desktop):

{
  "mcpServers": {
    "unifi-internal": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/unifi_internal_api_mcp", "unifi-internal-api-mcp"],
      "env": {
        "UNIFI_HOST": "https://your-controller-url",
        "UNIFI_TOKEN": "eyJhbGciOiJIUzI1NiIs...",
        "UNIFI_SITE": "default",
        "UNIFI_READONLY": "true"
      }
    }
  }
}

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选