Skip to main content
Glama
README.md
<div align="center">

<img src="docs/assets/logo.svg" alt="hive-mcp logo" width="112" height="112">

# hive-mcp

**Talk to your heating.**

An open-source [Model Context Protocol](https://modelcontextprotocol.io) server for **Hive**, British Gas's smart heating. It lets Claude and other AI assistants check your Hive thermostats, radiator valves, hot water, plugs and lights, and, if you allow it, boost the heating, set temperatures, switch the hot water on and set holiday mode. Install it with Homebrew, run it in Docker, or add it to Claude Desktop in one click.

[![CI](https://github.com/mattoddie/hive-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/mattoddie/hive-mcp/actions/workflows/ci.yml)
[![Release](https://img.shields.io/github/v/release/mattoddie/hive-mcp?sort=semver)](https://github.com/mattoddie/hive-mcp/releases)
[![Container image](https://img.shields.io/badge/ghcr.io-mattoddie%2Fhive--mcp-2496ED?logo=docker&logoColor=white)](https://github.com/mattoddie/hive-mcp/pkgs/container/hive-mcp)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)

**[hive-mcp.mattoddie.dev](https://hive-mcp.mattoddie.dev)**

[Quick start](#quick-start) · [Documentation](https://hive-mcp.mattoddie.dev/docs/) · [Tool reference](docs/tools.md) · [Contributing](CONTRIBUTING.md)

<a href="https://www.youtube.com/watch?v=ESZEwxXg-rw"><img src="docs/assets/trailer.jpg" alt="Watch the hive-mcp trailer on YouTube (1:09)" width="640"></a>

▶️ **[Watch the one-minute trailer](https://www.youtube.com/watch?v=ESZEwxXg-rw)**

</div>

---

> [!IMPORTANT]
> hive-mcp is an **unofficial** project. It isn't made, endorsed or supported by Hive, British Gas or Centrica. Hive has no public API: hive-mcp uses the same undocumented API as the Hive app and the Home Assistant integration, which Hive can change at any time.

> **"It's freezing in here. Can you warm the house up?"**
> *The living room is 17.5 °C and the heating is on its schedule, which has it at 16 °C until 17:00. I can boost it to 21 °C for an hour, after which it goes back to the schedule. Shall I?*
> **"Yes, and put the hot water on too, I want a bath."**
> *Done: the heating is boosting to 21 °C until 15:40, and the hot water is boosting for 30 minutes. By the way, the bedroom radiator valve's battery is down to 20%.*

Ask about your home in plain English. The assistant picks from **29 tools** to look things up and, if you allow it, make changes. Some examples:

- 🌡️ *"How warm is each room, and is the heating on?"*
- 🔥 *"Boost the heating to 21 for an hour."*
- 🛁 *"I want a bath in half an hour. Is the hot water on?"*
- 🧳 *"We're away from Saturday until the 28th. Set holiday mode."*
- 🔋 *"Do any of my Hive devices need new batteries?"*
- 💡 *"Turn the living room light down to 30% and switch the lamp plug off."*

## Highlights

- **📦 Install it your way.** It's a single static Go binary with no dependencies:
  - `brew install mattoddie/tap/hive-mcp` on macOS or Linux.
  - A tiny distroless Docker image (`ghcr.io/mattoddie/hive-mcp`, about 20 MB) for `linux/amd64` and `linux/arm64`, with no shell or package manager, running as a non-root user and serving Streamable HTTP for a long-running service.
  - A one-click extension bundle (`.mcpb`) for Claude Desktop.
  - Plain binaries for macOS, Linux and Windows on `amd64` and `arm64`.
- **🛡️ Safe by default.** The server is read-only unless you turn on writes. Tools that aren't allowed aren't registered at all, and every change is checked first: heating targets must be 5–25 °C in steps of 0.5 (raise the top with `HIVE_MAX_TEMP`), boosts are limited to six hours, holiday mode to 60 days, and settings that last indefinitely (manual heating, hot water on) need an explicit confirmation.
- **📱 One SMS code, once.** Hive logins need a code sent by text message. You enter it once with `hive-mcp login`, and the server registers itself as a *remembered device*, so it can log in again on its own without another code. Passwords, tokens and device secrets never appear in tool output or logs.
- **🔐 Real Cognito SRP.** It logs in the way the Hive app does (AWS Cognito with SRP, which never sends your password), checked against the exact maths of the client Home Assistant uses.
- **🐢 Gentle on Hive.** Readings are cached for 30 seconds, so a conversation doesn't hammer an API Hive never meant for us, and it backs off when rate-limited or when a login fails.
- **🎛️ Tunable.** Expose only the toolsets you need, which keeps the model's context small and focused.
- **🧪 Tested.** The test suite runs against a mock Hive, including a fake Cognito that really checks the SRP proofs, SMS codes and remembered devices.

## Quick start

**Using Claude Desktop?** Download the extension bundle (`.mcpb`) for your computer from the [latest release](https://github.com/mattoddie/hive-mcp/releases/latest), open it to install, fill in your Hive email and password, and ask Claude to *"log in to Hive"*. See [Claude Desktop](docs/clients.md#claude-desktop).

hive-mcp is listed in the [MCP Registry](https://registry.modelcontextprotocol.io) as `io.github.mattoddie/hive-mcp`, so clients that browse the registry can install it (the Docker image in stdio mode, or the bundle). See [From the MCP Registry](docs/clients.md#from-the-mcp-registry).

Otherwise, you need a Hive account that works in the Hive app, the phone that gets your Hive text messages, and an MCP client such as [Claude Code](https://claude.com/claude-code).

**1. Have your Hive login ready.** That's the email and password you use in the Hive app. You log in once, typing in a code Hive texts you, and the server then logs itself in again without another code.

**2. Install and connect.** Pick one of these.

### With Homebrew (macOS or Linux)

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 in a file only you can read, such as `~/.config/hive-mcp/password`, then:

```sh
brew install mattoddie/tap/hive-mcp

# Log in to Hive once: type in the code Hive texts you
export HIVE_USERNAME=you@example.com HIVE_PASSWORD_FILE=/path/to/hive-password
hive-mcp login

claude mcp add hive \
  --env HIVE_USERNAME=you@example.com \
  --env HIVE_PASSWORD_FILE=/path/to/hive-password \
  -- "$(brew --prefix)/bin/hive-mcp"
```

Now ask *"How warm is the house?"* in Claude Code. `brew upgrade` picks up new releases. For VS Code, Cursor or Codex, see [Without Docker](docs/clients.md#without-docker).

### With Docker (a long-running service)

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

```sh
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: set HIVE_USERNAME and HIVE_PASSWORD (your Hive app login)
# and a random MCP_AUTH_TOKEN (e.g. `openssl rand -hex 32`)

docker compose run --rm hive-mcp login   # log in once: type in the code Hive texts you
docker compose up -d

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

For other clients, see [Connecting MCP clients](docs/clients.md). Docker also has a [stdio mode](docs/clients.md#stdio-mode) with `docker run -i`.

## Turning on changes

Out of the box the assistant can look but not touch. To let it change your heating, hot water, plugs and lights, set these variables. With Homebrew, add them as more `--env` options to `claude mcp add`, or to `env` in your client's config. With Docker, add them to `.env` and run `docker compose up -d`.

```sh
HIVE_ALLOW_WRITES=true
HIVE_TOOLSETS=home,heating,hotwater   # optional: expose fewer tools
```

Read [Security](docs/security.md) before turning on writes. A heating system is a real thing in a real home. To keep a record of every change the assistant makes, set `HIVE_AUDIT_LOG` to a file path (see [Audit log](docs/configuration.md#audit-log)).

## What it can do

| Toolset | What's covered |
|---|---|
| `home` | Login, a one-call overview of the home, the list of Hive devices with batteries and signal, holiday mode, and Hive actions (automations): list them and turn them on or off |
| `heating` | Heating zones and radiator valve (TRV) zones: temperatures, modes and schedules; set the temperature, mode or weekly schedule, boost and cancel a boost, heat on demand |
| `hotwater` | Hot water: status and schedule; switch it on, off or back to its schedule, change the schedule, boost and cancel a boost |
| `devices` | Smart plugs, lights and sensors: on or off, power use, brightness, colour temperature, colour, open or closed |
| `raw` | An escape hatch that calls any path of Hive's API. Off unless you list it (`HIVE_TOOLSETS=all,raw`) |

See the **[tool reference](docs/tools.md)** for every tool and argument. Ready-made prompts like `home_check`, `warm_up` and `going_away` chain the tools together for common jobs.

## Documentation

The docs are also published at **[hive-mcp.mattoddie.dev/docs](https://hive-mcp.mattoddie.dev/docs/)**, with search.

| | |
|---|---|
| 🚀 [Getting started](docs/getting-started.md) | Step-by-step setup, including the one-time SMS login |
| 🔌 [Connecting MCP clients](docs/clients.md) | Claude Code, Claude Desktop, VS Code, Cursor, Codex, stdio mode |
| ⚙️ [Configuration](docs/configuration.md) | Every environment variable, how login and remembered devices work, Docker secrets, toolsets |
| 🐳 [Deployment](docs/deployment.md) | Compose, image tags, upgrades, TLS reverse proxy, hardening, running without Docker |
| 💬 [Using hive-mcp](docs/usage.md) | Example conversations, prompts, how changes and boosts work |
| 🧰 [Tool reference](docs/tools.md) | Every tool and prompt, generated from the code |
| 🛡️ [Security](docs/security.md) | Threat model, what the token file holds, safe write setups |
| 📡 [Compatibility](docs/compatibility.md) | Supported Hive devices, discontinued products, and how the unofficial API is used |
| 🩹 [Troubleshooting](docs/troubleshooting.md) | Login and SMS problems, common errors and how to fix them |
| 🛠️ [Development](docs/development.md) | Architecture, the mock Hive, adding a tool, testing |

## Contributing

Contributions are very welcome, whether that's bug reports, notes on how Hive's API behaves, docs or new tools. Read the [contributing guide](CONTRIBUTING.md) to get started, and please follow the [code of conduct](CODE_OF_CONDUCT.md). To report a vulnerability, see the [security policy](SECURITY.md). Please don't open a public issue for one.

## License

[MIT](LICENSE) © Matt Oddie

*hive-mcp is an independent community project. It is not affiliated with, endorsed by or sponsored by Hive, British Gas or Centrica plc. "Hive" and "British Gas" are trademarks of Centrica plc or its subsidiaries. hive-mcp builds on what the community learned writing [pyhiveapi](https://github.com/Pyhass/Pyhive), the library behind the Home Assistant Hive integration.*

TDQS

A3.7/5.0

Scored across 26 tools

Disambiguation4/5

Most tools have a clearly distinct resource+action purpose, and descriptions make the intended use clear. Some overlap exists between hive_list_devices, hive_list_smart_devices and hive_list_trvs (all list hardware from different angles), and hive_set_heating_mode vs hive_set_heating_temperature with mode=manual can both put a zone in manual mode, but the descriptions provide enough guidance to pick correctly.

Naming Consistency5/5

All 26 tools follow a single, predictable convention: hive_ prefix plus a verb_noun pattern (get_, set_, list_, boost_, cancel_). Even less common operations like hive_set_heat_on_demand fit the pattern, and there is no mixing of styles.

Tool Count3/5

At 26 tools the surface is on the heavy side, just over the 'borderline' 16-25 range. The domain is genuinely broad (heating, hot water, schedules, holiday mode, devices, actions, lights/plugs, auth/overview), and each tool appears to earn its place, but the count is larger than ideal for easy agent navigation.

Completeness4/5

Core lifecycle operations are well covered: reading state, setting modes/temperatures/schedules, boosting and cancelling boosts, holiday mode, device listing, lights/plugs, and actions on/off. Minor gaps remain—actions cannot be created or edited (deliberately deferred to the Hive app), and there are no tools to rename/remove devices or adjust TRV calibration/child lock—but these are workable limitations rather than dead ends.

Maintenance

ActivityActive
ResponsivenessNo recent community issues