unifi-protect-mcp
v5.2.0
Published
MCP server for UniFi Protect cameras - snapshots, PTZ, events, sensors, lights, chimes
Maintainers
Readme
UniFi Protect MCP Server
High-performance Model Context Protocol server for UniFi Protect cameras. Control your cameras, get snapshots, manage events, PTZ, lights, sensors, and chimes through Claude or any MCP client.
Features
- 📷 19 Tools - Full camera control, snapshots, PTZ, events, sensors, lights, chimes
- ⚡ Smart Caching - LRU cache prevents API hammering
- 🔄 Circuit Breakers - Auto-disable failing methods, auto-recovery
- 📸 Bulk Snapshots - Parallel capture for multiple cameras
- 🏠 Multi-Location - Deploy to multiple sites
Installation
npm install -g unifi-protect-mcpOr clone directly:
git clone https://github.com/jadengarza/unifi-protect-mcp.git
cd unifi-protect-mcp
node server-v5.2.jsConfiguration
Create deploy/config.json:
{
"version": "5.2.0",
"location": "home",
"unvr_host": "192.168.1.1",
"server_port": 3849,
"api_key": "your-mcp-api-key",
"admin_key": "your-admin-key"
}Or use environment variables:
UNIFI_MCP_KEY- API key for MCP authenticationUNIFI_ADMIN_KEY- Admin key for remote management
Tools
| Tool | Description |
|------|-------------|
| get_system_info | Get UniFi Protect system information |
| health_check | Check connection health |
| list_cameras | List all cameras with status |
| get_camera | Get detailed camera info |
| get_snapshot | Get camera snapshot (base64) |
| get_bulk_snapshots | Get multiple snapshots in parallel |
| get_events | Get motion/detection events |
| set_camera_led | Turn camera LED on/off |
| set_camera_mic | Enable/disable camera microphone |
| set_lcd_message | Set doorbell LCD message |
| ptz_move | PTZ camera control (pan/tilt/zoom) |
| ptz_goto_preset | Move PTZ to preset position |
| list_sensors | List door/window/motion sensors |
| list_lights | List smart lights |
| set_light | Control smart light |
| list_chimes | List doorbell chimes |
| play_chime | Play chime sound |
| list_viewers | List Viewport devices |
| list_liveviews | List configured liveviews |
Endpoints
| Endpoint | Auth | Description |
|----------|------|-------------|
| /health | None | Health check, version, uptime |
| /mcp | API Key | MCP protocol (JSON-RPC) |
| /direct | API Key | Direct tool calls |
| /admin/* | Admin Key | Remote management |
Usage with Claude
Claude Desktop
Add to ~/.config/claude/claude_desktop_config.json:
{
"mcpServers": {
"unifi-protect": {
"command": "npx",
"args": ["unifi-protect-mcp"]
}
}
}Remote via Cloudflare Tunnel
cloudflared tunnel --url http://localhost:3849Then add the tunnel URL as a remote MCP in Claude.ai settings.
Requirements
- Node.js 18+
- UniFi Protect NVR (Cloud Key Gen2+, UNVR, UDM Pro)
- Local network access to NVR
License
MIT
