unifi-mcp  by sirkirby

AI-powered management for Ubiquiti UniFi infrastructure

Created 1 year ago
277 stars

Top 93.4% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides Model Context Protocol (MCP) servers designed to enable AI assistants and automation tools to interact with Ubiquiti UniFi controllers. It addresses the need for programmatic control and monitoring of UniFi Network, Protect, and Access applications, offering a structured and safe interface for AI-driven management. The target audience includes engineers and power users seeking to leverage AI for automating complex tasks and gaining deeper insights into their UniFi infrastructure.

How It Works

The core of UniFi MCP is a collection of independent Python servers, each acting as an MCP server for a specific UniFi application. These servers expose UniFi functionalities as composable and queryable MCP tools. A key architectural component is the Cloud Relay, comprising a Relay Sidecar and Worker Gateway, which bridges local MCP servers to a Cloudflare Worker. This allows cloud-based AI agents to access local UniFi tools securely without exposing local ports, supporting multi-location deployments through annotation-based fan-out for read-only tools.

Quick Start & Requirements

Installation is streamlined via the Claude Code plugin marketplace: /plugin marketplace add sirkirby/unifi-mcp, followed by /plugin install unifi-network@unifi-plugins (and similarly for Protect/Access), and then running the respective /setup command for guided controller connection and permission configuration. Alternatively, servers can be run directly using uvx (e.g., uvx unifi-network-mcp@latest). Prerequisites include access to a Ubiquiti UniFi controller and its administrative credentials (host, username, password), configurable via environment variables.

Highlighted Details

  • Agent Skills: Each plugin includes specialized agent skills for tasks like Network Health Checks, Firewall Management and Auditing, cross-product Security Digests, and UniFi Access control, complete with reference documentation and Python scripts.
  • Cross-Product Correlation: The relay enables unified queries across Network, Protect, and Access applications, allowing for comprehensive event timelines (e.g., correlating network clients, camera events, and badge scans at a specific location).
  • Safe Mutations: All actions that modify UniFi configurations employ a "preview-then-confirm" workflow, ensuring users see exactly what changes will occur before they are applied.
  • Multi-Controller Support: The system supports configurations where different MCP servers can connect to distinct UniFi controllers or use separate credentials via prefixed environment variables.

Maintenance & Community

No specific details regarding maintainers, community channels (like Discord or Slack), or project sponsorships are provided in the README.

Licensing & Compatibility

The project is licensed under the MIT license, which generally permits broad usage, including commercial applications and linking within closed-source projects, without significant restrictions.

Limitations & Caveats

The UniFi Protect and UniFi Access MCP servers are currently in a "Beta" status. The experimental UniFi API key authentication method is limited to read-only operations.

Health Check
Last Commit

12 hours ago

Responsiveness

Inactive

Pull Requests (30d)
22
Issues (30d)
17
Star History
57 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.