unifi-mcp
unifi-mcp
Schreibgeschützter Remote-MCP-Server, der die UniFi-Flotte von Example Corp / examplecorp über die offizielle UniFi Site Manager API (api.ui.com) als benutzerdefinierten Connector für Claude bereitstellt.
Geschwisterprojekt von odoo-ticket-mcp und den TRMM-MCP-Servern — gleiche Architektur:
Claude (claude.ai / Claude Code)
│ OAuth 2.0 bearer token (Microsoft Entra ID)
▼
nginx — TLS, Anthropic egress-IP allowlist (160.79.104.0/21), 403 otherwise
│ http://127.0.0.1:8097
▼
unifi-mcp container (Portainer stack, FastMCP 3.x, Streamable HTTP at /mcp)
│ X-API-KEY (Site Manager API key, read-only usage)
▼
api.ui.com — Site Manager API + connector proxy into each console's Network APIClient → Server-Authentifizierung: Microsoft Entra ID, Ressourcenserver-Modus. Der Server validiert die an die Zielgruppe (Audience) gebundenen Bearer-Tokens; er stellt sie niemals selbst aus. Der Zugriff wird über die Entra-Gruppenmitgliedschaft an der App-Registrierung gesteuert.
Server → UniFi-Authentifizierung: ein fester Site-Manager-API-Key (erstellt unter
unifi.ui.com→ API Keys mit Site-Manager- und Network-Anwendungs-Scopes, „Alle Sites“). Die Identität des Aufrufers wird in v1 bewusst NICHT an UniFi weitergeleitet.Netzwerkpfad: öffentliches DNS → nginx (TLS + Anthropic-IP-Allowlist) → Container. Defense in Depth: Die Allowlist ist eine zusätzliche Sicherheitsmaßnahme neben OAuth.
Tools (alle schreibgeschützt)
Site-Manager (flottenweit):
Tool | Rückgabe |
| Jede Konsole (UDM Pro / UNVR / Cloud Key): id, name, model, IP, state, version |
| Details einer einzelnen Konsole (optional: vollständiger Rohdatensatz) |
| Alle Network-Standorte über alle Konsolen hinweg, mit Geräte-/Client-Zahlen |
| Adoptierte Geräte in der gesamten Flotte (APs, Switches, Gateways), optionaler Filter pro Konsole |
| WAN/ISP-Gesundheit (Latenz, Verlust, Ausfallzeit, Durchsatz) für alle Sites, mit 5-Minuten- oder 1-Stunden-Auflösung |
| Dasselbe, aber für bestimmte (Host-, Site-)Paare und Zeitfenster |
| SD-WAN-Topologien + Bereitstellungsstatus |
Connector-Proxy (Detailabfrage pro Konsole, kein VPN erforderlich):
Tool | Rückgabe |
| Lokale Site-Liste der Konsole (lokale IDs unterscheiden sich von den Site-Manager-IDs) |
| Die Geräte einer Site aus der eigenen Network-API der Konsole |
| Vollständige Gerätedetails + aktuelle Live-Statistiken (CPU, Speicher, Uplink, Funke) |
| Live verbundene Clients: Name, MAC, IP, Verbindungstyp, Uplink |
Typischer Ablauf: unifi_list_hosts → Konsole auswählen → unifi_network_sites → unifi_network_clients / unifi_network_device.
Related MCP server: UniFi MCP Server
Lokale Entwicklung
python -m venv .venv
.venv\Scripts\pip install -r requirements.txt
copy .env.example .env # fill in UNIFI_API_KEY; set MCP_AUTH_ENABLED=false
.venv\Scripts\python -m unifi_mcp
# → http://127.0.0.1:8000/mcp (test with MCP Inspector)MCP_AUTH_ENABLED=false gibt den Endpunkt frei — nur für lokale Tests, niemals in der Produktion.
Entra-ID-App-Registrierung (einmalig)
In TrmmMCPServer/ENTRA_SSO_PLAYBOOK.md findest du die kommentierte Version. Zusammenfassung — führen Sie diese Schritte in der vorgegebenen Reihenfolge aus:
App-Registrierungen → Neue Registrierung — Name
UniFi MCP, Einzelmandant, noch ohne Redirect-URI. Kopieren Sie die Client-ID und die Tenant-ID.API verfügbar machen → Anwendungs-ID-URI — setzen Sie exakt auf
https://unifi-mcp.example.com/mcp(verhindert AADSTS9010010).API verfügbar machen → Bereich hinzufügen — `access_as_user–Administratoren und Benutzer können zustimmen, aktiviert.
Zertifikate und Geheimnisse → Neues Client-Secret —
claude-connector, 24 Monate. Kopieren Sie den Wert sofort.Authentifizierung → Plattform hinzufügen → Web — Redirect-URIs
https://claude.ai/api/mcp/auth_callbackundhttps://claude.com/api/mcp/auth_callback.Manifest — setzen Sie
requestedAccessTokenVersionauf2(verhindert 401-Fehler durch Aussteller-Mismatch).Enterprise-Anwendungen → UniFi MCP → Eigenschaften — Zuweisung erforderlich = Ja.
Enterprise-Anwendungen → Benutzer und Gruppen — fügen Sie die Gruppe
Unifi-MCP-Usershinzu. Gruppenmitgliedschaft = wer den Connector verwenden darf.
Bereitstellung
Siehe PORTAINER_DEPLOY.md (Portainer-Git-Stack + Webhook-Redeploy) und deploy/nginx-unifi-mcp.conf (TLS + Anthropic-IP-Allowlist).
Connector in claude.ai registrieren
Einstellungen → Connectors → neuen Connector hinzufügen:
Feld | Wert |
URL |
|
Client ID | die Client-ID der Entra-App |
Client Secret | das Client-Secret der Entra-App |
Authorization URL |
|
Token URL |
|
Scopes |
|
Abnahmetests
# 1. Discovery doc advertises the full resource scope (not api://…)
curl -s https://unifi-mcp.example.com/.well-known/oauth-protected-resource/mcp | jq .scopes_supported
# 2. Unauthenticated /mcp is challenged
curl -i https://unifi-mcp.example.com/mcp # 401 + WWW-Authenticate: Bearer
# 3. Non-Anthropic source IP is blocked at nginx
curl -i https://unifi-mcp.example.com/mcp # from anywhere else: 403
# 4. Health (host-local, bypasses nginx)
curl http://<docker-host>:8097/healthz # {"status":"ok","service":"unifi_mcp"}
# 5. In claude.ai: connect as a Unifi-MCP-Users member → tools appear;
# non-member → AADSTS50105 at sign-in.This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI assistants to interact with Ubiquiti UniFi network infrastructure for monitoring devices, managing clients, and performing configuration tasks like blocking/unblocking devices and viewing network health.101GPL 3.0
- 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.3952Apache 2.0
- AlicenseBqualityDmaintenanceEnables AI assistants to manage and monitor UniFi Network Controllers through natural language. Provides 25 read-only tools for discovering devices and clients, viewing security configurations, analyzing network statistics, and exporting configuration data.41MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to manage UniFi network infrastructure through 50+ tools covering devices, clients, networks, WiFi, firewall rules, and guest access using the official UniFi Network API.52585MIT
Related MCP Connectors
Uptime, SSL, DNS and domain monitoring you can talk to from Claude or any MCP client.
Hosted Amazon Seller Central and Amazon Ads MCP server for Claude, ChatGPT, Cursor, and agents.
Connect Claude to Fathom meeting recordings, transcripts, and summaries
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/JohnGilligan2/unifi-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server