# UniFi Gateway

> UniFi Gateway is an open-source MCP server for cloud and infrastructure. MCP server giving AI clients dry-run-first access to a local UniFi gateway. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted, macOS, Linux
- **Repository:** https://github.com/mmoonport-labs/unifi-mcp
- **MCP Registry name:** io.github.mmoonport-labs/unifi-mcp
- **Categories:** [cloud and infrastructure](https://ai-powered.com/categories/cloud-and-infrastructure)
- **Listing updated:** 2026-11-21

## About

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.

## Features

- **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

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
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.

### Claude Code: Or share it with your project (.mcp.json)

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

### Claude Desktop (claude_desktop_config.json)

```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.

### Cursor (~/.cursor/mcp.json)

```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.

### VS Code (~/.copilot/mcp-config.json)

```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.

### Codex: Add with the CLI (Terminal)

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

### Codex: Or add to config.toml (~/.codex/config.toml)

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

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```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

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```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.

### Devin Desktop (~/.config/devin/mcp_config.json)

```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.

### Cline (cline_mcp_settings.json)

```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.

### Zed (Zed settings.json)

```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.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "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.

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```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.

### Kiro (~/.kiro/settings/mcp.json)

```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.

### Other clients (your client's MCP settings (most use this shape))

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

## Tools

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_forwards` (name suggests: reads): Lists every port-forward rule.
- `unifi_health`: Site health by subsystem.
- `unifi_list_devices` (name suggests: reads): Lists adopted devices.
- `unifi_list_clients` (name suggests: reads): Lists connected clients.
- `unifi_set_port_forward` (name suggests: changes): Enables or disables a port-forward rule or changes its targets.
- `unifi_search_api` (name suggests: reads): Finds gateway operations by words, tag, risk or api.
- `unifi_describe_operation` (name suggests: reads): Shows parameters and request-body schema of one operation.
- `unifi_call`: Runs a read operation.
- `unifi_write` (name suggests: changes): Runs a create or update operation, dry run by default.
- `unifi_delete` (name suggests: deletes): Runs a delete operation, dry run by default.

## 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.

## Alternatives

- [UniFi](https://ai-powered.com/mcp/unifi-3): UniFi is an open-source MCP server for cloud and infrastructure.
- [UniFi Network MCP](https://ai-powered.com/mcp/unifi-network-mcp): UniFi Network MCP is an open-source MCP server for cloud and infrastructure.
- [Unifi MCP Server](https://ai-powered.com/mcp/unifi-mcp-server): Unifi MCP Server is an open-source MCP server for cloud and infrastructure.
- [Unifi](https://ai-powered.com/mcp/unifi-2): Unifi is an open-source MCP server for cloud and infrastructure.
- [UniFi](https://ai-powered.com/mcp/unifi): UniFi is an open-source MCP server for cloud and infrastructure.
- [Cisco Umbrella](https://ai-powered.com/mcp/cisco-umbrella): Cisco Umbrella is an open-source MCP server for cloud and infrastructure.
- [UniFi MCP](https://ai-powered.com/mcp/unifi-mcp-2): UniFi MCP is an open-source MCP server for cloud and infrastructure.
- [rustunifimcp](https://ai-powered.com/mcp/rustunifimcp): rustunifimcp is an open-source MCP server for cloud and infrastructure.

---
Source: https://ai-powered.com/mcp/unifi-gateway-2
