UniFi Network API MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@UniFi Network API MCP Server create 5 one-hour guest hotspot vouchers named lobby"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
UniFi Network API MCP Server
seva@sevatech.com
A Model Context Protocol (MCP) server that provides access to UniFi Network Controller API functionality.
Demo

Available Tools
Read Operations
application_info()- Get application version infosites()- List all sitesdevices(site_id)- List devices in a sitedevice_details(site_id, device_id)- Get device detailsdevice_statistics(site_id, device_id)- Get device statisticsclients(site_id)- List connected clientsclient_details(site_id, client_id)- Get client detailsvouchers(site_id)- List hotspot vouchers
Write Operations
Device Management
restart_device(site_id, device_id)- Restart a devicepower_cycle_port(site_id, device_id, port_idx)- Power cycle a PoE portsearch_devices(site_id, name_pattern, model, state)- Search devices with filters
Guest Management
authorize_guest(site_id, client_id, ...)- Authorize guest access with optional limitsunauthorize_guest(site_id, client_id)- Revoke guest access
Voucher Management
create_vouchers(site_id, name, time_limit_minutes, ...)- Create hotspot vouchersdelete_voucher(site_id, voucher_id)- Delete a voucher
Related MCP server: UniFi Network MCP Server
Installation
From Source
# Clone the repository
git clone https://github.com/yourusername/unifi_network_api_mcp.git
cd unifi_network_api_mcp
# Using uv (recommended)
uv syncConfiguration
Set the following environment variables:
# Required
export UNIFI_CONTROLLER_URL="https://your-controller.unifi-hosting.ui.com"
export UNIFI_API_KEY="your-api-key-here"
# Optional
export UNIFI_API_TIMEOUT=30.0
export UNIFI_API_RETRY_ATTEMPTS=3
export UNIFI_API_RETRY_DELAY=1.0
export UNIFI_DEFAULT_PAGE_SIZE=25
export UNIFI_LOG_LEVEL="INFO"You can also create a .env file in your project root:
UNIFI_CONTROLLER_URL=https://your-controller.unifi-hosting.ui.com
UNIFI_API_KEY=your-api-key-hereUsage
Running the Server
# Using uv (if installed from source)
uv run unifi-network-api-mcpUsing with Claude Desktop
Add MCP server to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json):
Using uv
{
"mcpServers": {
"unifi": {
"command": "uv",
"args": [
"run",
"--project",
"/path/to/unifi_network_api_mcp",
"unifi-network-api-mcp"
],
"env": {
"UNIFI_CONTROLLER_URL": "https://your-controller.unifi-hosting.ui.com",
"UNIFI_API_KEY": "your-api-key-here"
}
}
}
}Development
Setup
# Clone the repository
git clone https://github.com/sevaepsteyn/unifi_network_api_mcp.git
cd unifi_network_api_mcp
# Install dependencies with uv
uv sync
# Run in development mode
uv run unifi-network-api-mcp
# Or use uv with --project from any directory
uv run --project /path/to/unifi_network_api_mcp unifi-network-api-mcpTesting
# Run tests
uv run pytest
# Run with coverage
uv run pytest --cov=unifi_network_api_mcpAPI Reference
For detailed API documentation, see UNIFI_NETWORK_API.md.
License
MIT License - see LICENSE file for details
Available Tools
15 toolsapplication_infoB
Get general information about the UniFi Network application.
Inputs: no named parameters. Returns: Application information response.
authorize_guestB
Authorize guest access for a client.
This allows a client to access the network through the guest portal. You can optionally set limits on time, data usage, and bandwidth.
Inputs: site_id (required), client_id (required), time_limit_minutes, data_usage_limit_mb, +2 more. Returns: result
client_detailsA
Get detailed information about a specific client.
Inputs: site_id (required), client_id (required). Returns: Client information.
clientsB
List all connected clients on a site.
Inputs: site_id (required). Returns: Result from listing clients.
create_vouchersC
Create one or more hotspot vouchers.
Vouchers allow guests to access the network by entering a code. Each voucher can be used by multiple guests up to the authorized limit.
Inputs: name (required), site_id (required), time_limit_minutes (required), count, +4 more. Returns: Response from creating vouchers.
delete_voucherA
Delete a specific hotspot voucher.
This will invalidate the voucher code and disconnect any guests using it.
Inputs: site_id (required), voucher_id (required). Returns: result
device_detailsC
Get detailed information about a specific device.
Inputs: site_id (required), device_id (required). Returns: Detailed device information.
devicesB
List all adopted devices on a site.
Inputs: site_id (required). Returns: Result from listing devices.
device_statisticsC
Get the latest statistics for a specific device.
Inputs: site_id (required), device_id (required). Returns: Device statistics.
power_cycle_portA
Power cycle a specific port on a device.
This will temporarily disable PoE power on the port and then re-enable it. Useful for restarting PoE-powered devices like access points or cameras.
Inputs: site_id (required), port_idx (required), device_id (required). Returns: result
restart_deviceB
Restart a specific device.
This will cause the device to reboot, temporarily disconnecting any connected clients.
Inputs: site_id (required), device_id (required). Returns: result
search_devicesA
Search for devices with optional filters.
Use wildcards in name_pattern: * matches any characters, . matches single character. Example: "AP-*" matches all devices starting with "AP-"
Inputs: site_id (required), model, state, name_pattern. Returns: Result from listing devices.
sitesA
List all sites managed by this UniFi Network application.
Inputs: no named parameters. Returns: Result from listing sites.
unauthorize_guestA
Revoke guest access for a client.
This will immediately disconnect the client from the guest network.
Inputs: site_id (required), client_id (required). Returns: result
vouchersB
List all hotspot vouchers for a site.
Inputs: site_id (required). Returns: Result from listing vouchers.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Most tools map to a distinct resource+action (device_details vs device_statistics vs restart_device vs power_cycle_port are clearly separable), and voucher and guest-authorization operations are unambiguous. The only real overlap is between `devices` (list adopted devices on a site) and `search_devices` (wildcard name search), where an agent could plausibly pick the wrong one; `sites` vs `devices` vs `clients` is otherwise clean.
There is a readable implied convention — bare nouns for reads (`sites`, `devices`, `clients`, `vouchers`) and verb_noun for actions (`restart_device`, `authorize_guest`, `create_vouchers`) — but it is never stated and the reads are inconsistent with the noun_phrase reads (`application_info`, `device_details`, `client_details`). Plural/singular also drifts within one resource: `vouchers` / `create_vouchers` (plural) vs `delete_voucher` (singular).
Fifteen tools is within a healthy range and the surface divides cleanly into three domains (devices, clients, vouchers) plus app/site context, with no filler tools. Each entry corresponds to a real UniFi operation rather than a variant of another tool.
The set covers device inspection/restart/PoE cycling and full voucher + guest-authorization lifecycle, but there are notable holes: no site details or site-level settings, no client block/kick (only guest auth), no WLAN/network/firewall/port-forward configuration reads, and no events/alarms/health data. An agent doing anything beyond monitoring and guest access will hit dead ends.
Maintenance
Related MCP Connectors
Unified MCP Server is a remote MCP connector for AI agents and vertical AI products that provides access to 22,000+ authorized SaaS tools across 400+ integrations and 24 categories directly inside LLMs (Claude, GPT, Gemini, Cohere). Tools operate only on explicitly authorized customer connections, enabling agents to safely read and write against live third-party systems.
Single-connection MCP gateway discovering and executing 490+ verified MCP & A2A tools.
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
Remote MCP for 1,500+ APIs. Vault-managed credentials; OAuth or API key. Search, load, and execute.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables managing UniFi networks through natural language, allowing users to monitor clients, check network health, and perform device actions like blocking or restarting access points. It securely connects UniFi Controllers to MCP clients with features like Google OAuth authentication.MIT
- AlicenseAqualityBmaintenanceExposes the UniFi Network Integration API as tools for managing sites, devices, clients, networks, WiFi, firewalls, ACLs, switching, DNS policies, hotspot vouchers, VPNs, and more.49199 npm3MIT
- -licenseNot gradedqualityNot gradedmaintenanceTurns your UniFi Network Controller into programmable tools for querying and modifying network settings via MCP.-
- AlicenseAqualityDmaintenanceMCP server providing typed, safety-gated access to UniFi Network consoles via the official API, enabling management of devices, clients, networks, WiFi, firewall policies, and more.1629 npm2MIT