UniFi MCP Server
Integrates with Cloudflare Access for OAuth 2.1 identity verification and Cloudflare Tunnels for secure remote connectivity to the UniFi management interface.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
UniFi MCP Server
A Model Context Protocol server for managing UniFi networks through Claude Desktop or other MCP clients.
Features
18 MCP Tools - Comprehensive network management capabilities
OAuth 2.1 + PKCE - Secure authentication with Cloudflare Access
API Key Authentication - Uses official UniFi API with X-API-KEY
MCP 2025-11-25 Compliant - Full specification compliance
Remote Ready - Designed for access via Cloudflare Tunnel
Related MCP server: unifi-mcp
Quick Start
1. Generate UniFi API Key
In your UniFi Controller/UDM:
Go to Settings → Control Plane → Integrations
Click Generate API Key
Copy the key
2. Configure Environment
cp .env.example .envEdit .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-13. Start with Docker
docker compose up -d4. Configure Cloudflare
Create a Cloudflare Tunnel pointing to your server
Create an Access for SaaS application in Zero Trust:
Protocol: OIDC
Redirect URL:
https://your-domain.com/callback
Connect with Claude Desktop using your tunnel URL
Available Tools
Client Management
Tool | Description |
| List all connected devices |
| Get details for a specific client by MAC |
| Search by name, IP, or MAC |
| Block a device from the network |
| Unblock a device |
| Force a client to reconnect |
| List blocked devices |
Device Management
Tool | Description |
| List all UniFi devices (APs, switches, gateways) |
| List access points with status |
| Restart an AP or switch |
Network Configuration
Tool | Description |
| List VLANs and subnets |
| List wireless SSIDs |
| List port forwarding rules |
Monitoring
Tool | Description |
| Network health statistics |
| Recent network events |
| Active and recent alarms |
Architecture
Claude Desktop
↓
Cloudflare Tunnel (secure tunnel)
↓
UniFi MCP Server (OAuth 2.1 + MCP)
↓
UniFi Controller/UDM (X-API-KEY)Authentication Flow
This server implements OAuth 2.1 with Cloudflare Access as the identity provider:
MCP client discovers OAuth endpoints via
/.well-known/oauth-authorization-serverClient initiates OAuth flow to
/authorizewith PKCEUser authenticates via Cloudflare Access (supports Entra ID, Google, etc.)
Upon approval, client exchanges code for tokens at
/tokenClient accesses
/mcpwith Bearer token
OAuth Endpoints
Endpoint | Description |
| Authorization server metadata |
| Protected resource metadata (RFC 9728) |
| Authorization endpoint (auto-registers clients) |
| Token endpoint |
| Dynamic client registration |
| Cloudflare OAuth callback |
Configuration
Variable | Required | Description |
| No | Server port (default: 3000) |
| Yes | Public URL for OAuth redirects |
| Yes | Cloudflare Access team name |
| Yes | From Access for SaaS app |
| Yes | From Access for SaaS app |
| Yes | UniFi controller IP |
| No | Controller port (default: 443) |
| Yes | API key from UniFi |
| No | Site name (default: "default") |
Security
OAuth 2.1 + PKCE - Secure token exchange
Cloudflare Tunnel - No direct IP exposure
Cloudflare Access - Identity verification at the edge
API Key Auth - No passwords stored, scoped access
Recommended WAF Rules
Consider blocking non-essential paths:
Allow:
/.well-known/*,/register,/authorize,/callback,/token,/mcpBlock or protect:
/,/health
Tech Stack
Node.js 22 with ES Modules
Express.js
Docker with Alpine Linux
Development
# Install dependencies
npm install
# Run with hot-reload
npm run dev
# Check syntax
node --check server.jsLicense
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Unified MCP Server is a remote MCP connector for AI agents and vertical AI products that provides access to 22,000+ authorized SaaS tools across 400+ integrations and 24 categories directly inside LLMs (Claude, GPT, Gemini, Cohere). Tools operate only on explicitly authorized customer connections, enabling agents to safely read and write against live third-party systems.
Hosted MCP server connecting AI assistants to 9,000+ apps and 40,000+ actions via Zapier.
Secure and manage MCP servers through the Speakeasy AI Control Plane from your agent.
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Related MCP Servers
- AlicenseDqualityDmaintenanceEnables comprehensive management of UniFi network infrastructure through the UniFi Cloud API, including device control, client management, camera settings, and access door control through natural language.3937 npmApache 2.0
- AlicenseAqualityCmaintenanceMCP server that turns Claude into a UniFi network specialist. Manage devices, optimize WiFi, audit security, and troubleshoot your network through natural language.3114 npm2MIT
- AlicenseBqualityDmaintenanceAn MCP server that enables AI assistants to manage UniFi network infrastructure, including cloud management, local network devices, and Protect cameras, through natural language.621MIT
- AlicenseAqualityBmaintenanceEnables querying UniFi network devices and data using natural language through MCP clients like Claude Desktop.4562 npm1MIT