UniFi

v0.10.0
io.github.mattoddie/unifi-mcp Checked 1 day ago Published 3 days ago

Manage a Ubiquiti UniFi network: devices, clients, WiFi, firewall and VPN.

Values you need

VariableWhat it is
MCP_TRANSPORToptional The image serves HTTP by default; this runs it over stdio.
UNIFI_URLrequired Address of your UniFi console. For a legacy self-hosted Network application, include the port.
UNIFI_API_KEYoptional secret API key from UniFi Network → Settings → Control Plane → Integrations. Or use a username and password.
UNIFI_USERNAMEoptional A local (not Ubiquiti cloud) account, used instead of an API key. Required for legacy controllers.
UNIFI_PASSWORDoptional secret The local account's password, used with the username.
UNIFI_TLS_FINGERPRINToptional Recommended for an https controller with a self-signed certificate: its SHA-256 fingerprint, to pin it.
UNIFI_VERIFY_SSLoptional Leave empty when you set a fingerprint. true: publicly trusted certificate. false: skip the check (insecure).
UNIFI_SITEoptional The site's short name, used when a request doesn't name a site. Default: default
UNIFI_ALLOW_WRITESoptional Allow changes: restart devices, block clients, edit WiFi, firewall and networks. Off means read-only. Default: false
UNIFI_ALLOW_DELETESoptional Also allow deleting configuration and forgetting clients. Needs UNIFI_ALLOW_WRITES. Default: false
UNIFI_ALLOW_SECRETSoptional Allow unredacted passwords and keys (include_secrets) and the WiFi QR tool. Off keeps all output redacted. Default: false
UNIFI_TOOLSETSoptional Optional comma-separated list to expose fewer tools, e.g. overview,devices,clients. Empty means all except raw, which has to be listed by name.
UNIFI_RAW_ALLOWED_PATHSoptional Optional comma-separated API path prefixes, e.g. /api/s/default/stat, that limit the raw API tool (toolset raw) to those paths. Empty allows any path.
UNIFI_AUDIT_LOGoptional Set to stderr to log every change the assistant makes or previews as JSON lines. Off when empty.

Docker

Requires Docker

Run in a terminal
claude mcp add unifi-mcp -e 'UNIFI_URL=<UNIFI_URL>' -- docker run -i --rm -e UNIFI_URL ghcr.io/mattoddie/unifi-mcp:0.10.0
Add to claude_desktop_config.json
{
  "mcpServers": {
    "unifi-mcp": {
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "UNIFI_URL",
        "ghcr.io/mattoddie/unifi-mcp:0.10.0"
      ],
      "command": "docker",
      "env": {
        "UNIFI_URL": "<UNIFI_URL>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "unifi-mcp": {
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "UNIFI_URL",
        "ghcr.io/mattoddie/unifi-mcp:0.10.0"
      ],
      "command": "docker",
      "env": {
        "UNIFI_URL": "<UNIFI_URL>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "UNIFI_URL",
      "id": "unifi-url",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "unifi-mcp": {
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "UNIFI_URL",
        "ghcr.io/mattoddie/unifi-mcp:0.10.0"
      ],
      "command": "docker",
      "env": {
        "UNIFI_URL": "${input:unifi-url}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.unifi-mcp]
command = "docker"
args = ["run", "-i", "--rm", "-e", "UNIFI_URL", "ghcr.io/mattoddie/unifi-mcp:0.10.0"]
env = { "UNIFI_URL" = "<UNIFI_URL>" }

For AI agents

  1. Ask the user for: UNIFI_URL. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. 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).
  3. Restart or reload the client so it starts the server.
  4. If it fails, check that the required runtime is installed (Docker) and that the values above are set.

Machine-readable: install.md · manifest.json