Skip to content
MCP server

UniFi

Inspect and manage a UniFi network: devices, clients, WiFi, firewall and VPN

Runs locallyStatus and history
Install
Pricing
Open source
Platforms
self-hosted, macOS, Windows
Runs
Locally
Version
0.8.0
Listing updated
2 days ago

About UniFi

UniFi is an open-source MCP server for cloud and infrastructure. It runs locally on your machine and is started by your AI client.

Covering 145 tools in 14 toolsets (59 read, 57 write, 29 delete), this open-source server talks to a UniFi controller, from UniFi OS consoles such as UDM, UDM Pro, Cloud Gateway and Cloud Key Gen2+ to self-hosted Network applications up to 10.6. Authentication is a UniFi API key or a local account.

It spans switch ports and PoE, VLANs and WAN links, port forwards, legacy and zone-based firewall, traffic rules, IDS/IPS, VPN and RADIUS, hotspot vouchers, statistics and backups. Changes are off unless allowed, deleting needs a second switch, every write tool offers dry_run with a field-level diff, and secrets are redacted. TLS certificate pinning is supported for self-signed controllers.

Install

Run in a terminal

claude mcp add unifi-mcp --env UNIFI_URL='<UNIFI_URL>' --env UNIFI_API_KEY='<UNIFI_API_KEY>' --env UNIFI_PASSWORD='<UNIFI_PASSWORD>' -- docker run -i --rm -e UNIFI_URL -e UNIFI_API_KEY -e UNIFI_PASSWORD ghcr.io/mattoddie/unifi-mcp:0.8.0

Add to claude_desktop_config.json

{
  "mcpServers": {
    "unifi-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "UNIFI_URL",
        "-e",
        "UNIFI_API_KEY",
        "-e",
        "UNIFI_PASSWORD",
        "ghcr.io/mattoddie/unifi-mcp:0.8.0"
      ],
      "env": {
        "UNIFI_URL": "<UNIFI_URL>",
        "UNIFI_API_KEY": "<UNIFI_API_KEY>",
        "UNIFI_PASSWORD": "<UNIFI_PASSWORD>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "unifi-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "UNIFI_URL",
        "-e",
        "UNIFI_API_KEY",
        "-e",
        "UNIFI_PASSWORD",
        "ghcr.io/mattoddie/unifi-mcp:0.8.0"
      ],
      "env": {
        "UNIFI_URL": "<UNIFI_URL>",
        "UNIFI_API_KEY": "<UNIFI_API_KEY>",
        "UNIFI_PASSWORD": "<UNIFI_PASSWORD>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "unifi-mcp": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "UNIFI_URL",
        "-e",
        "UNIFI_API_KEY",
        "-e",
        "UNIFI_PASSWORD",
        "ghcr.io/mattoddie/unifi-mcp:0.8.0"
      ],
      "env": {
        "UNIFI_URL": "<UNIFI_URL>",
        "UNIFI_API_KEY": "<UNIFI_API_KEY>",
        "UNIFI_PASSWORD": "<UNIFI_PASSWORD>"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "unifi-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "UNIFI_URL",
        "-e",
        "UNIFI_API_KEY",
        "-e",
        "UNIFI_PASSWORD",
        "ghcr.io/mattoddie/unifi-mcp:0.8.0"
      ],
      "env": {
        "UNIFI_URL": "<UNIFI_URL>",
        "UNIFI_API_KEY": "<UNIFI_API_KEY>",
        "UNIFI_PASSWORD": "<UNIFI_PASSWORD>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "unifi-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "UNIFI_URL",
        "-e",
        "UNIFI_API_KEY",
        "-e",
        "UNIFI_PASSWORD",
        "ghcr.io/mattoddie/unifi-mcp:0.8.0"
      ],
      "env": {
        "UNIFI_URL": "<UNIFI_URL>",
        "UNIFI_API_KEY": "<UNIFI_API_KEY>",
        "UNIFI_PASSWORD": "<UNIFI_PASSWORD>"
      }
    }
  }
}

Configuration

  • MCP_TRANSPORTThe image serves HTTP by default; this runs it over stdio.
  • UNIFI_URLAddress of your UniFi console. For a legacy self-hosted Network application, include the port.Required
  • UNIFI_API_KEYAPI key from UniFi Network → Settings → Control Plane → Integrations. Or use a username and password.
  • UNIFI_USERNAMEA local (not Ubiquiti cloud) account, used instead of an API key. Required for legacy controllers.
  • UNIFI_PASSWORDThe local account's password, used with the username.
  • UNIFI_TLS_FINGERPRINTRecommended for an https controller with a self-signed certificate: its SHA-256 fingerprint, to pin it.
  • UNIFI_VERIFY_SSLLeave empty when you set a fingerprint. true: publicly trusted certificate. false: skip the check (insecure).
  • UNIFI_SITEThe site's short name, used when a request doesn't name a site.
  • UNIFI_ALLOW_WRITESAllow changes: restart devices, block clients, edit WiFi, firewall and networks. Off means read-only.
  • UNIFI_ALLOW_DELETESAlso allow deleting configuration and forgetting clients. Needs UNIFI_ALLOW_WRITES.
  • UNIFI_ALLOW_SECRETSAllow unredacted passwords and keys (include_secrets) and the WiFi QR tool. Off keeps all output redacted.
  • UNIFI_TOOLSETSOptional 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 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_LOGSet to stderr to log every change the assistant makes or previews as JSON lines. Off when empty.

What it does

Broad network coverage
Devices, clients, ports, WiFi, VLANs, firewall, routes, VPN and statistics.
Preview and audit
dry_run diffs and an optional JSON Lines audit log.
Controller compatibility
Supports UniFi OS consoles and legacy self-hosted controllers.
Secret redaction
Passphrases and keys stay hidden from the model.
Certificate pinning
Pins a self-signed controller by fingerprint.

Good for

  • Run a network health check
  • Find clients with weak WiFi
  • Review port forwards for risk
  • Create guest vouchers with a speed limit
  • Block a device until further notice

Pricing

Open source

MIT licence

Prices change. Check unifi-mcp.mattoddie.dev before you buy.

UniFi FAQ

What credentials are needed?

A UniFi API key from Control Plane, Integrations, or a local account on older controllers.

Can it delete things?

Only if both writes and deletes are enabled.

Which controllers work?

UniFi OS consoles and self-hosted Network applications up to 10.6.

What licence?

MIT.

Is UniFi free?

Yes. UniFi is open source, so you can use and self-host it for free.

How do I add UniFi to Claude Code?

Run this command in your terminal: claude mcp add unifi-mcp --env UNIFI_URL='<UNIFI_URL>' --env UNIFI_API_KEY='<UNIFI_API_KEY>' --env UNIFI_PASSWORD='<UNIFI_PASSWORD>' -- docker run -i --rm -e UNIFI_URL -e UNIFI_API_KEY -e UNIFI_PASSWORD ghcr.io/mattoddie/unifi-mcp:0.8.0

What are the best alternatives to UniFi?

The closest alternatives to UniFi are REA, Agent Roast, Midplane, Leash and Tinplate Edge AI Safety, Security & EU Compliance.

Alternatives to UniFi

  1. REA

    MCP server

    CLI and MCP server that lets coding agents reverse engineer apps and binaries

    Runs locally
    • Open source
    • 464K GitHub stars
    • Developer tools
  2. Agent Roast

    MCP server

    Offline review that flags agent changes which weaken tests, assertions or CI

    Runs locally
    • Open source
    • 4 Hacker News points
    • Developer tools
  3. Midplane

    MCP server

    Postgres gateway for AI agents with table grants, column masking and approval for writes

    Runs locally
    • Open source
    • 5 GitHub stars
    • Databases
  4. Leash

    MCP server

    Review what your AI touched, approve risky actions and undo supported changes

    • 1 tool
    • Remote
    • Free
    • 1 GitHub star
    • Security
  5. SecureCloud

    MCP server

    SentinelOne and IT security catalog, prices, quotes and checkout links for Israel

    • 7 tools
    • Remote
    • Free
    • Security