UniFi Site Manager and Network (unofficial)
v0.4.0Unofficial MCP server for the UniFi Site Manager and Network cloud APIs, with a write-confirm guard.
Values you need
| Variable | What it is | |
|---|---|---|
UNIFI_API_KEY | required secret | UniFi Site Manager API key with Network scope (unifi.ui.com, Settings > API). It controls your whole network: treat it like an admin password. |
UNIFI_CONFIRM_WRITES | optional | Write confirmation: destructive tools return a preview and run only when called again with confirm "YES". Only false, 0, no or off turn it off. Default: true |
UNIFI_API_BASE | optional | API base URL; this host receives the API key. https origin only (http only for loopback test stubs). Keep the default. Default: https://api.ui.com |
UNIFI_TIMEOUT_MS | optional | Per-request timeout in milliseconds, covering response headers and body. Default: 30000 |
UNIFI_LOG_LEVEL | optional | Log level on stderr: debug, info, warn or error. Default: info |
UNIFI_CONSOLE_ID | optional | Pins the UniFi console instead of discovering it (needed when the account has several consoles). |
UNIFI_NETWORK_SITE_ID | optional | Pins the Network site instead of discovering it. |
UNIFI_SITE_MANAGER_SITE_ID | optional | Pins the Site Manager site instead of discovering it. |
UNIFI_READ_ONLY | optional | Read-only mode: every write tool returns an error and sends no request; reads still work. Off by default. Default: false |
UNIFI_REDACT_SECRETS | optional | Masks passwords, WiFi passphrases, pre-shared keys and other secret fields in every tool result with (redacted); write tools refuse a body that contains that placeholder. Off by default. Default: false |
UNIFI_MAX_RESULT_BYTES | optional | Cuts tool results longer than this many bytes and marks them as truncated. Unset or empty: 100000. 0, off or none: no cap. Default: 100000 |
npm (npx) discovery passed
Requires Node.js 18+
Run in a terminal
claude mcp add the-real-unifi-mcp -e 'UNIFI_API_KEY=<UNIFI_API_KEY>' -- npx -y the-real-unifi-mcp@0.4.0Add to
claude_desktop_config.json{
"mcpServers": {
"the-real-unifi-mcp": {
"args": [
"-y",
"the-real-unifi-mcp@0.4.0"
],
"command": "npx",
"env": {
"UNIFI_API_KEY": "<UNIFI_API_KEY>"
}
}
}
}Add to
~/.cursor/mcp.json{
"mcpServers": {
"the-real-unifi-mcp": {
"args": [
"-y",
"the-real-unifi-mcp@0.4.0"
],
"command": "npx",
"env": {
"UNIFI_API_KEY": "<UNIFI_API_KEY>"
}
}
}
}Add to
.vscode/mcp.json{
"inputs": [
{
"description": "UNIFI_API_KEY",
"id": "unifi-api-key",
"password": true,
"type": "promptString"
}
],
"servers": {
"the-real-unifi-mcp": {
"args": [
"-y",
"the-real-unifi-mcp@0.4.0"
],
"command": "npx",
"env": {
"UNIFI_API_KEY": "${input:unifi-api-key}"
},
"type": "stdio"
}
}
}Add to
~/.codex/config.toml[mcp_servers.the-real-unifi-mcp]
command = "npx"
args = ["-y", "the-real-unifi-mcp@0.4.0"]
env = { "UNIFI_API_KEY" = "<UNIFI_API_KEY>" }For AI agents
- Ask the user for: UNIFI_API_KEY. Never invent or guess these values; secrets go into the client config, not into chat logs.
- Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
- Restart or reload the client so it starts the server.
- Verify: the server should expose these tools: unifi_raw_request, unifi_sm_list_hosts, unifi_sm_get_host, unifi_sm_list_sites, unifi_sm_list_devices, unifi_sm_get_isp_metrics, unifi_sm_query_isp_metrics, unifi_sm_list_sdwan_configs, ….
- If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.
Machine-readable: install.md · manifest.json