Skip to content
MCP server

UniFi Gateway

MCP server giving AI clients dry-run-first access to a local UniFi gateway

Runs locally

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

Pricing
Open source
Platforms
CLI, Self-hosted, macOS
Runs
Locally
What it can do
Can delete data (1 tool)
Version
0.2.0
Listing updated

Similar MCP servers

Install

Add with the CLI

Run in a terminal

claude mcp add unifi-mcp --env UNIFI_API_KEY='<UNIFI_API_KEY>' -- npx -y @mmoonport-labs/unifi-mcp

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

Or share it with your project

Add to .mcp.json

{
  "mcpServers": {
    "unifi-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@mmoonport-labs/unifi-mcp"
      ],
      "env": {
        "UNIFI_API_KEY": "<UNIFI_API_KEY>"
      }
    }
  }
}

Claude Code setup guide

Add to claude_desktop_config.json

{
  "mcpServers": {
    "unifi-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@mmoonport-labs/unifi-mcp"
      ],
      "env": {
        "UNIFI_API_KEY": "<UNIFI_API_KEY>"
      }
    }
  }
}

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

Claude Desktop setup guide

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "unifi-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@mmoonport-labs/unifi-mcp"
      ],
      "env": {
        "UNIFI_API_KEY": "<UNIFI_API_KEY>"
      }
    }
  }
}

Use .cursor/mcp.json in a project to share it with the project.

Cursor setup guide

Add to ~/.copilot/mcp-config.json

{
  "mcpServers": {
    "unifi-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@mmoonport-labs/unifi-mcp"
      ],
      "env": {
        "UNIFI_API_KEY": "<UNIFI_API_KEY>"
      }
    }
  }
}

Or put the same entry in .mcp.json at your workspace root to share it.

VS Code setup guide

Add with the CLI

Run in a terminal

codex mcp add unifi-mcp --env UNIFI_API_KEY='<UNIFI_API_KEY>' -- npx -y @mmoonport-labs/unifi-mcp

Or add to config.toml

Add to ~/.codex/config.toml

[mcp_servers.unifi-mcp]
command = "npx"
args = ["-y", "@mmoonport-labs/unifi-mcp"]
env = { UNIFI_API_KEY = "<UNIFI_API_KEY>" }

Codex setup guide

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

{
  "mcpServers": {
    "unifi-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@mmoonport-labs/unifi-mcp"
      ],
      "env": {
        "UNIFI_API_KEY": "<UNIFI_API_KEY>"
      }
    }
  }
}
  • Gemini CLI and Antigravity

    Gemini CLI

    Add to ~/.gemini/settings.json

    {
      "mcpServers": {
        "unifi-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "@mmoonport-labs/unifi-mcp"
          ],
          "env": {
            "UNIFI_API_KEY": "<UNIFI_API_KEY>"
          }
        }
      }
    }

    Or run: gemini mcp add -s user -e UNIFI_API_KEY='<UNIFI_API_KEY>' unifi-mcp npx -- -y @mmoonport-labs/unifi-mcp

    Antigravity

    Add to ~/.gemini/config/mcp_config.json

    {
      "mcpServers": {
        "unifi-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "@mmoonport-labs/unifi-mcp"
          ],
          "env": {
            "UNIFI_API_KEY": "<UNIFI_API_KEY>"
          }
        }
      }
    }

    Use .agents/mcp_config.json to add it to one workspace only.

    Gemini CLI and Antigravity setup guide

  • Devin Desktop (formerly Windsurf)

    Add to ~/.config/devin/mcp_config.json

    {
      "mcpServers": {
        "unifi-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "@mmoonport-labs/unifi-mcp"
          ],
          "env": {
            "UNIFI_API_KEY": "<UNIFI_API_KEY>"
          }
        }
      }
    }

    On Windows the file is %APPDATA%\devin\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

    Devin Desktop setup guide

  • Cline

    Add to cline_mcp_settings.json

    {
      "mcpServers": {
        "unifi-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "@mmoonport-labs/unifi-mcp"
          ],
          "env": {
            "UNIFI_API_KEY": "<UNIFI_API_KEY>"
          }
        }
      }
    }

    Open it from the MCP Servers icon → Configure → Configure MCP Servers.

    Cline setup guide

  • Zed

    Add to Zed settings.json

    {
      "context_servers": {
        "unifi-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "@mmoonport-labs/unifi-mcp"
          ],
          "env": {
            "UNIFI_API_KEY": "<UNIFI_API_KEY>"
          }
        }
      }
    }

    Open it with zed: open settings file. Merge context_servers into the settings you already have.

    Zed setup guide

  • JetBrains AI Assistant and Junie

    AI Assistant

    Add to Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add

    {
      "mcpServers": {
        "unifi-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "@mmoonport-labs/unifi-mcp"
          ],
          "env": {
            "UNIFI_API_KEY": "<UNIFI_API_KEY>"
          }
        }
      }
    }

    The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

    Junie

    Add to ~/.junie/mcp/mcp.json

    {
      "mcpServers": {
        "unifi-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "@mmoonport-labs/unifi-mcp"
          ],
          "env": {
            "UNIFI_API_KEY": "<UNIFI_API_KEY>"
          }
        }
      }
    }

    Use .junie/mcp/mcp.json to share it with a project.

    JetBrains AI Assistant and Junie setup guide

  • Kiro

    Add to ~/.kiro/settings/mcp.json

    {
      "mcpServers": {
        "unifi-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "@mmoonport-labs/unifi-mcp"
          ],
          "env": {
            "UNIFI_API_KEY": "<UNIFI_API_KEY>"
          }
        }
      }
    }

    Use .kiro/settings/mcp.json to add it to one workspace only.

    Kiro setup guide

Using several servers? Build one config file with the MCP config generator.

Configuration

  • UNIFI_URLGateway address, e.g. https://192.168.1.1. Not needed after running `unifi-mcp setup` once.
  • UNIFI_API_KEYUniFi API key (Settings > Control Plane > Integrations). Not needed after `unifi-mcp setup`.
  • UNIFI_CERT_SHA256SHA-256 fingerprint of the gateway's certificate, to pin it. `unifi-mcp setup` sets this for you.
  • UNIFI_READ_ONLYSet to 1 to refuse every change to the gateway.

About UniFi Gateway

Gives an AI client a way to read and change a UniFi gateway on your own network, covering Network and Protect. Instead of one tool per endpoint, it offers search, describe and call tools over the full catalog of gateway operations, plus a few direct tools for listing devices, clients, health and port forwards.

Every change is a dry run unless the caller explicitly applies it, and applied writes return the previous values with a ready revert call. Setup stores the gateway address and a pinned certificate fingerprint, and the API key goes to the system keychain or a user-only file. Traffic stays on the local network.

It suits people who run a UniFi gateway at home or in a small office and want an assistant to inspect clients, check health or adjust port forwards. The project is unofficial, and several write operations have not yet been tested on real hardware.

Tools this server provides (11)

Taken from the project documentation; the running server may differ.

From the tool list in its README, going by the names, 1 of 11 tools deletes data and 2 change data; 3 names don't say.

From the server's own tool labels and tool names; not verified by us.

unifi_info
Network and Protect versions, sites, loaded spec versions and spec drift.
unifi_list_port_forwardsName suggests: reads
Lists every port-forward rule.
unifi_health
Site health by subsystem.
unifi_list_devicesName suggests: reads
Lists adopted devices.
unifi_list_clientsName suggests: reads
Lists connected clients.
unifi_set_port_forwardName suggests: changes
Enables or disables a port-forward rule or changes its targets.
unifi_search_apiName suggests: reads
Finds gateway operations by words, tag, risk or api.
unifi_describe_operationName suggests: reads
Shows parameters and request-body schema of one operation.
unifi_call
Runs a read operation.
unifi_writeName suggests: changes
Runs a create or update operation, dry run by default.
unifi_deleteName suggests: deletes
Runs a delete operation, dry run by default.

What it does

Search and describe API
Find gateway operations by keyword, tag or risk level and read their parameters and request schemas.
Dry-run write guard
Changes return a before-and-after preview and only apply when both dry_run and confirm are set.
Port forward management
List port-forward rules and enable, disable or retarget them.
Client and device listing
Show adopted devices and connected clients with their state and firmware.
Certificate pinning
Pins the gateway certificate so the API key is sent only to that certificate.
Read-only mode
An environment flag refuses every change regardless of client permissions.
Audit logging
Optionally appends each applied change to a JSON lines file with secrets redacted.

Good for

  • Check which devices and clients are connected to a home network
  • Enable or disable a port-forward rule from an AI assistant
  • Review site health by subsystem when troubleshooting connectivity
  • Run a read-only security review of gateway settings
  • Look up a gateway API operation before writing a custom change

Pricing

Open source

Free MIT-licensed server, run locally.

UniFi Gateway FAQ

Does UniFi Gateway send network data to the cloud?

The server talks only to the gateway's local API, and the README states that nothing leaves the network.

How are changes protected?

Writes are dry runs unless dry_run is false and confirm is true. Setting UNIFI_READ_ONLY=1 refuses all changes.

Where is the API key stored?

Setup saves it to the macOS Keychain or Linux keyring, or to a user-only file where neither exists.

Is UniFi Gateway an official Ubiquiti product?

No. The README says it is unofficial and not endorsed by Ubiquiti Inc.

Is UniFi Gateway free?

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

How do I add UniFi Gateway to Claude Code?

Run this command in your terminal: claude mcp add unifi-mcp --env UNIFI_API_KEY='<UNIFI_API_KEY>' -- npx -y @mmoonport-labs/unifi-mcp

What are the best alternatives to UniFi Gateway?

The closest alternatives to UniFi Gateway are UniFi, UniFi Network MCP, Unifi MCP Server, Unifi and UniFi.

Where this comes from

  • Description: written from the project's README and its MCP Registry entry.
  • Install steps: from the official MCP Registry entry.

How AIPoweredBot checks servers