UniFi Access MCP

io.github.sirkirby由 GitHub 帳號 sirkirby 發布v0.1.6更新於 Oct 24, 2026

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

概覽

AI 產生的概覽

面向 UniFi Access 控制器的 MCP 伺服器,讓助理檢視門禁、憑證、原則、訪客、事件與裝置,並在確認後執行開門與憑證變更。

可以做什麼
  • 列出並檢視門、門組與即時門狀態,執行上鎖或解鎖
  • 列出、檢視並更新門禁原則與時程
  • 列出、檢視、建立與撤銷 NFC 卡、PIN、行動憑證等憑證
  • 列出、檢視、建立與刪除具時間限制的訪客通行證
  • 查詢歷史門禁事件、即時 websocket 緩衝與活動摘要
  • 列出並檢視裝置,重新啟動門禁中樞、讀卡機、繼電器與對講機,讀取控制器資訊與健康指標
適用情境
適合讓助理回答誰今天刷卡進入、失敗刷卡紀錄、即將到期的憑證或非上班時間門禁原則等問題,或為 UniFi Access 部署簽發訪客通行證、控制門鎖。預設為唯讀,變更操作採先預覽後確認流程。
執行需求
以 stdio 在本機執行,可從 PyPI(uvx 或 pip)或 Docker 安裝。需要可連線的 UniFi Access 控制器:UNIFI_HOST(或 UNIFI_ACCESS_HOST)、UNIFI_USERNAME 與 UNIFI_PASSWORD,選用 UNIFI_API_KEY、UNIFI_PORT、UNIFI_VERIFY_SSL。至少須設定一種驗證方式,多數變更工具需要本機代理工作階段。未設定主機時進入設定模式,僅提供狀態工具。
安裝前請注意
需要控制器管理員憑證,屬機密資訊;README 建議以檔案或指令提供,而非在對話中輸入。變更工具可解鎖或上鎖、建立或撤銷憑證與訪客通行證、修改原則並重新啟動裝置。憑證 token 與 PIN 預設會遮蔽,可用 UNIFI_ACCESS_REDACT_SENSITIVE_FIELDS 關閉。可停用 SSL 驗證,會降低連線安全性。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 UniFi Access MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

UniFi Access MCP Server

[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.

[License: MIT] [Python 3.13+]

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:

bash
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

bash
# PyPIuvx unifi-access-mcp@latest# or: pip install unifi-access-mcp
# Dockerdocker pull ghcr.io/sirkirby/unifi-access-mcp:latest
# From sourcegit clone https://github.com/sirkirby/unifi-mcp.gitcd 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.

bash
# Server-specific variables (recommended)UNIFI_ACCESS_HOST=192.168.1.1      # Controller IP or hostnameUNIFI_ACCESS_USERNAME=admin         # Local admin usernameUNIFI_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.

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, 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

bash
# stdio transport (default -- for Claude Desktop, LM Studio, etc.)unifi-access-mcp
# Dockerdocker 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:

jsonc
{  "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

bash
cd apps/accessmake test         # Run testsmake lint         # Lintmake format       # Formatmake manifest     # Regenerate tools_manifest.jsonmake console      # Start interactive dev consolemake pre-commit   # All of the above

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

License

MIT

來源:apps/access/README.md,提交 f525cbd

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.6最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分