# UniFi MCP Server Configuration
# Supports multiple UniFi devices with different services
# =============================================================================
# MULTI-DEVICE CONFIGURATION (Recommended)
# =============================================================================
# Configure multiple UniFi devices as a JSON array
# Each device can have different services enabled (network, protect)
UNIFI_DEVICES='[
{
"name": "main-gateway",
"url": "https://192.168.1.1",
"api_key": "your-api-key-here",
"services": ["network"],
"site": "default",
"verify_ssl": false
},
{
"name": "nvr",
"url": "https://192.168.1.2",
"api_key": "your-nvr-api-key",
"services": ["network", "protect"],
"site": "default",
"verify_ssl": false,
"username": "your-username",
"password": "your-password"
}
]'
# Device configuration fields:
# - name: Friendly name for the device (used to target specific devices)
# - url: Base URL of the UniFi device (e.g., https://192.168.1.1)
# - api_key: API key created in UniFi OS Settings -> Control Plane -> API
# - services: Array of enabled services - "network" and/or "protect"
# - site: Site name for network operations (default: "default")
# - verify_ssl: Verify SSL certificates (default: false)
# - username: (Optional) Username for Protect events - required for motion/smart detection
# - password: (Optional) Password for Protect events - required for motion/smart detection
# =============================================================================
# LEGACY SINGLE-DEVICE CONFIGURATION (Backwards Compatible)
# =============================================================================
# If UNIFI_DEVICES is not set, these legacy settings will be used
# Connection mode options:
# - "local_api_key": UniFi OS Integration API with API key (recommended)
# - "local": Session-based auth with username/password (traditional)
# - "cloud": Ubiquiti Cloud API (api.ui.com)
# UNIFI_MODE=local_api_key
# Controller URL (required for local and local_api_key modes)
# UNIFI_CONTROLLER_URL=https://192.168.1.1
# API Key (required for local_api_key and cloud modes)
# For local_api_key: Create in UniFi OS Settings -> Control Plane -> API
# For cloud: Get from https://unifi.ui.com -> API section
# UNIFI_CLOUD_API_KEY=your-api-key-here
# Local admin credentials (only for mode=local)
# UNIFI_USERNAME=admin
# UNIFI_PASSWORD=your-password
# Site name (use "default" for single-site setups)
# UNIFI_SITE=default
# Set to true for UniFi OS devices (UDM, UDM-Pro, UCG-Fiber, etc.)
# UNIFI_IS_UDM=true
# SSL verification (set to false for self-signed certificates)
UNIFI_VERIFY_SSL=false
# =============================================================================
# USAGE EXAMPLES
# =============================================================================
#
# Using with Claude Desktop/Code:
#
# 1. List all configured devices:
# "List my UniFi devices"
#
# 2. Network operations (uses first network-enabled device by default):
# "List all connected clients"
# "Show network health"
#
# 3. Target specific device:
# "List devices on ucg-fiber"
# "Show cameras on udm-pro"
#
# 4. Protect operations (uses first protect-enabled device):
# "List all cameras"
# "Get camera snapshot from Front Door"
# "Show protect system info"