We and selected third parties use cookies or similar technologies for technical purposes and, with your consent, to analyze how the site is used.

You can freely give, refuse or withdraw your consent at any time.

UniFi Gateway

MCP server by Pete Stergion

Manage self-hosted UniFi Network, Protect and Access with dry-run previews, multi-site support and an audit log.

Runs locally (Runs on your machine: its page has the install command)Runs with dockerNeeds an API key

Install UniFi Gateway

Runs on your machine. Your client starts it with this command:

docker run -i --rm ghcr.io/pete-builds/mcp-unifi:0.25.0

Needs Docker on your computer. The setup steps below show where the command goes in each client.

  • STUB_MODE optional When true, the server returns realistic mock data and requires no UniFi hardware. Defaults to true so the image is functional out of the…
  • UNIFI_HOST optional IP address or hostname of the UniFi OS gateway (UCG-Fiber, UDM Pro, etc). Required when STUB_MODE=false and MCP_UNIFI_CONTROLLERS_FILE is…
  • UNIFI_API_KEY secret optional Local API key generated under Settings -> Control Plane -> Integrations on the gateway. Required when STUB_MODE=false and…
  • UNIFI_SITE optional UniFi controller site name. Defaults to 'default'.
  • UNIFI_VERIFY_SSL optional Whether to verify the gateway's TLS certificate. Defaults to false because most home gateways use a self-signed cert.
  • MCP_UNIFI_CONTROLLERS_FILE optional Path to a YAML file describing multiple named controllers for multi-site management. When set, the legacy UNIFI_HOST / UNIFI_API_KEY env…

Share this server

Opens this page, with the install command and setup steps.

mcp.tc/i/unifi-gateway

About

Community server for self-hosted UniFi gateways. It covers UniFi Network (devices, VLANs, WLANs, firewall, switch ports, port forwards, DHCP reservations, observability), opt-in UniFi Protect (cameras, motion events, smart detections) and read-only UniFi Access (doors, credentials, visitors, badge events). Destructive tools accept a dry-run flag, and every call is written to a JSONL audit log with secrets scrubbed.

It runs locally as a Docker image (stdio or Streamable HTTP), a Claude Desktop bundle, a Helm chart or uvx. A local UniFi API key from the gateway is needed; no cloud account is required. A stub mode returns mock data so you can try it without hardware. One instance can manage several controllers via a YAML file.

What you can do

  • Manage VLANs, WLANs, firewall rules, DHCP reservations and port forwards
  • Preview destructive changes with dry-run before applying
  • Inspect devices, clients and AP radio settings
  • Read UniFi Protect cameras, motion events and smart detections
  • Read UniFi Access doors, credentials and badge events
  • Manage multiple UniFi sites from one server
  • Review a JSONL audit log of every tool call
  • Try the tool surface in stub mode without hardware

Tools

Local servers list their tools once they’re running, so we can’t show them here. Look for the list in its documentation; your client shows them after you add it.

Example prompts

  • List all VLANs and WLANs on my UniFi gateway.

  • Preview creating an IoT network with dry run before applying it.

  • Audit open ports across my firewall rules and zone policies.

  • Show recent motion events from my Protect cameras.

Set up

Every client starts UniFi Gateway on your machine with the same command. Pick yours; the page remembers your choice.

Claude Code

  1. Run this in a terminal, in your project folder:
claude mcp add --transport stdio unifi-gateway --env "UNIFI_API_KEY=<YOUR_UNIFI_API_KEY>" --env "UNIFI_ACCESS_API_KEY=<YOUR_UNIFI_ACCESS_API_KEY>" -- docker run -i --rm ghcr.io/pete-builds/mcp-unifi:0.25.0
  1. Start Claude Code and type /mcp. unifi-gateway should show as connected.

Add --scope user to make it available in every project. Replace the placeholders with your own values.

Claude Desktop

  1. Open Settings → Developer → Edit Config. It opens claude_desktop_config.json. Add:
claude_desktop_config.json
{
  "mcpServers": {
    "unifi-gateway": {
      "command": "docker",
      "args": [
        "run",
        "-e",
        "UNIFI_API_KEY",
        "-e",
        "UNIFI_ACCESS_API_KEY",
        "-i",
        "--rm",
        "ghcr.io/pete-builds/mcp-unifi:0.25.0"
      ],
      "env": {
        "UNIFI_API_KEY": "<YOUR_UNIFI_API_KEY>",
        "UNIFI_ACCESS_API_KEY": "<YOUR_UNIFI_ACCESS_API_KEY>"
      }
    }
  }
}
  1. Save the file and restart Claude Desktop. Replace the placeholders with your own values.

Needs Docker on your computer. The file lives in ~/Library/Application Support/Claude/ on macOS and %APPDATA%\Claude\ on Windows.

Cursor

Or add it by hand to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project):

mcp.json
{
  "mcpServers": {
    "unifi-gateway": {
      "command": "docker",
      "args": [
        "run",
        "-e",
        "UNIFI_API_KEY",
        "-e",
        "UNIFI_ACCESS_API_KEY",
        "-i",
        "--rm",
        "ghcr.io/pete-builds/mcp-unifi:0.25.0"
      ],
      "env": {
        "UNIFI_API_KEY": "<YOUR_UNIFI_API_KEY>",
        "UNIFI_ACCESS_API_KEY": "<YOUR_UNIFI_ACCESS_API_KEY>"
      }
    }
  }
}

Needs Docker on your computer. Replace the placeholders with your own values.

VS Code

Add it to .vscode/mcp.json. VS Code asks for the secret the first time and stores it securely:

.vscode/mcp.json
{
  "servers": {
    "unifi-gateway": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-e",
        "UNIFI_API_KEY",
        "-e",
        "UNIFI_ACCESS_API_KEY",
        "-i",
        "--rm",
        "ghcr.io/pete-builds/mcp-unifi:0.25.0"
      ],
      "env": {
        "UNIFI_API_KEY": "${input:unifi-api-key}",
        "UNIFI_ACCESS_API_KEY": "${input:unifi-access-api-key}"
      }
    }
  },
  "inputs": [
    {
      "type": "promptString",
      "id": "unifi-api-key",
      "description": "UNIFI_API_KEY",
      "password": true
    },
    {
      "type": "promptString",
      "id": "unifi-access-api-key",
      "description": "UNIFI_ACCESS_API_KEY",
      "password": true
    }
  ]
}

Needs Docker on your computer.

Devin Desktop

  1. Add it to ~/.config/devin/mcp_config.json (macOS and Linux) or %APPDATA%\devin\mcp_config.json (Windows):
mcp_config.json
{
  "mcpServers": {
    "unifi-gateway": {
      "command": "docker",
      "args": [
        "run",
        "-e",
        "UNIFI_API_KEY",
        "-e",
        "UNIFI_ACCESS_API_KEY",
        "-i",
        "--rm",
        "ghcr.io/pete-builds/mcp-unifi:0.25.0"
      ],
      "env": {
        "UNIFI_API_KEY": "<YOUR_UNIFI_API_KEY>",
        "UNIFI_ACCESS_API_KEY": "<YOUR_UNIFI_ACCESS_API_KEY>"
      }
    }
  }
}
  1. Refresh the MCP server list in Cascade. Replace the placeholders with your own values.

Devin Desktop is the new name for Windsurf.

Codex

codex mcp add unifi-gateway --env "UNIFI_API_KEY=<YOUR_UNIFI_API_KEY>" --env "UNIFI_ACCESS_API_KEY=<YOUR_UNIFI_ACCESS_API_KEY>" -- docker run -i --rm ghcr.io/pete-builds/mcp-unifi:0.25.0

Or edit ~/.codex/config.toml directly:

config.toml
[mcp_servers.unifi-gateway]
command = "docker"
args = ["run", "-i", "--rm", "ghcr.io/pete-builds/mcp-unifi:0.25.0"]
env = { UNIFI_API_KEY = "<YOUR_UNIFI_API_KEY>", UNIFI_ACCESS_API_KEY = "<YOUR_UNIFI_ACCESS_API_KEY>" }

Needs Docker on your computer. Replace the placeholders with your own values.

Gemini CLI

gemini mcp add -e "UNIFI_API_KEY=<YOUR_UNIFI_API_KEY>" -e "UNIFI_ACCESS_API_KEY=<YOUR_UNIFI_ACCESS_API_KEY>" unifi-gateway docker -- run -i --rm ghcr.io/pete-builds/mcp-unifi:0.25.0

This adds it to the current project. Add -s user to use it everywhere.

Any client

Most clients that start local servers accept this shape:

{
  "mcpServers": {
    "unifi-gateway": {
      "command": "docker",
      "args": [
        "run",
        "-e",
        "UNIFI_API_KEY",
        "-e",
        "UNIFI_ACCESS_API_KEY",
        "-i",
        "--rm",
        "ghcr.io/pete-builds/mcp-unifi:0.25.0"
      ],
      "env": {
        "UNIFI_API_KEY": "<YOUR_UNIFI_API_KEY>",
        "UNIFI_ACCESS_API_KEY": "<YOUR_UNIFI_ACCESS_API_KEY>"
      }
    }
  }
}

Zed puts servers under context_servers in its settings, with the same command, args and env fields.

Needs Docker on your computer. Replace the placeholders with your own values.

Embed

Show UniFi Gateway in a README or on your site. Each embed links to this page, uses the server’s own install command, and sets no cookies. How embeds work

The card, the iframe and the JSON are in English. Add ?lang=it, fr, de or es to their address for another language.

README badge

Badge preview, lightBadge preview, dark
Markdown
[![UniFi Gateway on mcp.tc](https://mcp.tc/i/unifi-gateway/badge.svg)](https://mcp.tc/i/unifi-gateway)
HTML
<a href="https://mcp.tc/i/unifi-gateway"><img src="https://mcp.tc/i/unifi-gateway/badge.svg" alt="UniFi Gateway on mcp.tc" height="20"></a>

It follows the reader’s light or dark mode. Add ?theme=light or ?theme=dark to fix it, or ?style=compact to show the mark without the word.

Website card

HTML
<script src="https://mcp.tc/w/unifi-gateway.js" async></script>

The card appears where the tag is. Add data-theme="dark" or data-size="compact" to the tag to change it. The file holds everything it needs, so it makes no other requests and sets no cookies.

iframe

HTML
<iframe src="https://mcp.tc/embed/unifi-gateway" title="UniFi Gateway on mcp.tc" width="420" height="200" loading="lazy" allow="clipboard-write" style="border:0;border-radius:8px;max-width:100%"></iframe>

Use it on pages that don’t allow scripts. Add ?theme=light or ?theme=dark to the address to fix the colors.

JSON

The listing as data for your own pages and tools: name, tagline, install command, tools and the “Add to” links. Any site can read it (CORS is open).

https://mcp.tc/i/unifi-gateway.json

What each field means

AI prompt

Paste this into an AI coding assistant, such as Claude Code or Cursor, and it adds the UniFi Gateway card to your site.

Markdown
Add the mcp.tc card for UniFi Gateway, an MCP server, to my website. It is one static script: no build step, no package to install, no cookies.

Put this tag where the card should appear. The card renders right before it:

```html
<script src="https://mcp.tc/w/unifi-gateway.js" async></script>
```

To show the card somewhere else, put this placeholder there and load the same script once, for example before `</body>`. Keep the link inside: visitors without JavaScript see it.

```html
<div data-mcptc="unifi-gateway"><a href="https://mcp.tc/i/unifi-gateway">UniFi Gateway on mcp.tc</a></div>
```

Options:
- `data-theme="light"` or `"dark"` on the tag or the placeholder fixes the colors. Without it, the card follows the visitor’s light or dark mode.
- `data-size="compact"` gives a smaller card without the tagline.
- The CSS variable `--mcptc-max-width` on the placeholder or a parent sets the width (default `520px`).
- `?lang=` on the script URL sets the card’s language: `en`, `it`, `fr`, `de` or `es`.

If the site has a Content Security Policy, allow `script-src https://mcp.tc` and `img-src data:` (the icon is inline).

For a README or other Markdown docs, use the badge instead:

```markdown
[![UniFi Gateway on mcp.tc](https://mcp.tc/i/unifi-gateway/badge.svg)](https://mcp.tc/i/unifi-gateway)
```

Reference: https://mcp.tc/embed

Change history

It runs on your computer and has no package we can follow. Edits by its owner show up here.

Follow UniFi Gateway and we’ll email you when something changes.

Nothing recorded yet. Edits by the server’s owner will show up here.

FAQ

Can I paste mcp.tc/i/unifi-gateway into my MCP client?

No. UniFi Gateway runs on your own computer, started by your client, so it has no web address to connect to. The quick link is the page to share; the install command is docker run -i --rm ghcr.io/pete-builds/mcp-unifi:0.25.0.

Does UniFi Gateway need an API key?

Yes. It reads UNIFI_API_KEY and UNIFI_ACCESS_API_KEY from its environment, and UNIFI_API_KEY and UNIFI_ACCESS_API_KEY are secrets. Put the values in your client’s config on your own machine, never in a shared file.

Is UniFi Gateway a remote or a local server?

Local. Your client starts it as a process on your computer with docker run -i --rm ghcr.io/pete-builds/mcp-unifi:0.25.0, which needs Docker.

What can UniFi Gateway do?

You can manage VLANs, WLANs, firewall rules, DHCP reservations and port forwards, preview destructive changes with dry-run before applying and inspect devices, clients and AP radio settings.

Which clients can use it?

Any client that starts local servers: Claude Code, Claude Desktop, Cursor, VS Code, Devin Desktop, Codex, Gemini CLI, Zed and others. claude.ai and ChatGPT only connect to remote servers.

Does mcp.tc track changes to UniFi Gateway?

Partly. UniFi Gateway runs on your computer and has no package we can follow, so its History tab shows only edits by its owner. Follow the listing to get an email when it changes.

Who wrote this page?

mcp.tc’s robot read UniFi Gateway’s public metadata (its package and repository pages), and an AI model drafted the text from it. A person reviews anything the checks can’t confirm. The text can still be wrong, so if you spot a mistake, use Report this listing on this page.

mcp.tc isn’t affiliated with Pete Stergion. This page was built from UniFi Gateway’s public metadata, last checked on 4 Oct 2026, and an AI model wrote the description, so it can be wrong. Names and marks belong to their owners. Something off? Report this listing.