Skip to content

Getting started

This guide takes you from nothing to asking your first question about your Hive heating. It takes about ten minutes. Have your phone to hand: Hive texts you a code once, during the login.

  • A Hive account that you can log in to in the Hive app, with at least one Hive product, such as Hive Active Heating. See Compatibility for the devices hive-mcp knows about.

  • The phone that receives your Hive text messages. Hive accounts use two-step verification, so the first login needs a code Hive sends by SMS.

  • Somewhere to run it. Pick one:

    • Homebrew on macOS or Linux. Your MCP client starts the server when it needs it, so there’s nothing to keep running. See Option A.
    • Docker on a NAS, a home server, a small VM or your laptop, as a long-running service that any number of clients connect to. The image supports both amd64 and arm64. See Option B.

    Each release also has plain binaries for macOS, Linux and Windows. See Running without Docker.

  • An MCP client, such as Claude Code, Claude Desktop, VS Code, Cursor or Codex.

Your MCP client starts the server when it needs it, over stdio. There’s nothing to keep running and no MCP_AUTH_TOKEN to set.

Put your Hive password (the one you use in the Hive app) in a file only you can read, such as ~/.config/hive-mcp/password. Then install hive-mcp and log in to Hive once:

Terminal window
brew install mattoddie/tap/hive-mcp
export HIVE_USERNAME=you@example.com HIVE_PASSWORD_FILE=/path/to/hive-password
hive-mcp login

Hive texts a code to the phone on your account. Type it in and press Enter, as in Log in to Hive below. The login is saved to ~/.config/hive-mcp/tokens.json, and the server logs itself in again from then on without another code.

Connect Claude Code:

Terminal window
claude mcp add hive \
--env HIVE_PASSWORD_FILE=/path/to/hive-password \
-- "$(brew --prefix)/bin/hive-mcp"

Run claude mcp list to check that hive shows as connected. brew upgrade picks up new releases. For VS Code, Cursor, Codex and other clients, see Without Docker.

Now ask something.

Run it once on a server or NAS and connect any number of clients over HTTP.

Create a folder and download the compose file and the example settings:

Terminal window
mkdir hive-mcp && cd hive-mcp
curl -fsSLO https://raw.githubusercontent.com/mattoddie/hive-mcp/main/compose.yaml
curl -fsSL https://raw.githubusercontent.com/mattoddie/hive-mcp/main/example.env -o .env

Edit .env and set at least:

Terminal window
HIVE_USERNAME=[email protected] # the email address you log in to the Hive app with
HIVE_PASSWORD=your-hive-password
MCP_AUTH_TOKEN=a-long-random-string # generate one with: openssl rand -hex 32

Leave everything else for now. The server starts read-only, which is the right way to begin.

Why the password? The first login uses it with the SMS code. After that the server logs in with a refresh token, and when that runs out it logs in again by itself, using the password and the remembered device it registers during the first login, without another SMS code. Keep .env private: see Security.

The compose file keeps the login in a Docker volume called hive-data, mounted at /data. Keep it: it holds the tokens and the remembered device’s secret. See How login works.

Run the login command once. It needs a terminal, because it asks you for the code:

Terminal window
docker compose run --rm hive-mcp login

It logs in with your username and password, and Hive texts a code to the phone on your account:

Logging in to Hive as [email protected] ...
Hive has sent a code by text message to +*******1234.
Enter the code:

Type the code and press Enter. Codes expire after about three minutes. If you mistype it, you get two more tries. The command finishes with something like:

Logged in to Hive as Sam Smith ([email protected]): 2 heating zone(s), 9 device(s).
Tokens saved to /data/tokens.json.
This server is now a remembered device ("hive-mcp"), so it can log in again without an SMS code.

That’s the only time you need the code. If you run login again later, it uses the remembered device and doesn’t send another text.

Without Compose, the same login with plain Docker is:

Terminal window
docker run -it --rm --env-file .env -v hive-data:/data ghcr.io/mattoddie/hive-mcp:latest login

The -it matters: without it the command can’t read the code you type.

Terminal window
docker compose up -d
docker compose logs -f hive-mcp

You should see lines like these:

hive-mcp 1.0.0: https://beekeeper.hivehome.com/1.0, auth token file /data/tokens.json (remembered device), writes disabled, toolsets 5, transport http
hive-mcp listening on http://0.0.0.0:8080/mcp (bearer auth enabled)

If the first line says not logged in, go back to step 2. You can log in again at any time without restarting the server: it picks up the new login from the token file.

Check that it’s up from another machine:

Terminal window
curl http://<docker-host>:8080/health
# {"status":"ok"}

For Claude Code:

Terminal window
claude mcp add --transport http hive http://<docker-host>:8080/mcp \
--header "Authorization: Bearer <MCP_AUTH_TOKEN>"

Run claude mcp list to check that hive shows as connected. For other clients, see Connecting MCP clients.

Start a new conversation and try:

  • “How warm is the house?”
  • “What’s the heating schedule today?”
  • “Do any of my Hive devices need new batteries?”

The assistant calls tools like hive_get_overview and hive_get_heating_schedule and summarises the results. In Claude Code you can also run the built-in prompts as slash commands, for example /mcp__hive__home_check.

If something goes wrong, the tool’s error message usually says what to fix. Troubleshooting covers the common errors.

  • Let it make changes. Set HIVE_ALLOW_WRITES=true. With Homebrew, add --env HIVE_ALLOW_WRITES=true to the claude mcp add command (run claude mcp remove hive first). With Docker, set it in .env and restart with docker compose up -d. Read Security first.
  • Expose fewer tools with HIVE_TOOLSETS for a faster, more focused assistant. See Configuration.
  • Put it behind HTTPS if you run it as a service that’s reachable outside your LAN. See Deployment.
  • Learn what it can do in Using hive-mcp and the tool reference.