# UniFi Network MCP

This MCP server lets AI assistants inspect and manage UniFi Network clients, devices, VLANs, VPNs, and firewall rules. It fits network audits and controlled changes.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 946
- Author: sirkirby
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/sirkirby/unifi-mcp/tree/HEAD/apps/network
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/mcp/unifi-network-mcp

## What it does

UniFi Network MCP exposes 210 UniFi Network tools to an AI assistant. It can query clients, devices, firewall rules, VLANs, VPNs, Traffic Flows, statistics, recent events, and configuration changes.

Mutating actions use a preview-then-confirm flow, so the proposed change is shown before it is applied. Setup needs a UniFi controller host, a username, and a password; an API key is used for inventory and explicit Integration API tools. Without a controller host, the server stays in setup mode and offers only `unifi_setup_status`.

Claude Code can store the connection as plugin options, while Codex saves a version-pinned MCP entry in `config.toml`. Other listed clients can launch the server with `uvx unifi-network-mcp`.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `UNIFI_HOST`, `UNIFI_USERNAME`, `UNIFI_PASSWORD`, `UNIFI_API_KEY`, `UNIFI_PORT`, `UNIFI_VERIFY_SSL`, `UNIFI_SITE` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env UNIFI_HOST=<UNIFI_HOST> --env UNIFI_USERNAME=<UNIFI_USERNAME> --env UNIFI_PASSWORD=<UNIFI_PASSWORD> --env UNIFI_API_KEY=<UNIFI_API_KEY> --env UNIFI_PORT=<UNIFI_PORT> --transport stdio network -- uvx unifi-network-mcp
```
Replace <…> with your own values. 2 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from unifi-network-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add network --env UNIFI_HOST=<UNIFI_HOST> --env UNIFI_USERNAME=<UNIFI_USERNAME> --env UNIFI_PASSWORD=<UNIFI_PASSWORD> --env UNIFI_API_KEY=<UNIFI_API_KEY> --env UNIFI_PORT=<UNIFI_PORT> -- uvx unifi-network-mcp
```
Replace <…> with your own values. 2 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from unifi-network-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "network": {
            "command": "uvx",
            "args": [
                "unifi-network-mcp"
            ],
            "env": {
                "UNIFI_HOST": "<UNIFI_HOST>",
                "UNIFI_USERNAME": "<UNIFI_USERNAME>",
                "UNIFI_PASSWORD": "<UNIFI_PASSWORD>",
                "UNIFI_API_KEY": "<UNIFI_API_KEY>",
                "UNIFI_PORT": "<UNIFI_PORT>"
            }
        }
    }
}
```
Replace <…> with your own values. 2 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from unifi-network-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "network": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "unifi-network-mcp"
            ],
            "env": {
                "UNIFI_HOST": "<UNIFI_HOST>",
                "UNIFI_USERNAME": "<UNIFI_USERNAME>",
                "UNIFI_PASSWORD": "<UNIFI_PASSWORD>",
                "UNIFI_API_KEY": "<UNIFI_API_KEY>",
                "UNIFI_PORT": "<UNIFI_PORT>"
            }
        }
    }
}
```
Replace <…> with your own values. 2 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from unifi-network-mcp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e UNIFI_HOST=<UNIFI_HOST> -e UNIFI_USERNAME=<UNIFI_USERNAME> -e UNIFI_PASSWORD=<UNIFI_PASSWORD> -e UNIFI_API_KEY=<UNIFI_API_KEY> -e UNIFI_PORT=<UNIFI_PORT> network uvx unifi-network-mcp
```
Replace <…> with your own values. 2 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from unifi-network-mcp <command>

## When to use it
- inspect clients and usage on a VLAN
- audit firewall policies for conflicts
- find access points with frequent client disconnects
- review network changes before applying them
- summarize large Traffic Flows and new clients

## Example prompts
- Audit my firewall policies and identify redundant or conflicting rules.
- Show network changes from the last 24 hours, then prepare an IoT blocking rule for confirmation.

## Similar
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [OpenWork MCP Gateway](https://affpapa.org/en/nevibecode/mcp/openwork-mcp-gateway.md) — MCP server · ★ 24242
- [Keploy](https://affpapa.org/en/nevibecode/mcp/keploy.md) — MCP server · ★ 18727
- [Nhost](https://affpapa.org/en/nevibecode/mcp/nhost.md) — MCP server · ★ 9366
- [basebalance.cloud — x402 RPC & MCP gateway](https://affpapa.org/en/nevibecode/mcp/basebalancecloud-x402-rpc-mcp-gateway.md) — MCP server · ★ 7506

From the same set: [sirkirby/unifi-mcp](https://affpapa.org/en/nevibecode/by/sirkirby/unifi-mcp.md) — 3 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
