@mgcrea/mcp-unifi-protect
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| UNIFI_PROTECT_HOST | Yes | Console IP or hostname. `https://` assumed, `:port` preserved. Required. | |
| UNIFI_PROTECT_TOTP | No | 2FA code. Expires in ~30s — prefer `unifi_protect_auth_login`. | |
| UNIFI_PROTECT_DEBUG | No | Verbose request logging to stderr. | |
| UNIFI_PROTECT_CONFIG | No | Config file location. Environment variables win over the file, field by field. | ~/.config/unifi-protect/config.json |
| UNIFI_PROTECT_PASSWORD | Yes | Console login password. Required. | |
| UNIFI_PROTECT_USERNAME | Yes | Console login username. Required. | |
| UNIFI_PROTECT_VERIFY_TLS | No | Verify the console's certificate (needs a host name, not an IP). Set to 'false' to disable. | true |
| UNIFI_PROTECT_MAX_RETRIES | No | Retries on 401 / 429 / 5xx. | 3 |
| UNIFI_PROTECT_ALLOW_WRITES | No | Set to '1' to register the 12 mutating tools. | false |
| UNIFI_PROTECT_SESSION_FILE | No | Cached session file location, mode 600. | ~/.config/unifi-protect/session.json |
| UNIFI_PROTECT_SNAPSHOT_DIR | No | Directory where images and exports are written. | ~/.cache/unifi-protect |
| UNIFI_PROTECT_DEVICE_CACHE_TTL | No | Camera id→name cache lifetime, in seconds. | 60 |
| UNIFI_PROTECT_MAX_DOWNLOAD_BYTES | No | Refuse a download larger than this. | 200000000 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| unifi_protect_auth_statusA | Check whether this server can actually reach your UniFi Protect console. By default it logs in and makes a real call, so the answer reflects the console rather than cached state — this is the tool to run when something is not working. Reports the host, the account, the Protect version, whether TLS is verified, and whether writes are enabled; when nothing is configured it returns the exact setup steps instead. Call this first when a tool you expected is not listed: an absent tool means missing configuration or writes being off, not a bug. |
| unifi_protect_auth_loginA | Force a fresh login to the console, replacing any cached session. Normally unnecessary — the server logs in on demand and re-authenticates automatically on a 401. Use it to supply a two-factor code, which cannot be done unattended: the code is single-use and expires in about 30 seconds, so it is passed here once and the resulting session is then cached and reused. |
| unifi_protect_auth_logoutA | Drop the cached session and delete the session file. The next call logs in again from the configured username and password, so this does not lock anything out — use it to clear a session after changing accounts, or to remove the cookie from disk. |
| unifi_protect_get_system_infoA | Overview of the console: model, Protect version, firmware, timezone, uptime, storage use and how many devices of each type are adopted. Worth calling first on an unfamiliar system. The reported Protect version matters: this server talks to Protect's private API, which Ubiquiti changes between releases, so a version that differs from the one in the README is the first thing to check if a tool starts returning 404. |
| unifi_protect_list_usersA | List the accounts that can sign in to Protect, with their role and last login. Useful for auditing who has access to the cameras. |
| unifi_protect_list_liveviewsA | List the saved live views — the named camera grid layouts shown on viewers and in the Protect app. The returned id is what unifi_protect_update_viewer needs to put a layout on a screen. |
| unifi_protect_check_settingsA | Check every camera and the console for settings that are inconsistent, or that mean the system is not doing what someone believes it is. Finds detectors that look enabled but are gated off, cameras keeping no footage, offline devices, motion detection switched off, and storage about to stop recording. This is the tool for "are my camera settings correct" — the checks encode traps that are invisible in the Protect UI, notably a detection zone asking for an object type the device list blocks. Read-only: it reports findings and names the tool that would fix each one, and changes nothing. |
| unifi_protect_list_camerasA | List every camera on the console with its id, name, connection state, recording mode, firmware and what it can do (PTZ, package camera, smart detection, and which object types it detects). Returns a summary rather than the console's full camera record, which runs to thousands of fields across encoder profiles, zones and feature flags — use unifi_protect_get_camera when you need all of it for one camera. |
| unifi_protect_get_cameraA | Get one camera's complete record — every setting the console holds, including encoder channels, motion and smart-detection zones, privacy masks, OSD and LED settings, ISP tuning and live statistics. This is large (roughly 8-15 KB of JSON). Prefer unifi_protect_list_cameras unless you specifically need a field it does not carry. |
| unifi_protect_get_camera_snapshotA | Capture a still frame from a camera as it looks right now. Writes the JPEG to disk and returns its path, size and content type by default. Set output="image" to get the frame inline instead so a vision model can actually look at it — that costs roughly 300,000 to 700,000 characters of context per call, so choose it deliberately rather than by default. A fresh capture is forced; without that the console can hand back a cached frame that is minutes old. |
| unifi_protect_list_ptz_presetsA | List a PTZ camera's saved preset positions, with the slot number each one lives at. Only meaningful for cameras reporting hasPtz: true in unifi_protect_list_cameras. There is no tool to MOVE a PTZ camera or run a patrol: those commands exist only on Ubiquiti's official Integration API (a separate X-API-KEY auth this server does not use), not on the private API this server wraps — presets are created and driven from the Protect app itself. |
| unifi_protect_list_ptz_patrolsA | List a PTZ camera's saved patrol routes. See unifi_protect_list_ptz_presets for why there is no tool to start or stop one. |
| unifi_protect_list_eventsA | Search recorded events over any time range — motion, smart detections (person, vehicle, animal, package, licence plate), doorbell rings, and camera connection changes. This is the tool for questions like "what happened at the front door last night". Each result carries its camera's NAME as well as its id, so no second lookup is needed. Times may be given in the console's own local clock ("1am"), which is what a question about last night means. READ ANY |
| unifi_protect_get_eventA | Get one event's full record, including detection metadata the search results leave out — per-object tracking, detected zones, licence plate text and vehicle attributes where the camera captured them. Use the |
| unifi_protect_get_event_thumbnailA | Fetch the still image Protect captured for an event — the frame that triggered the detection. Writes it to disk and returns the path by default; set output="image" to return it inline for a vision model to look at, which costs a large amount of context. Pass the event's |
| unifi_protect_get_event_thumbnailsA | Fetch the still frames for SEVERAL events at once and return them inline to look at. This is the tool for answering who or what was actually there, and it matters most when a camera has no smart detection: motion events carry no classification, so the only way to tell a person from a branch is to look. Prefer this over calling unifi_protect_get_event_thumbnail repeatedly. Costs roughly 1-2K tokens per image, so it is capped at 6 — pick the events worth seeing from unifi_protect_list_events rather than sweeping a whole night. Events that have no thumbnail are reported by id instead of failing the call. |
| unifi_protect_export_videoA | Export recorded footage from one camera over a time range as an MP4 file on disk. Always writes to a file and returns the path — video is never returned inline. Size grows quickly with the window: expect tens of megabytes per minute at full quality, and the call fails rather than exhausting memory if the export exceeds UNIFI_PROTECT_MAX_DOWNLOAD_BYTES. Footage only exists if the camera was recording at the time, so check the recording mode before concluding that nothing happened. |
| unifi_protect_list_lightsA | List UniFi Protect floodlights with their connection state, whether the light is currently on, whether PIR motion is being detected, and brightness. |
| unifi_protect_list_sensorsA | List UniFi Protect sensors with their current readings — temperature, humidity, light level — plus open/closed state, motion, and battery percentage. The readings are lifted out of the console's per-metric history arrays, which are far larger than the values themselves. |
| unifi_protect_list_viewersA | List UniFi Protect Viewport devices and which live view each is currently displaying. |
| unifi_protect_list_chimesA | List UniFi Protect chimes, their volume, and which doorbell cameras each is paired to. |
| unifi_protect_requestA | Escape hatch: call any private Protect API endpoint directly, relative to /proxy/protect/api. This exists because the private API is undocumented and Ubiquiti moves endpoints between Protect releases — when a wrapped tool starts returning 404, this reaches the replacement without waiting for a new version of this server. Responses are returned RAW and unshaped, so a broad endpoint like |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| check_camera_settings | Audit every camera for inconsistent or self-defeating settings, and explain what is worth changing. Read-only. |
| who_passed | Find out who or what was present at a place during a time window, falling back to motion frames on cameras whose detectors are off. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| console | The NVR: model, Protect version, storage, and the TIME ZONE every local time in this system is expressed in. Read this before interpreting a question about a wall-clock hour such as "last night between 1am and 6am". |
| cameras | Every camera with the object types it will ACTUALLY detect, what its zones ask for, and where the two disagree. A camera whose `blocked` list is non-empty cannot match a search for those types no matter how the query is written. |
| locations | Named groups of cameras, so a question about a PLACE can be turned into camera ids. The console has no concept of location, so this is local knowledge from UNIFI_PROTECT_LOCATIONS. If it is empty, ask which cameras cover the area rather than guessing from names. |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mgcrea/mcp-unifi-protect'
If you have feedback or need assistance with the MCP directory API, please join our Discord server