health_check tool as your first diagnostic step—it confirms whether the server is reachable and what API mode it is running in. For more detail, set MCP_LOG_LEVEL=DEBUG in your environment to enable verbose logging.
Server won't start
Server won't start
Symptoms: The process exits immediately, or you see an
ImportError or ModuleNotFoundError in the output.Common causes and fixes:-
Missing dependencies — If you installed from source, ensure you activated your virtual environment and ran
pip install -e ".[dev]"oruv pip install -e ".[dev]". -
Import error for
agnost— Version 0.2.4 fixed a critical startup bug where an import error could occur even whenAGNOST_ENABLED=false. Upgrade to the latest version: -
Missing required environment variable —
UNIFI_API_KEYis required. Check that your.envfile exists and is loaded, or that the variable is set in your shell: -
Wrong Python version — The server requires Python 3.10 or higher:
Authentication failed
Authentication failed
Symptoms: Tools return an authentication error or
401 Unauthorized, or health_check shows an error status.Common causes and fixes:-
Invalid API key — Your
UNIFI_API_KEYmay be incorrect or expired. API keys are shown only once when created. Generate a new one in your UniFi console at Settings → Control Plane → Integrations, then update your.envfile. -
Wrong API type for your key — Cloud keys (
cloud-v1,cloud-ea) do not work withUNIFI_API_TYPE=local, and vice versa. Make sure theUNIFI_API_TYPEyou set matches the key you created. -
Local gateway key mismatch — Local gateway API keys are separate from cloud API keys. Ensure you are using a key created on your local gateway when using
UNIFI_API_TYPE=local.
Tools not showing in my AI client
Tools not showing in my AI client
Symptoms: Claude Desktop, Cursor, or another MCP client shows no UniFi tools, or the server shows as disconnected.Common causes and fixes:
-
Configuration file location — Verify the config file is in the correct location for your client:
- Claude Desktop (macOS):
~/Library/Application Support/Claude/claude_desktop_config.json - Cursor: Open via View → Open MCP Settings → New MCP Server
- Claude Desktop (macOS):
- Restart required — Most MCP clients require a full restart after changing the server configuration. Close and reopen the application completely.
-
Missing
-iflag for Docker — When using Docker, the-iflag (stdin open) is required. Also do not use-d(detached mode) in your MCP client config: - Syntax error in config — Validate your JSON configuration file with a linter. A missing comma or brace will silently prevent the server from loading.
Rate limit exceeded
Rate limit exceeded
Symptoms: Tools return a rate limit error, or you see
429 Too Many Requests in the logs.Cause: The Cloud Early Access API (cloud-ea) has a limit of 100 requests per minute. Heavy AI sessions with many tool calls can exceed this quickly.Fixes:-
Switch to
cloud-v1— The stable v1 Cloud API allows 10,000 requests per minute: -
Switch to local mode — The local gateway API has no rate limit:
- Enable Redis caching — Caching reduces the number of API calls by serving repeated queries from memory. See Speed up responses with Redis caching.
SSL certificate errors
SSL certificate errors
Symptoms: Connection errors with messages like
SSL: CERTIFICATE_VERIFY_FAILED or certificate verify failed.Cause: This occurs when using UNIFI_API_TYPE=local and your UniFi gateway uses a self-signed certificate (which is the default for most local gateways).Fix: Disable SSL verification for local connections:Tools returning empty results
Tools returning empty results
Symptoms:
list_devices, list_active_clients, or other list tools return an empty array even though you have devices or clients on your network.Common causes and fixes:-
Wrong
site_id— The default site ID isdefault, but your UniFi setup may use a different identifier. Check the value ofUNIFI_DEFAULT_SITEin your.env, or calllist_all_sitesto see the actual site IDs available: -
Cloud API limitations — The
cloud-eaandcloud-v1API modes do not support querying individual devices or clients. They only return aggregate site statistics. Switch toUNIFI_API_TYPE=localfor full device and client access. - No devices adopted — If you are using local mode and have never adopted devices into this site, the list will be empty. Check the UniFi console to confirm devices are adopted.
Cannot create or modify resources
Cannot create or modify resources
Symptoms: Mutating tools such as Local mode requires your machine to be on the same network as the UniFi gateway, or connected via VPN.
create_network, create_wlan, or create_firewall_rule return an error about the operation not being supported or the API being read-only.Cause: The Cloud API modes (cloud-ea and cloud-v1) are read-only. They only support querying aggregate site statistics and do not allow configuration changes.Fix: Switch to local gateway mode for full read/write access:Docker container exits immediately
Docker container exits immediately
Symptoms: The container starts and then stops within seconds. Do not add
docker logs unifi-mcp shows no output or shows the server starting and then stopping.Cause: The MCP server uses STDIO transport, which requires an open stdin connection. Without -i, Docker closes stdin and the server exits.Fix: Always include the -i flag when running the container for MCP client use:-d (detached/background mode) in MCP client configurations—the client needs the persistent stdin/stdout connection to communicate with the server.Using the health_check tool
The health_check tool is the fastest way to verify the server is running and connected to the UniFi API:
status is not "healthy", check the server logs for the underlying error.
Enabling verbose logging
SetMCP_LOG_LEVEL=DEBUG to see detailed request and response information, including cache hits/misses, API calls, and webhook processing:
If you cannot resolve an issue using this guide, open a ticket on GitHub Issues. Include your server version (
health_check output), the MCP_LOG_LEVEL=DEBUG log output, and a description of the steps to reproduce the problem.