Skip to main content
MCP server CX Codex

go-unifi-mcp — Claude Code MCP server for UniFi control

A Go MCP server that lets an AI assistant reach your UniFi Network Controller: sites, devices, clients, networks, port forwarding, DNS and firewall rules.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add go-unifi-mcp -- docker run -i --rm ghcr.io/claytono/go-unifi-mcp:v0.3.1
Open on GitHub

What go-unifi-mcp does

The server wraps the go-unifi library and builds its tools from the controller's own API definitions. Tool coverage therefore tracks the UniFi Controller version that go-unifi pins. The author wrote it after failing to find an MCP server handling both v1 and v2 firewall rules plus IPv6.

Lazy mode is the default. Three meta-tools get registered — tool_index to search the catalog, execute to run one tool by name, and batch to run several in parallel — and they expose 252 controller operations. Switch to eager and all 252 tools register directly, which costs roughly 55K tokens of context; that setting suits debugging or non-LLM clients.

You need controller access before anything works. Either create an API key under Settings > Control Plane > Integrations and set UNIFI_HOST with UNIFI_API_KEY, or use a local admin account with UNIFI_HOST, UNIFI_USERNAME and UNIFI_PASSWORD. Writes follow a read-modify-write flow: the server fetches the current object, merges your fields, then submits the whole thing. Leave UNIFI_HOST unset and the server has nothing to talk to.

What it helps with

  • list clients and devices on a UniFi network
  • create a v2 or IPv6 firewall rule
  • set up port forwarding through the agent
  • inspect DNS records on the controller
  • run several UniFi operations in one batch

Example prompts for the agent

  • List every device in the default site with its status
  • Add a v2 firewall rule allowing traffic from VLAN 20 to VLAN 30
  • Forward port 8443 to the client nas

How to install go-unifi-mcp

Platform CLI

claude mcp add go-unifi-mcp -- docker run -i --rm ghcr.io/claytono/go-unifi-mcp:v0.3.1

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about go-unifi-mcp

How do I install go-unifi-mcp in Claude Code?

Run claude mcp add go-unifi-mcp -- docker run -i --rm ghcr.io/claytono/go-unifi-mcp:v0.3.1, then export the required environment variables in your shell before starting claude.

What does go-unifi-mcp do?

It gives an AI assistant access to a UniFi Network Controller: sites, devices, clients, networks, port forwarding, DNS and firewall rules. Access happens through MCP tools generated from the controller API.

How is lazy mode different from eager?

lazy registers three meta-tools while still reaching all 252 operations, which keeps context small. eager registers all 252 tools directly and takes about 55K tokens.

Similar MCP servers

All MCP servers for DevOps and infrastructure →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor