UniFi Fabric MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MCP_TLS_MODE | No | none, https, or mtls. | none |
| MCP_AUTH_MODE | No | none, bearer, or oauth. Unset resolves to bearer when MCP_BEARER_TOKEN is set, else none. | unset |
| UNIFI_API_KEY | No | Single API key shorthand. Required if UNIFI_API_KEYS is not set. | |
| UNIFI_API_KEYS | No | JSON list of key configs for multi-console MSP setups. | [] |
| MCP_TLS_KEYFILE | No | Server private key path. Required for https/mtls. | |
| UNIFI_LOG_LEVEL | No | Logging verbosity. Accepts DEBUG, INFO, WARNING, ERROR, CRITICAL. | INFO |
| MCP_BEARER_TOKEN | No | Shared secret for bearer mode. | |
| MCP_OAUTH_ISSUER | No | OAuth issuer URL. Required for oauth. | |
| MCP_TLS_CA_CERTS | No | Client CA bundle for verifying client certs. Required for mtls. | |
| MCP_TLS_CERTFILE | No | Server certificate path. Required for https/mtls. | |
| FASTMCP_TRANSPORT | No | Sets the communication protocol between the MCP server and clients. | streamable-http |
| MCP_TLS_CERT_REQS | No | Client-cert verification level for mtls: none, optional, or required. | |
| MCP_OAUTH_AUDIENCE | No | Expected token audience. Required for oauth. | |
| MCP_OAUTH_BASE_URL | No | Public base URL of this resource server. Required for oauth. | |
| MCP_OAUTH_JWKS_URI | No | JWKS URI for signature verification. Required for oauth. | |
| UNIFI_API_BASE_URL | No | UniFi Site Manager API base URL. | https://api.ui.com |
| MCP_OAUTH_ALGORITHM | No | JWT signing algorithm to accept. | RS256 |
| MCP_TLS_KEY_PASSWORD | No | Password for an encrypted private key. Optional. | |
| UNIFI_CACHE_MAX_HOSTS | No | Max entries in the hosts TTLCache. | 512 |
| UNIFI_CACHE_MAX_SITES | No | Max entries in the per-console sites TTLCache. | 2048 |
| UNIFI_MAX_CONCURRENCY | No | Max concurrent outbound requests to api.ui.com. | 10 |
| UNIFI_CACHE_TTL_SECONDS | No | TTL for host/site registry cache (seconds). | 900 |
| UNIFI_PAGINATE_MAX_PAGES | No | Hard cap on pages drained per call. Default is unlimited. | None |
| MCP_OAUTH_REQUIRED_SCOPES | No | Comma-separated scopes a token must carry. | |
| UNIFI_ENABLE_MOBILITY_WRITE | No | Enable guarded Mobility write tools. Fail-closed: default OFF. | false |
| UNIFI_ENABLE_CONNECTOR_WRITE | No | Enable the mutating generic connector relay. Fail-closed: default OFF. | false |
| UNIFI_REQUEST_TIMEOUT_SECONDS | No | HTTP request timeout in seconds. | 30 |
| MCP_OAUTH_AUTHORIZATION_SERVERS | No | Comma-separated authorization-server URLs. Defaults to [MCP_OAUTH_ISSUER]. | |
| UNIFI_PROTECT_MUTATIONS_ENABLED | No | Deployment-level kill switch for all Protect mutation and physical-action tools. Default ON. | true |
| UNIFI_ENABLE_CARRIER_FABRIC_WRITE | No | Enable guarded Carrier / ISP Fabric write tools. Fail-closed: default OFF. | false |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
UniFi Fabric manages UniFi infrastructure via Site Manager/Fabric. list_hosts discovers consoles; host is reportedState.hostname/name or composite id. Use site names: list_sites has Fabric ids, list_local_sites Network UUIDs. Ambiguous names fail with choices. Devices are infrastructure; clients are end-user devices. Read schemas for ids, time units and body shapes; Shape aliases end in "where T1=...". Use zone-based firewall policies unless the user asks for ACL/classic rules. list_firewall_zones_proxy discovers zones; ports use destination.trafficFilter. Fetch before full PUT; deletes and physical actions may be irreversible. UNIFI_FAMILY_ALLOW and UNIFI_EXCLUDE select tools. Writes default to allowed. UNIFI_WRITE_POLICY=deny hides writes except fabric_connector_get; state-changing GETs fail. UNIFI_WRITE_EXCEPTIONS family:ID=deny hides writes for: network, protect, mobility, carrier, innerspace and connector. Network includes firewall, clients, devices, vpn, hotspot and statistics; connector includes typed relays. Other denies refuse calls. A dry-run policy previews writes unsent; reads may occur. UNIFI_REDACT_SECRETS is opt-in; previews may contain secrets. List pagination drains all pages; UNIFI_PAGINATE_MAX_PAGES caps with incomplete=true. Read schemas for page bases; continue with returned cursor, offset, _continuation or _nextPage. Multi-key org cursors need key_label; unscoped lists report per-key failures. Bodies and error reasons are preserved; relay 4xx/5xx are errors. Never swallow failures or infer unsupported from one error. See docs/TOOLS.md and docs/TOOL-USAGE.md. Current deployment: UNIFI_WRITE_POLICY=allow. Discovery mode: search_tools finds enabled tools; describe_tool gives exact schemas. Execute via call_read_tool or call_write_tool. Enabled families (counts): carrier: 11; clients: 15; connector: 5; devices: 39; firewall: 33; hotspot: 4; innerspace: 32; mobility: 8; network: 345; protect: 225; site_manager: 20; statistics: 19; vpn: 42. list_tool_families lists the families again.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": true
} |
| resources | {
"subscribe": false,
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| search_toolsA | Find enabled tools by intent, ranked over names, descriptions and parameter schemas. Default returns ten matches. Choose any positive limit, or null for every match; no tool or search result is hard-capped. more_available is true when the limit cut the list (total_matched gives the full count): raise the limit or refine. Empty query browses tools. Use describe_tool for the exact schema, then call_read_tool or call_write_tool. Enabled families (tool counts): carrier: 11; clients: 15; connector: 5; devices: 39; firewall: 33; hotspot: 4; innerspace: 32; mobility: 8; network: 345; protect: 225; site_manager: 20; statistics: 19; vpn: 42. |
| describe_toolB | Return the complete enabled tool schema, identical to its full-mode tools/list entry. |
| call_read_toolA | Execute a read tool with its original validation, guards, audit and result format. Refuses write calls, including state-changing routes of the mixed GET relay. Describe the target first; its schema and permissions apply. Read-only mode and secret scrubbing are preserved. |
| call_write_toolA | Execute a tool that may mutate live configuration through registered dispatch. Describe the target first. Target validation, per-area opt-outs, UNIFI_WRITE_POLICY=deny, OAuth permissions, dry-run, audit and secret scrubbing match a direct call. |
| list_tool_familiesA | List enabled families and counts; use their slugs as search_tools family filters. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| protect_consoles | JSON index of every console the configured API keys can see (list_hosts), each with its Protect resource URIs: events/recent, events/summary and cameras/snapshots. Start here to find the host value for the templates. Read at request time; never cached by the server. |
TDQS
Scored across 5 tools
The gateway flow is clear: discover (search_tools, list_tool_families), inspect (describe_tool), then execute (call_read_tool, call_write_tool). Minor overlap between search_tools and list_tool_families as discovery entry points, but the descriptions distinguish intent-ranked search from family-level browsing. The read/write split of the execution tools is cleanly disambiguated.
All names use snake_case with a verb_noun shape: call_read_tool, call_write_tool, describe_tool, search_tools, list_tool_families. The only deviation is that the two execution tools share a 'call_' prefix while describe_tool also acts on a tool, which slightly muddies the verb semantics but remains predictable.
Five facade tools are a well-scoped surface for a dispatcher fronting a very large registry (hundreds of underlying tools across 13 families). A meta-server should stay minimal, and each of these five earns its place: two discovery, one schema inspection, two execution.
The discover-inspect-execute lifecycle, family browsing, filtering, pagination via limits, and read/write separation with policy guards cover the gateway domain well. Gaps are minor: no bulk/batch invocation and no aggregated error or health inspection tool, but agents can work around these by chaining search_tools and describe_tool.