Airsc is free for everyone. If it helps you, support it with $2–$20.

Support
PluginSafeIntegrations & automationSome setup

unifi-mcp

sirkirby · sirkirby/unifi-mcp

A suite of MCP servers that enables AI agents to manage UniFi Network, Protect, and Access applications, facilitating agentic workflows for smart home and network automation.

MCP servers & Graph API for the UniFi suite of applications, Network, Protect, and Access

868 stars117License: MITUpdated 13 days ago0 opens

Preview

▍

What you can do with it

  • Create an AI agent to monitor and configure a UniFi network.
  • Develop an agent to manage security cameras and access points using UniFi Protect and Access.
  • Automate routine UniFi device maintenance tasks through an AI agent.

Safety check

Safe

No risky patterns found in the files we scanned.

Automated scan of the repo files. Always review code you run.

From the README

UniFi MCP

Leverage agents and agentic AI workflows to manage your UniFi deployment.

Servers

ServerStatusToolsPackage
NetworkStable209unifi-network-mcp
ProtectStable62unifi-protect-mcp
AccessStable37unifi-access-mcp

Choose an integration

What you are buildingUseWhy
An AI assistant or another existing MCP clientNetwork, Protect, or Access MCP serverStandard MCP discovery, tool calls, permissions, and confirmation flows
A custom application, automation service, code-execution runtime, or MCP adapterunifi-api-serverYour code controls call sequencing, data joins, resource limits, and approval flow
Remote access for an MCP clientCloud RelayAuthenticated remote MCP routing without exposing the local servers directly

An MCP adapter can expose a small set of tools while using unifi-api-server as its backend. This keeps application-specific joins, branching, loops, and code isolation out of the general-purpose MCP servers.

Cloud Relay

ComponentStatusPackage
Relay SidecarBetaunifi-mcp-relay
Worker GatewayBetaunifi-mcp-worker (CLI)

Cloud Relay pairs the Cloudflare-hosted Worker gateway with the Relay sidecar on your LAN. The Worker provides the authenticated edge MCP endpoint, Durable Object broker, multi-location routing, token boundary, and deployment/management CLI. The Relay sidecar is a local MCP HTTP client and forwarder: it discovers configured local MCP servers over HTTP and maintains an outbound WebSocket to the Worker. Remote requests follow MCP client → Worker gateway → outbound WebSocket → Relay sidecar → local MCP servers over HTTP; the API server is not in this path. Read-only tools support annotation-based multi-location fan-out, while writes require explicit location targeting. Deploy the Worker with npm install -g unifi-mcp-worker && unifi-mcp-worker install, then see the Relay sidecar README to connect local servers.

REST + GraphQL API

ComponentStatusPackage
API ServerBetaunifi-api-server · GHCR image

unifi-api-server is an independent HTTP service for custom applications, automation, and adapters. It provides typed REST resources, read-only GraphQL queries, SSE streams, scoped API keys and administration, plus a REST action endpoint for supported controller operations. It shares unifi-core managers with the MCP servers but does not proxy or require them.

See apps/api/README.md for quick-start and deployment patterns.

What is this?

UniFi MCP is a collection of Model Context Protocol servers that let AI assistants and automation tools interact with Ubiquiti UniFi controllers. Each server targets a specific UniFi application (Network, Protect, Access) and exposes its functionality as MCP tools — queryable, composable, and safe by default.

MCP HTTP Access

MCP HTTP is unauthenticated and intended for trusted local clients. HTTP is disabled by default; when enabled, packages bind to loopback. Docker Compose enables it on the container network and publishes ports 3000–3002 on host 127.0.0.1. Use an authenticated TLS proxy or Cloud Relay for remote access, and prevent direct access to the backend. See the transport security model and HTTP setup and migration.

SettingDefaultPurpose
UNIFI_MCP_HTTP_ENABLEDfalseOpt into HTTP transport
UNIFI_MCP_HOST127.0.0.1Bind address; Compose explicitly uses 0.0.0.0 inside containers
UNIFI_MCP_HTTP_FORCEfalseAllow HTTP outside container PID 1
UNIFI_MCP_ALLOWED_HOSTSlocalhost,127.0.0.1Complete accepted Host-header list; Compose separately adds required internal hosts
UNIFI_MCP_ENABLE_DNS_REBINDING_PROTECTIONtrueValidate Host headers to prevent DNS-rebinding requests

MCP Discovery

UniFi MCP keeps the standard MCP path primary: capable clients discover currently registered tools with tools/list and invoke them with tools/call. The default lazy mode keeps initial context small by exposing meta-tools first, while eager mode registers all selected domain tools directly for clients that prefer a full standard tool list.

The lazy-loading meta-tools — *_tool_index, *_execute, *_batch, *_batch_status, and lazy-only *_load_tools — support filtered discovery, indirect execution, batch orchestration, and optional direct registration. They are independent of the protocol-version response compatibility policy below. See MCP Discovery and Lazy-Loading Meta-Tools for mode-by-mode behavior.

MCP response size

For tool results that already provide structured output, adaptive response mode is the default. It classifies each request by the canonical date-based protocolVersion advertised during MCP initialization, not by the client's product name or application version. Requests advertising MCP `2

View source on GitHub