Get the FREE Ultimate OpenClaw Setup Guide →

unifi

An MCP Server for interacting with Unifi networks.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio mikecutalo-unifi-mcp-server uv --directory /absolute/path/to/unifi-mcp-server run main.py \
  --env UNIFI_HOST="<your-unifi-host>" \
  --env UNIFI_API_KEY="<your-unifi-api-key>"

How to use

This MCP server is designed to interact with Unifi sites via the Unifi API. It uses the uv runtime to execute the main.py script located in your specified directory, enabling you to manage and query Unifi sites from your MCP environment. The server expects environment variables for the target Unifi controller, including the host address and an API key generated in the Unifi GUI under Control Plane -> Integrations. Once running, you can use the MCP tooling in VSCode or your preferred MCP client to configure the unifi-mcp-server and call its endpoints to retrieve site data, monitor devices, or perform management tasks as implemented in main.py.

How to install

Prerequisites:\n- Python 3.8+ installed on your system\n- The uv runtime installed and accessible in your PATH (see Development steps)\n- Access to a Unifi controller with an API key generated for Integrations\n- A directory containing your Unifi MCP server code, with a main.py entry point that implements the MCP server logic.\n\n1. Install the uv runtime (if not already installed):\n\nbash\n# Example using pipx (recommended)\npipx install uv\n``\n\n2. Create and activate a Python virtual environment for development (within your project directory):\n\nbash\n# Create a venv (uv will manage its environment)\nuv venv\n# Activate the venv (path may vary by OS)\nsource .venv/bin/activate\n\n\n3. Sync your MCP server project with uv (optional, if you are using uv sync for development):\n\nbash\nuv sync\n```\n\n4. Run your MCP server using uv with the appropriate directory and entry script (as described in the Usage example): follow the provided command structure to ensure main.py is executed. You can adapt the directory path and entry file to match your setup.\n\n5. Verify connectivity: ensure the Unifi_HOST is reachable from your environment and the UNIFI_API_KEY has the necessary permissions.\n\n6. (Optional) Add the environment variables to your deployment configuration or CI/CD pipeline as needed to keep credentials secure.

Additional notes

Tips and considerations:\n- Ensure UNIFI_HOST uses the proper host URL (including protocol if required by your Unifi instance).\n- API keys should be stored securely; avoid hard-coding them in code or config files. Consider using environment management or secret storage in your deployment environment.\n- The exact path to main.py in the uv command must match your project layout. If your entry script has a different name, adjust the command accordingly.\n- When developing, use uv venv to isolate dependencies. Remember to activate the virtual environment before running uv sync or the server.\n- If you encounter connectivity issues, verify network routes, firewall rules, and that the Unifi controller accepts API requests from your server.\n- Check uv logs for any deprecation or runtime warnings that may require updating your Python dependencies or code.\n- You can extend main.py to expose additional MCP endpoints for managing Unifi sites, devices, sites, and events as your integration requires.

Related MCP Servers

Sponsor this space

Reach thousands of developers