UniFi Protect MCP Server
Project description
UniFi Protect MCP Server
MCP server exposing UniFi Protect tools for LLMs, agents, and automation platforms. Query cameras, events, smart detections, recordings, lights, sensors, and chimes -- with safe-by-default permissions and preview-before-confirm for all mutations.
Install
# PyPI (recommended)
uvx unifi-protect-mcp
# or: pip install unifi-protect-mcp
# Docker
docker pull ghcr.io/sirkirby/unifi-protect-mcp:latest
# From source
git clone https://github.com/sirkirby/unifi-mcp.git
cd unifi-mcp && uv sync
Configure
Set these environment variables (or create a .env file):
# Server-specific variables (recommended)
UNIFI_PROTECT_HOST=192.168.1.1 # Controller IP or hostname
UNIFI_PROTECT_USERNAME=admin # Local admin username
UNIFI_PROTECT_PASSWORD=your-password # Admin password
# Optional:
# UNIFI_PROTECT_API_KEY= # Official UniFi API key (dual auth)
# UNIFI_PROTECT_PORT=443 # Controller HTTPS port
# UNIFI_PROTECT_VERIFY_SSL=false # SSL certificate verification
Fallback: The shared UNIFI_* variables (e.g., UNIFI_HOST) also work. The server checks for UNIFI_PROTECT_* first and falls back to UNIFI_* if the server-specific variable is not set. For single-controller setups, the shared variables are all you need.
Run
# stdio transport (default -- for Claude Desktop, LM Studio, etc.)
unifi-protect-mcp
# Docker
docker run -i --rm \
-e UNIFI_PROTECT_HOST=192.168.1.1 \
-e UNIFI_PROTECT_USERNAME=admin \
-e UNIFI_PROTECT_PASSWORD=secret \
ghcr.io/sirkirby/unifi-protect-mcp:latest
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"unifi-protect": {
"command": "uvx",
"args": ["unifi-protect-mcp"],
"env": {
"UNIFI_PROTECT_HOST": "192.168.1.1",
"UNIFI_PROTECT_USERNAME": "admin",
"UNIFI_PROTECT_PASSWORD": "your-password"
}
}
}
}
Features
- Cameras -- list, inspect, snapshot, RTSP streams, PTZ control, settings, recording toggle, reboot
- Events -- query historical events, smart detections (person/vehicle/animal/package), thumbnails
- Real-time streaming -- websocket event buffer with MCP resource subscriptions and polling
- Recordings -- status, availability, clip export with timelapse support
- Devices -- lights (brightness, PIR sensitivity), sensors (temperature, humidity, motion), chimes (volume, trigger)
- Liveviews -- list and inspect multi-camera layouts
- System -- NVR info, health metrics, firmware status, connected viewers
Documentation
- Configuration -- Full env var reference, YAML config, Protect-specific options
- Permissions -- Permission system, category defaults, how to enable mutations
- Tool Catalog -- All 34 tools organized by category
- Event Streaming -- Real-time event architecture, MCP resources, polling
- Troubleshooting -- Connection issues, SSL, missing tools
Development
cd apps/protect
make test # Run tests
make lint # Lint
make format # Format
make manifest # Regenerate tools_manifest.json
make pre-commit # All of the above
See the root CONTRIBUTING.md for the full monorepo workflow.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unifi_protect_mcp-0.1.1.tar.gz.
File metadata
- Download URL: unifi_protect_mcp-0.1.1.tar.gz
- Upload date:
- Size: 47.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1635a8447269c531fc47eb72b1eec9ba3819f2d51e7339e568eacf3e2acdc47
|
|
| MD5 |
404cf96fc5803d64efd8373a22319c05
|
|
| BLAKE2b-256 |
1e0a5dc1c25ecca36fe094ad661e66e7b49156a6488b514da95e1fc8e97503e0
|
Provenance
The following attestation bundles were made for unifi_protect_mcp-0.1.1.tar.gz:
Publisher:
publish-protect.yml on sirkirby/unifi-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
unifi_protect_mcp-0.1.1.tar.gz -
Subject digest:
e1635a8447269c531fc47eb72b1eec9ba3819f2d51e7339e568eacf3e2acdc47 - Sigstore transparency entry: 1119289265
- Sigstore integration time:
-
Permalink:
sirkirby/unifi-mcp@a3f3ffe1d11f64904eefa1fd7fd4b3bac216abc3 -
Branch / Tag:
refs/tags/protect/v0.1.1 - Owner: https://github.com/sirkirby
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-protect.yml@a3f3ffe1d11f64904eefa1fd7fd4b3bac216abc3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file unifi_protect_mcp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: unifi_protect_mcp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 65.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21ed94dd8dd9a873e39ef4318cf2ef11a58450c6ba6efe58f4083a55f22cdbf6
|
|
| MD5 |
fb1187743e5c6efa11196ce0ed826447
|
|
| BLAKE2b-256 |
d2ab385c96b3a65a1a8a02f17d9d7a87c860ac3b6067732b83d7dcecaabd4c32
|
Provenance
The following attestation bundles were made for unifi_protect_mcp-0.1.1-py3-none-any.whl:
Publisher:
publish-protect.yml on sirkirby/unifi-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
unifi_protect_mcp-0.1.1-py3-none-any.whl -
Subject digest:
21ed94dd8dd9a873e39ef4318cf2ef11a58450c6ba6efe58f4083a55f22cdbf6 - Sigstore transparency entry: 1119289268
- Sigstore integration time:
-
Permalink:
sirkirby/unifi-mcp@a3f3ffe1d11f64904eefa1fd7fd4b3bac216abc3 -
Branch / Tag:
refs/tags/protect/v0.1.1 - Owner: https://github.com/sirkirby
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-protect.yml@a3f3ffe1d11f64904eefa1fd7fd4b3bac216abc3 -
Trigger Event:
release
-
Statement type: