UniFi Access MCP Server
Project description
UniFi Access MCP Server
MCP server exposing UniFi Access tools for LLMs, agents, and automation platforms. Manage doors, credentials, access policies, visitors, events, and devices -- with safe-by-default permissions and preview-before-confirm for all mutations.
Install
# PyPI (recommended)
uvx unifi-access-mcp
# 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
Configure
Set these environment variables (or create a .env file):
# 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
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.
Dual Authentication
The Access server supports two independent auth paths:
- API key -- Uses
py-unifi-accesson the dedicated Access API port (default 12445). Best for read-only queries and device listing. - Local proxy session -- Logs in via
/api/auth/loginon 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.
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
Documentation
- Configuration -- Full env var reference, YAML config, Access-specific options
- Permissions -- Permission system, category defaults, how to enable mutations
- Tool Catalog -- All 29 tools organized by category
- Event Streaming -- Real-time event architecture, WebSocket buffer, polling
- Troubleshooting -- Connection issues, dual auth debugging, missing tools
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
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_access_mcp-0.1.0.tar.gz.
File metadata
- Download URL: unifi_access_mcp-0.1.0.tar.gz
- Upload date:
- Size: 43.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff88d2866bc241291a652124a17c640ea594383ef33a9b70acb11e588e23fdff
|
|
| MD5 |
3a447b348485c2cfed8dca8b5794448f
|
|
| BLAKE2b-256 |
bd27253329397d401d2679dc79d4035d8e0ce25bf8854204fb5835ad69391893
|
Provenance
The following attestation bundles were made for unifi_access_mcp-0.1.0.tar.gz:
Publisher:
publish-access.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_access_mcp-0.1.0.tar.gz -
Subject digest:
ff88d2866bc241291a652124a17c640ea594383ef33a9b70acb11e588e23fdff - Sigstore transparency entry: 1118708572
- Sigstore integration time:
-
Permalink:
sirkirby/unifi-mcp@4bce6986f073c4efbb92a872e4101018da61d5b7 -
Branch / Tag:
refs/tags/access/v0.1.0 - Owner: https://github.com/sirkirby
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-access.yml@4bce6986f073c4efbb92a872e4101018da61d5b7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file unifi_access_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: unifi_access_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 62.4 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 |
26f6181a643f44792f17277d89e4b51a5685ce649f2ae63c00809c98d754b8f4
|
|
| MD5 |
c6b016c56dfa87eb827685f73fd83a7b
|
|
| BLAKE2b-256 |
ae174b4b1a553f460864a5d724c466d07141130fa7dd86b8273a3b0a652a4e33
|
Provenance
The following attestation bundles were made for unifi_access_mcp-0.1.0-py3-none-any.whl:
Publisher:
publish-access.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_access_mcp-0.1.0-py3-none-any.whl -
Subject digest:
26f6181a643f44792f17277d89e4b51a5685ce649f2ae63c00809c98d754b8f4 - Sigstore transparency entry: 1118708616
- Sigstore integration time:
-
Permalink:
sirkirby/unifi-mcp@4bce6986f073c4efbb92a872e4101018da61d5b7 -
Branch / Tag:
refs/tags/access/v0.1.0 - Owner: https://github.com/sirkirby
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-access.yml@4bce6986f073c4efbb92a872e4101018da61d5b7 -
Trigger Event:
release
-
Statement type: