loading…
Search for a command to run...
loading…
Enables managing UniFi networks through natural language, allowing users to monitor clients, check network health, and perform device actions like blocking or r
Enables managing UniFi networks through natural language, allowing users to monitor clients, check network health, and perform device actions like blocking or restarting access points. It securely connects UniFi Controllers to MCP clients with features like Google OAuth authentication.
A Model Context Protocol server for managing UniFi networks through Claude Desktop or other MCP clients.
In your UniFi Controller/UDM:
cp .env.example .env
Edit .env:
# Server
BASE_URL=https://your-domain.com
# Cloudflare Access for SaaS (OAuth identity provider)
CF_ACCESS_TEAM=your-team-name
CF_CLIENT_ID=your-client-id
CF_CLIENT_SECRET=your-client-secret
# UniFi Controller
UNIFI_HOST=192.168.1.1
UNIFI_API_KEY=your-api-key-from-step-1
docker compose up -d
https://your-domain.com/callback| Tool | Description |
|---|---|
list_clients |
List all connected devices |
get_client |
Get details for a specific client by MAC |
search_devices |
Search by name, IP, or MAC |
block_client |
Block a device from the network |
unblock_client |
Unblock a device |
reconnect_client |
Force a client to reconnect |
list_blocked_clients |
List blocked devices |
| Tool | Description |
|---|---|
list_devices |
List all UniFi devices (APs, switches, gateways) |
list_access_points |
List access points with status |
restart_device |
Restart an AP or switch |
| Tool | Description |
|---|---|
list_networks |
List VLANs and subnets |
list_wlans |
List wireless SSIDs |
list_port_forwards |
List port forwarding rules |
| Tool | Description |
|---|---|
get_network_health |
Network health statistics |
list_events |
Recent network events |
list_alarms |
Active and recent alarms |
Claude Desktop
↓
Cloudflare Tunnel (secure tunnel)
↓
UniFi MCP Server (OAuth 2.1 + MCP)
↓
UniFi Controller/UDM (X-API-KEY)
This server implements OAuth 2.1 with Cloudflare Access as the identity provider:
/.well-known/oauth-authorization-server/authorize with PKCE/token/mcp with Bearer token| Endpoint | Description |
|---|---|
/.well-known/oauth-authorization-server |
Authorization server metadata |
/.well-known/oauth-protected-resource/mcp |
Protected resource metadata (RFC 9728) |
/authorize |
Authorization endpoint (auto-registers clients) |
/token |
Token endpoint |
/register |
Dynamic client registration |
/callback |
Cloudflare OAuth callback |
| Variable | Required | Description |
|---|---|---|
PORT |
No | Server port (default: 3000) |
BASE_URL |
Yes | Public URL for OAuth redirects |
CF_ACCESS_TEAM |
Yes | Cloudflare Access team name |
CF_CLIENT_ID |
Yes | From Access for SaaS app |
CF_CLIENT_SECRET |
Yes | From Access for SaaS app |
UNIFI_HOST |
Yes | UniFi controller IP |
UNIFI_PORT |
No | Controller port (default: 443) |
UNIFI_API_KEY |
Yes | API key from UniFi |
UNIFI_SITE |
No | Site name (default: "default") |
Consider blocking non-essential paths:
/.well-known/*, /register, /authorize, /callback, /token, /mcp/, /health# Install dependencies
npm install
# Run with hot-reload
npm run dev
# Check syntax
node --check server.js
MIT
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"unifi-mcp-server": {
"command": "npx",
"args": []
}
}
}