# UniFi — how to use (mcp.ai)

Connect your UniFi account and use 9 tools for internet of things straight from your AI agent. Connect with your own API key. Monitor UniFi Site Manager inventory, internet health metrics, and SD-WAN configurations across the connected UI account's sites. This toolkit excludes arbitrary Cloud Connector requests and all local Network, Protect, Mobility, Carrier Fabric, and InnerSpace API surfaces.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_unifi?ms=1787296080000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `unifi_get_host`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/unifi`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/unifi/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/unifi/get/host` — Get detailed information for one UniFi host by the Site Manager host ID returned by List Hosts.
  - body: { host_id: string }
- `POST https://api.mcp.ai/api/unifi/get/isp/metrics` — Get ISP performance metrics for all accessible sites, optionally limited by a relative duration or explicit timestamp bounds.
  - body: { duration?: string, interval: string, end_timestamp?: string, begin_timestamp?: string }
- `POST https://api.mcp.ai/api/unifi/get/sd/wan/config` — Get the topology and settings of one SD-WAN configuration by ID.
  - body: { config_id: string }
- `POST https://api.mcp.ai/api/unifi/get/sd/wan/config/status` — Get deployment, generation, WAN, tunnel, warning, and error status for one SD-WAN configuration.
  - body: { config_id: string }
- `POST https://api.mcp.ai/api/unifi/list/devices` — List UniFi devices managed by hosts where the connected UI account is an owner or super admin. Results are grouped by host and can be filtered by host ID or by the last processed device timestamp.
  - body: { host_ids?: string[], page_size?: integer, next_cursor?: string, updated_after?: string }
- `POST https://api.mcp.ai/api/unifi/list/hosts` — List UniFi hosts associated with the connected UI account. Use the returned host IDs with device filters, site metrics, and host detail tools.
  - body: { page_size?: integer, next_cursor?: string }
- `POST https://api.mcp.ai/api/unifi/list/sd/wan/configs` — List the SD-WAN configurations associated with the connected UI account.
- `POST https://api.mcp.ai/api/unifi/list/sites` — List sites from UniFi Network applications associated with the connected UI account. Use returned host and site IDs for selected-site ISP metrics.
  - body: { page_size?: integer, next_cursor?: string }
- `POST https://api.mcp.ai/api/unifi/query/isp/metrics` — Get ISP performance metrics for selected host/site pairs. Each site can specify its own RFC3339 time bounds. Always inspect partial_success, status, and message: UniFi can return usable metrics for on
  - body: { sites: object[], interval: string }

## Example prompts
- "What can I do in UniFi?"
- "Show me a summary of my UniFi account"

## More
- Page: https://mcp.ai/unifi
- Agent spec (llms.txt): https://mcp.ai/unifi/llms.txt
- Postman collection: https://mcp.ai/unifi/postman.json
