New advertisers: 50% off your first month with code FIRSTMONTHSee slots
mmoonport-labs avatar

UniFi Gateway

mmoonport-labs/unifi-mcp

Local API access to a UniFi gateway for Network and Protect, with dry-run-first router changes.

tools
11
auth
Secret needed
transport
STDIO
env vars
4
last updated
Nov 20, 2026
View on GitHub

What it does

  • Reads data with unifi_info, unifi_list_port_forwards, unifi_health, unifi_list_devices, and unifi_list_clients, plus unifi_call for any read operation
  • Writes changes with unifi_set_port_forward, unifi_write, and unifi_delete; each is a dry run unless dry_run=false and confirm=true are both set
  • Requires a gateway API key set up once through setup, with a pinned certificate fingerprint, and runs locally over stdio
  • Designed for network health checks, port-forward management, and device or client inventory on a home or small-office gateway

Tools

11 tools

Public tool metadata for what this MCP can expose to an agent.

unifi_infoNetwork and Protect versions, sites, the loaded spec versions, and `specDrift` (apps whose spec differs from the gateway)

Network and Protect versions, sites, the loaded spec versions, and `specDrift` (apps whose spec differs from the gateway)

No parameter schema in public metadata yet.

unifi_list_port_forwardsevery port-forward rule (id, name, enabled, WAN address and port, LAN target, protocol)

every port-forward rule (id, name, enabled, WAN address and port, LAN target, protocol)

No parameter schema in public metadata yet.

unifi_healthsite health by subsystem

site health by subsystem

No parameter schema in public metadata yet.

unifi_list_devicesadopted devices (name, model, firmware, state)

adopted devices (name, model, firmware, state)

No parameter schema in public metadata yet.

unifi_list_clientsconnected clients

connected clients

No parameter schema in public metadata yet.

unifi_set_port_forwardenable or disable a rule, or change its LAN target (`fwd`, `fwd_port`) or WAN port (`dst_port`)

enable or disable a rule, or change its LAN target (`fwd`, `fwd_port`) or WAN port (`dst_port`)

No parameter schema in public metadata yet.

unifi_search_apifind operations by words, tag, risk or api

find operations by words, tag, risk or api

No parameter schema in public metadata yet.

unifi_describe_operationparameters and full request-body schema of one operation

parameters and full request-body schema of one operation

No parameter schema in public metadata yet.

unifi_callrun a **read** operation

run a **read** operation

No parameter schema in public metadata yet.

unifi_writerun a create or update operation; dry run by default

run a create or update operation; dry run by default

No parameter schema in public metadata yet.

unifi_deleterun a delete operation; dry run by default

run a delete operation; dry run by default

No parameter schema in public metadata yet.

Configuration

UNIFI_URL

Gateway address, e.g. https://192.168.1.1. Not needed after running `unifi-mcp setup` once.

UNIFI_API_KEYsecret

UniFi API key (Settings > Control Plane > Integrations). Not needed after `unifi-mcp setup`.

UNIFI_CERT_SHA256

SHA-256 fingerprint of the gateway's certificate, to pin it. `unifi-mcp setup` sets this for you.

UNIFI_READ_ONLY

Set to 1 to refuse every change to the gateway.

Readme

unifi-mcp

Unofficial. Not affiliated with or endorsed by Ubiquiti Inc. UniFi and UniFi Protect are trademarks of Ubiquiti Inc. This server can change your network: changes are a dry run unless you confirm them, many write operations have not been tried on real gateways, and you use it at your own risk (MIT licence, no warranty). Report security problems as described in SECURITY.md.

A small MCP server for a UniFi gateway's local API (a UDM, UDM Pro, UCG and so on, Network 9+), written so that one person can read all of it. Nothing leaves your network.

Install and sign in

Needs Node 24 or newer. First sign in once, in a terminal:

npx -y @mmoonport-labs/unifi-mcp setup

View the full README on GitHub

Details

Repository
github.com/mmoonport-labs/unifi-mcp
Categories
DevOps & Cloud, Monitoring & Observability
Package
@mmoonport-labs/unifi-mcp
Transport
STDIO
Auth
Required
Registry
MCP registry, active

Similar to UniFi Gateway

More DevOps & Cloud