1
Get your UniFi API key
UniFi MCP Server authenticates with the UniFi API using an API key, which you generate from the UniFi Site Manager.
- Log in to unifi.ui.com
- Navigate to Settings → Control Plane → Integrations
- Click Create API Key
- Copy the key and store it somewhere secure
The API key is shown only once. If you navigate away without copying it, you’ll need to create a new one.
2
Install the server
Install UniFi MCP Server from PyPI using Run without installing, using uvx:After installing with
pip or run it directly with uvx without a permanent installation.Install with pip (recommended):pip, the unifi-mcp-server command is available globally.3
Set your environment variables
The server reads its configuration from environment variables. At minimum, you need Replace You can set these in your shell, in a
UNIFI_API_KEY and UNIFI_API_TYPE.For Local Gateway mode (recommended):192.168.2.1 with the IP address of your UniFi gateway.For Cloud v1 mode:.env file in the project directory, or directly in your MCP client configuration (shown in the next step).4
Connect to Claude Desktop
Open your Claude Desktop configuration file and add the UniFi MCP Server entry. The config file is located at:Using uvx with Cloud v1:After saving the file, restart Claude Desktop to load the new server.
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
5
Test with a sample prompt
Once Claude Desktop restarts, open a new conversation and try asking:
“List my UniFi devices”If the server is connected correctly, Claude will use the
list_devices tool and return a list of your UniFi devices with their names, models, and status.You can also try:- “Show me all connected clients on my network”
- “What are the current firewall rules on site default?”
- “Give me a summary of my UniFi sites”
Next steps
API modes
Understand the differences between Local Gateway, Cloud v1, and Cloud EA modes.
MCP client setup
Detailed configuration for Claude Desktop, Cursor, and other clients.