UniFi Access MCP — Claude Code MCP server for door access
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.
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-mcpWhat UniFi Access MCP 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.
What it helps with
- 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 for the agent
- 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
How to install UniFi Access MCP
Platform CLI
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-mcpReplace <…> 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>
Platform CLI
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-mcpReplace <…> 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>
Config file
{
"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>
Config file
{
"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>
Platform CLI
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-mcpReplace <…> 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>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about UniFi Access MCP
How do I install UniFi Access MCP in Claude Code?
Add the plugin marketplace with /plugin marketplace add sirkirby/unifi-mcp, then install the plugin: /plugin install unifi-access@unifi-plugins. Run /unifi-access:unifi-access-setup afterwards and start a new Claude session.
What does UniFi Access MCP do?
It gives an AI agent access to a UniFi Access controller: doors, devices, credentials, policies, visitors and events. Reads are immediate, mutations go through preview and confirmation.
What does the server need to run?
A controller host and at least one auth path. An API key covers reads and device listing, while door control and pass management need a local session with an admin username and password.