UniFi Access

Developer tools

Manage UniFi Access doors, credentials, policies, visitors, and events via MCP.

Your AI app calls the UniFi Access MCP server, which does the developer tools work and sends the result back to the chat.

About UniFi Access

UniFi Access is a community MCP server from sirkirby, filed in our directory under developer tools. Manage UniFi Access doors, credentials, policies, visitors, and events via MCP.

UniFi Access runs on your own machine: your AI app starts it with the command uvx unifi-access-mcp==0.1.6 and talks to it over standard input and output. It needs UNIFI_HOST, UNIFI_USERNAME and UNIFI_PASSWORD set before UniFi Access starts.

UniFi Access is listed in the official MCP registry as io.github.sirkirby/unifi-access-mcp, version 0.1.6.

At a glance

Publisher
sirkirby (community)
Runs
Locally on your machine
Install from
Python package on PyPI: unifi-access-mcp
Written in
Python
License
MIT
GitHub stars
1,174
Official MCP registry
io.github.sirkirby/unifi-access-mcp

How to set up UniFi Access

  1. Install uv on the machine that runs your AI app, because UniFi Access starts with uvx and fetches its Python package on first run.
  2. Create UNIFI_HOST, UNIFI_USERNAME and UNIFI_PASSWORD for UniFi Access in the connected service's own settings, scoped to the smallest permissions the job needs.
  3. Add UniFi Access to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the UniFi Access tools to confirm the connection.
  5. Run one read-only task with UniFi Access first, and keep your app asking before each tool call until the results look right.

UniFi Access compared with similar servers

  • UniFi Network by sirkirby has fewer GitHub stars than UniFi Access (1.2k against 1.2k); both are community servers, and both run locally.
  • CloudBase by TencentCloudBase has more GitHub stars than UniFi Access (1.2k against 1.2k); both are community servers, and both run locally.
  • UniFi Protect by sirkirby has fewer GitHub stars than UniFi Access (1.2k against 1.2k); both are community servers, and both run locally.

Before you connect UniFi Access

  • Give UniFi Access its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each UniFi Access tool call until you trust what it does with them.
  • Treat text that UniFi Access fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for UniFi Access on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for UniFi Access

How marketing and sales teams put UniFi Access to work, by company size. Pick the size closest to yours and start UniFi Access on one use case.

Small business

  • A small business with a developer can use UniFi Access to ship site and tracking fixes faster, with the AI reading the code it changes.
  • Technical founders can ask UniFi Access to explain and fix a marketing site issue without context switching between tools.
  • UniFi Access runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Growth engineers can use UniFi Access to build landing pages, tracking and integrations in fewer cycles, with reviews kept in the normal flow.
  • Marketing ops engineers can connect UniFi Access to keep scripts and automations documented and versioned as they change.
  • Start UniFi Access on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprise engineering teams can roll out UniFi Access with repo scopes and audit logs, so agents work only where they are allowed.
  • Platform teams can standardize on UniFi Access so web and marketing engineering share one reviewed way of working with AI.
  • UniFi Access is a community server, so have security review the code and pin a version before UniFi Access touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

UniFi Access README

From sirkirby/unifi-mcp on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

UniFi Access MCP Server

MCP server exposing UniFi Access tools for AI assistants and other MCP-capable clients. Manage doors, credentials, access policies, visitors, events, and devices with safe-by-default permissions and preview-before-confirm for all mutations.

Software integrating over HTTP, including automation services and MCP adapters, should use unifi-api-server for REST and GraphQL reads, actions, and SSE events.

Install

Claude Code (recommended)

The plugin installs the MCP server, an agent skill for tool discovery, and a guided setup command:

/plugin marketplace add sirkirby/unifi-mcp
/plugin install unifi-access@unifi-plugins

Then run the interactive setup to configure your controller connection:

/unifi-access:unifi-access-setup

This walks you through connecting to your Access controller, explains the dual-auth system (API key for reads, username/password for mutations), and configures permissions. Credentials are given as a file or command provider, never typed into chat. Setup saves the result as the plugin's Claude Code options, which apply in every project; a password or API key entered as an option is stored in the system keychain. Start a new Claude Code session after setup to connect.

Upgrading from a plugin version before 1.0.0, which kept settings in the project's .claude/settings.local.json? Follow the plugin upgrade guide.

Codex

Register the marketplace, then install unifi-access from Codex's /plugins UI:

codex plugin marketplace add sirkirby/unifi-mcp

After installing, ask Codex to use the UniFi Access setup skill. Setup saves a version-pinned MCP server entry with your controller settings in Codex's config.toml and prompts you to restart Codex. After each plugin upgrade, re-run setup with --refresh.

PyPI / Docker
# PyPI
uvx unifi-access-mcp@latest
# or: pip install unifi-access-mcp

# Docker
docker pull ghcr.io/sirkirby/unifi-access-mcp:latest

# From source
git clone https://github.com/sirkirby/unifi-mcp.git
cd unifi-mcp && uv sync

Usage Examples

Once connected, just ask your AI agent in natural language:

"Who badged into the office today? Show me a timeline of all door access events"

"List all access credentials that expire in the next 30 days"

"Show me failed badge attempts at the server room this week, any patterns?"

"Which doors had the most access events today?"

"Create a visitor pass for John Smith with access to the main entrance from 9 AM to 5 PM tomorrow"

"Audit door policies, which doors allow access outside business hours?"

All queries are read-only by default. Mutations (visitor passes, credential changes, door controls) use a preview-then-confirm flow.

Configure

Set these variables in the server's process environment. The plugin setup skill already does this for Codex and OpenClaw; in Claude Code the plugin maps its options onto these variables. The server does not automatically load .env or working-directory YAML files; load a trusted env file explicitly in your launcher (Docker env_file: is supported), or select custom YAML with an absolute CONFIG_PATH. See configuration for migration examples.

With no controller host configured, the server still starts in setup mode: it tells the client how to configure it, offers only the read-only access_setup_status tool, and makes no controller connections.

# Server-specific variables (recommended)
UNIFI_ACCESS_HOST=192.168.1.1      # Controller IP or hostname
UNIFI_ACCESS_USERNAME=admin         # Local admin username
UNIFI_ACCESS_PASSWORD=your-password # Admin password
# Optional:
# UNIFI_ACCESS_API_KEY=             # Official UniFi API key (dual auth)
# UNIFI_ACCESS_PORT=443             # Controller HTTPS port
# UNIFI_ACCESS_VERIFY_SSL=false     # SSL certificate verification
# UNIFI_ACCESS_SSL_FINGERPRINT=      # Pin the controller certificate by SHA-256

Fallback: The shared UNIFI_* variables (e.g., UNIFI_HOST) also work. The server checks for UNIFI_ACCESS_* 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. On newer server releases, the shared username, password and API key are used only when UNIFI_ACCESS_HOST is unset or names the same console as UNIFI_HOST; a server pointed at another console needs its own UNIFI_ACCESS_* credentials (see Configuration).

MCP response size

For tool results that already provide structured output, adaptive is the default response mode. It classifies each request by the canonical date-based protocolVersion advertised during MCP initialization, not by the client's product name or application version. Requests advertising MCP 2025-06-18 or later receive concise content plus the full result once in structuredContent; requests advertising an earlier revision (such as 2024-11-05 or 2025-03-26), or whose revision metadata is missing or malformed, keep full compatibility JSON in content. Set UNIFI_ACCESS_MCP_CONTENT_MODE to compat to force the duplicated compatibility form, or to compact to force concise text plus full structured output outside a negotiated request. This server-specific variable overrides UNIFI_MCP_CONTENT_MODE; use compat for any client that consumes the full result only from content, regardless of its advertised revision.

The lazy-loading meta-tools (*_tool_index, *_execute, *_batch, *_batch_status, *_batch_cancel, and lazy-only *_load_tools) remain content-only; they are not the pre-2025-06-18 protocol category described above. For structured inner results, *_execute and *_batch_status expose one normalized JSON payload in content rather than a nested transport pair; content-only execute results remain unchanged. Response modes do not convert these meta-tools to structuredContent.

When Network is enabled alongside Access, its largest source responses are independently bounded: unifi_get_dashboard defaults to summary=true, and unifi_list_rogue_aps defaults to a summarized page of at most 100 records; summary=false restores the full selected data.

Dual Authentication

The Access server supports two independent auth paths:

  1. API key -- Uses py-unifi-access on the dedicated Access API port (default 12445). Best for read-only queries and device listing.
  2. Local proxy session -- Logs in via /api/auth/login on the UniFi OS Console (port 443) and proxies requests through /proxy/access/api/v2/.... Required for door lock/unlock, credential management, policies, visitors, and events.

At least one path must be configured. When both are available, each tool selects the most appropriate path. Most mutating tools require the local proxy session.

Secret redaction

Access tools redact credential secrets by default before returning data to MCP clients, credential token and pin_code values surface as ***REDACTED*** in reads, lists, and create previews. Disable redaction for a trusted local administration process with UNIFI_ACCESS_REDACT_SENSITIVE_FIELDS=false or the global UNIFI_REDACT_SENSITIVE_FIELDS=false policy flag when raw values are required. To preserve an existing secret on an update, omit the field rather than passing the ***REDACTED*** marker back (which is rejected).

Run

# stdio transport (default -- for Claude Desktop, LM Studio, etc.)
unifi-access-mcp

# Docker
docker run -i --rm \
  -e UNIFI_ACCESS_HOST=192.168.1.1 \
  -e UNIFI_ACCESS_USERNAME=admin \
  -e UNIFI_ACCESS_PASSWORD=secret \
  ghcr.io/sirkirby/unifi-access-mcp:latest
Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "unifi-access": {
      "command": "uvx",
      "args": ["unifi-access-mcp"],
      "env": {
        "UNIFI_ACCESS_HOST": "192.168.1.1",
        "UNIFI_ACCESS_USERNAME": "admin",
        "UNIFI_ACCESS_PASSWORD": "your-password"
      }
    }
  }
}

Features

  • Doors -- list, inspect, lock/unlock, door groups, real-time status
  • Policies -- list, inspect, update access policies and schedules
  • Credentials -- list, inspect, create, revoke NFC cards, PINs, mobile credentials
  • Visitors -- list, inspect, create, delete visitor passes with time-bounded access
  • Events -- query historical events, real-time websocket buffer, activity summaries
  • Devices -- list, inspect, reboot access hubs, readers, relays, intercoms
  • System -- controller info, health metrics, user listing

Agent Skills

The Claude Code plugin ships with agent skills that teach AI assistants how to work with Access effectively:

  • UniFi Access, core skill for door control, credentials, visitors, access policies, and event monitoring. Includes guidance on the dual-auth system, real-time event streaming via WebSocket buffer, and the preview-confirm flow for physical door operations.
  • Setup, interactive configuration wizard that walks through controller connection, credential setup, and permission configuration.

Skills are automatically available when the plugin is installed.

Cross-Product Skills

When the Access plugin is installed alongside the Protect plugin, the security-digest skill can incorporate door events into its analysis. Badge-ins, access-denied events, and after-hours access are correlated with camera motion and alerts from Protect to produce a richer security summary across your full UniFi deployment.

No additional configuration is required, if both plugins are active, the skill automatically pulls from both servers.

Documentation

Development

cd apps/access
make test         # Run tests
make lint         # Lint
make format       # Format
make manifest     # Regenerate tools_manifest.json
make console      # Start interactive dev console
make pre-commit   # All of the above

See the root CONTRIBUTING.md for the full monorepo workflow.

License

MIT

Questions about UniFi Access

What is the UniFi Access MCP server?

Manage UniFi Access doors, credentials, policies, visitors, and events via MCP. UniFi Access is maintained by sirkirby on GitHub at sirkirby/unifi-mcp, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the UniFi Access MCP server?

Add UniFi Access to your AI app's MCP config with the command uvx unifi-access-mcp==0.1.6. In Claude Code, run claude mcp add --transport stdio sirkirby-access -- uvx unifi-access-mcp==0.1.6. To run UniFi Access this way you need uv installed.

Does UniFi Access need an API key?

Yes. UniFi Access expects UNIFI_HOST, UNIFI_USERNAME and UNIFI_PASSWORD to be set. Create the key for UniFi Access in the connected service's own settings, give it the smallest permissions the job needs, and keep it out of shared config files.

Is UniFi Access an official MCP server?

No. UniFi Access is a community server maintained by sirkirby. Community servers can be excellent; read the code and the open issues before you give UniFi Access access to company data.

What license is UniFi Access under?

UniFi Access is released under the MIT license, according to its GitHub repository. The license covers the code of UniFi Access; the service it connects to has its own terms.