# UniFi Access MCP

An MCP server that hands your AI agent the doors, passes, policies and event log of a UniFi Access controller. Reads run freely, changes wait for confirmation.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 946
- Author: sirkirby
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/sirkirby/unifi-mcp/tree/HEAD/apps/access
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/mcp/unifi-access-mcp

## What it does

The server exposes UniFi Access tools to an agent: doors and devices, credentials, access policies, visitor passes, and the event feed. Read queries go through right away. Anything that changes state — unlocking a door, editing a credential, issuing a pass — goes through preview and confirm first, so a stray tool call cannot open a door on its own.

Authentication runs on two paths. An API key talks to the dedicated Access port (12445 by default) and covers read-only work plus device listing. Unlocking doors, managing credentials, policies, visitors and events needs a local proxy session, which logs in through `/api/auth/login` on port 443. One path is enough to start, but without the local session most mutating tools stay out of reach.

In Claude the plugin brings the server itself, a skill for tool discovery, and a guided setup command. Credentials arrive as a file or command provider rather than being typed into chat; a password or key saved as an option lands in the system keychain. Options apply across every project, so start a fresh Claude session afterwards. With no controller host set, the server still comes up in setup mode: it tells the client what to fill in and offers only the read-only `access_setup_status` tool.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `UNIFI_HOST`, `UNIFI_USERNAME`, `UNIFI_PASSWORD`, `UNIFI_API_KEY`, `UNIFI_PORT`, `UNIFI_VERIFY_SSL` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env UNIFI_HOST=<UNIFI_HOST> --env UNIFI_USERNAME=<UNIFI_USERNAME> --env UNIFI_PASSWORD=<UNIFI_PASSWORD> --env UNIFI_API_KEY=<UNIFI_API_KEY> --env UNIFI_PORT=<UNIFI_PORT> --transport stdio access -- uvx unifi-access-mcp
```
Replace <…> with your own values. 1 more environment variable is in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from unifi-access-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add access --env UNIFI_HOST=<UNIFI_HOST> --env UNIFI_USERNAME=<UNIFI_USERNAME> --env UNIFI_PASSWORD=<UNIFI_PASSWORD> --env UNIFI_API_KEY=<UNIFI_API_KEY> --env UNIFI_PORT=<UNIFI_PORT> -- uvx unifi-access-mcp
```
Replace <…> with your own values. 1 more environment variable is in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from unifi-access-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "access": {
            "command": "uvx",
            "args": [
                "unifi-access-mcp"
            ],
            "env": {
                "UNIFI_HOST": "<UNIFI_HOST>",
                "UNIFI_USERNAME": "<UNIFI_USERNAME>",
                "UNIFI_PASSWORD": "<UNIFI_PASSWORD>",
                "UNIFI_API_KEY": "<UNIFI_API_KEY>",
                "UNIFI_PORT": "<UNIFI_PORT>"
            }
        }
    }
}
```
Replace <…> with your own values. 1 more environment variable is in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from unifi-access-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "access": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "unifi-access-mcp"
            ],
            "env": {
                "UNIFI_HOST": "<UNIFI_HOST>",
                "UNIFI_USERNAME": "<UNIFI_USERNAME>",
                "UNIFI_PASSWORD": "<UNIFI_PASSWORD>",
                "UNIFI_API_KEY": "<UNIFI_API_KEY>",
                "UNIFI_PORT": "<UNIFI_PORT>"
            }
        }
    }
}
```
Replace <…> with your own values. 1 more environment variable is in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from unifi-access-mcp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e UNIFI_HOST=<UNIFI_HOST> -e UNIFI_USERNAME=<UNIFI_USERNAME> -e UNIFI_PASSWORD=<UNIFI_PASSWORD> -e UNIFI_API_KEY=<UNIFI_API_KEY> -e UNIFI_PORT=<UNIFI_PORT> access uvx unifi-access-mcp
```
Replace <…> with your own values. 1 more environment variable is in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from unifi-access-mcp <command>

## When to use it
- see who badged into the office today
- list credentials expiring within the next month
- spot failed badge attempts at the server room
- issue a visitor pass for a set time window
- check which doors open outside business hours

## Example prompts
- Who badged into the office today? Show me the full door event timeline
- List every access credential expiring in the next 30 days
- Create a visitor pass for John Smith at the main entrance, 9 AM to 5 PM tomorrow

## Similar
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [Oh My Posh Validator](https://affpapa.org/en/nevibecode/mcp/oh-my-posh-validator.md) — MCP server · ★ 23643
- [Keploy](https://affpapa.org/en/nevibecode/mcp/keploy.md) — MCP server · ★ 18727
- [Coder](https://affpapa.org/en/nevibecode/mcp/coder.md) — MCP server · ★ 17160
- [mcp](https://affpapa.org/en/nevibecode/mcp/kubeshark-mcp.md) — MCP server · ★ 12109

From the same set: [sirkirby/unifi-mcp](https://affpapa.org/en/nevibecode/by/sirkirby/unifi-mcp.md) — 3 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
