Deployment
Docker Compose
Section titled “Docker Compose”The repository’s compose.yaml is a good starting point:
services: unifi-mcp: image: ghcr.io/mattoddie/unifi-mcp:latest container_name: unifi-mcp restart: unless-stopped env_file: .env ports: - "8080:8080"docker compose up -d # startdocker compose logs -f # follow logsdocker compose ps # shows "healthy" once the health check passesdocker compose down # stopThe image has a built-in health check that calls /health every 30 seconds.
To listen on one interface only, such as a LAN address or localhost when you use a reverse proxy, change the port mapping to "192.168.1.10:8080:8080" or "127.0.0.1:8080:8080".
Image tags
Section titled “Image tags”Images are published to the GitHub Container Registry at ghcr.io/mattoddie/unifi-mcp for linux/amd64 and linux/arm64. Each GitHub release publishes these tags:
| Tag | Example | Moves? |
|---|---|---|
X.Y.Z |
1.4.2 |
Never. Pin this for full reproducibility. |
X.Y |
1.4 |
Moves to the latest patch release (bug fixes). |
X |
1 |
Moves to the latest minor release (new features, no breaking changes). Not published for 0.x. |
latest |
Moves to the newest stable release. |
Pre-releases, such as 1.5.0-rc.1, are only published under their exact version, never as latest.
Every image includes an SBOM and build provenance attestation. To verify that an image was built by this repository’s release workflow:
gh attestation verify oci://ghcr.io/mattoddie/unifi-mcp:1.4.2 --owner mattoddieUpgrading
Section titled “Upgrading”docker compose pulldocker compose up -dCheck the changelog or the release notes before upgrading across a major version.
Building from source
Section titled “Building from source”git clone https://github.com/mattoddie/unifi-mcp.gitcd unifi-mcpdocker build -t unifi-mcp .The tests run as part of the image build, so a broken build never produces an image. To use a local build with Compose, replace image: in compose.yaml with build: . and run docker compose up -d --build.
TLS with a reverse proxy
Section titled “TLS with a reverse proxy”The server speaks plain HTTP. If it’s reachable from outside a trusted network, put a TLS-terminating reverse proxy in front of it and keep MCP_AUTH_TOKEN set.
Caddy, which gets certificates automatically:
unifi-mcp.example.com { reverse_proxy unifi-mcp:8080}nginx:
server { listen 443 ssl; server_name unifi-mcp.example.com; ssl_certificate /etc/ssl/certs/unifi-mcp.pem; ssl_certificate_key /etc/ssl/private/unifi-mcp.key;
location /mcp { proxy_pass http://unifi-mcp:8080; proxy_set_header Host $host; proxy_read_timeout 120s; # some tools (backups, RF scans) take a while }}Traefik labels:
services: unifi-mcp: image: ghcr.io/mattoddie/unifi-mcp:latest env_file: .env labels: - traefik.enable=true - traefik.http.routers.unifi-mcp.rule=Host(`unifi-mcp.example.com`) - traefik.http.routers.unifi-mcp.tls.certresolver=letsencrypt - traefik.http.services.unifi-mcp.loadbalancer.server.port=8080When the server sits behind a proxy, don’t publish its port. Set MCP_ALLOWED_HOSTS=unifi-mcp.example.com so it only accepts requests for that hostname.
Hardening
Section titled “Hardening”The image is distroless (gcr.io/distroless/static-debian13): a single static binary, CA certificates and a non-root user (nonroot, UID 65532), about 22 MB, with no shell or package manager. It doesn’t need a writable filesystem. You can lock it down further:
services: unifi-mcp: image: ghcr.io/mattoddie/unifi-mcp:1.4.2 read_only: true cap_drop: [ALL] security_opt: [no-new-privileges:true] mem_limit: 128m pids_limit: 100 env_file: .env ports: ["127.0.0.1:8080:8080"]See Security for choosing permissions and toolsets.
Running without Docker
Section titled “Running without Docker”Docker is the main way to run unifi-mcp, but the server is a single static binary with no dependencies.
With Homebrew
Section titled “With Homebrew”On macOS or Linux, install the release binary with Homebrew:
brew install mattoddie/tap/unifi-mcpbrew upgrade picks up new releases, usually within an hour of them being published. The formula installs the same release archive described below, after checking its checksum and build provenance. See mattoddie/homebrew-tap.
Download a release binary
Section titled “Download a release binary”Each release has an archive for macOS, Linux and Windows on amd64 and arm64. Each archive holds the unifi-mcp binary and the licence. For example, on a Raspberry Pi or another 64-bit Arm Linux machine:
VERSION=1.2.3 # the latest release, without the vcurl -fsSLO https://github.com/mattoddie/unifi-mcp/releases/download/v$VERSION/unifi-mcp-$VERSION-linux-arm64.tar.gzcurl -fsSLO https://github.com/mattoddie/unifi-mcp/releases/download/v$VERSION/SHA256SUMSsha256sum -c SHA256SUMS --ignore-missing # on macOS: shasum -a 256 -c SHA256SUMS --ignore-missingtar -xzf unifi-mcp-$VERSION-linux-arm64.tar.gzsudo install unifi-mcp /usr/local/bin/Use darwin-arm64 for a Mac with Apple silicon, darwin-amd64 for an Intel Mac, linux-amd64 for most PCs and servers, and the windows .zip files on Windows.
Each archive also has a signed build provenance attestation. To check that a file was built by this repository’s release workflow, run gh release verify-asset v$VERSION unifi-mcp-$VERSION-linux-arm64.tar.gz -R mattoddie/unifi-mcp.
Release binaries don’t update themselves. Watch the repository’s releases (Watch → Custom → Releases) to hear about new versions.
Build it yourself
Section titled “Build it yourself”You need Go 1.26 or later. With go install:
go install github.com/mattoddie/unifi-mcp/cmd/unifi-mcp@latestThe binary lands in $(go env GOPATH)/bin. Built this way it reports its version as 0.0.0-dev.
Or from a clone, which also stamps the version:
git clone https://github.com/mattoddie/unifi-mcp.gitcd unifi-mcpmake build VERSION=1.2.3 # writes bin/unifi-mcpRun it
Section titled “Run it”UNIFI_URL=https://192.168.1.1 UNIFI_API_KEY=... UNIFI_TLS_FINGERPRINT=... unifi-mcp # stdio by defaultMCP_TRANSPORT=http MCP_AUTH_TOKEN=... UNIFI_URL=... UNIFI_API_KEY=... UNIFI_TLS_FINGERPRINT=... unifi-mcpIn HTTP mode, MCP_AUTH_TOKEN is required, and outside Docker the server listens on 127.0.0.1 only. Set MCP_HTTP_HOST=0.0.0.0 to accept connections from other machines.