Skip to content

Getting started

This guide takes you from nothing to asking your first question about your Octopus Energy account. It takes about ten minutes.

  • An Octopus Energy account in the UK that you can log in to at octopus.energy. Consumption data needs a smart meter that sends half-hourly readings.
  • Somewhere to run the server. On a Mac or Linux machine, Homebrew is the simplest: your MCP client starts the server when it needs it. To run it once as a service for several clients, use Docker on a NAS, a home server, a Raspberry Pi or a small VM. The image supports both amd64 and arm64.
  • An MCP client, such as Claude Code, Claude Desktop, VS Code, Cursor or Codex.

You don’t need an account at all for the public tariff tools (products, prices and Agile rates), but the server still needs an API key to start.

Using Claude Desktop on a Mac or Windows PC? There’s a one-click install. Do step 1, then install the extension bundle from the releases page and enter your API key in its settings, instead of step 2.

No Homebrew? Each release also has plain binaries for macOS, Linux and Windows. See Download a release binary and connecting a client to the binary.

Octopus gives every customer a personal API key.

  1. Log in to your Octopus account in a browser.
  2. Open Personal details → API access. You’ll see your API key, which starts sk_live_, and your account number, which looks like A-1234ABCD.
  3. Copy both.

Pick one of these options.

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.

Install it:

Terminal window
brew install mattoddie/tap/octopus-mcp

Check that the API key works:

Terminal window
OCTOPUS_API_KEY=sk_live_... octopus-mcp status
{
"accounts": ["A-1234ABCD"],
"api_key": "accepted",
"default_account": "A-1234ABCD",
"graphql": "https://api.octopus.energy/v1/graphql/",
"rest": "https://api.octopus.energy/v1"
}

Then connect your assistant. For Claude Code:

Terminal window
claude mcp add octopus \
--env OCTOPUS_API_KEY=sk_live_... \
-- "$(brew --prefix)/bin/octopus-mcp"

If your key can see more than one account, add --env OCTOPUS_ACCOUNT=A-1234ABCD too. The server starts read-only, which is the right way to begin.

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

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 octopus-mcp && cd octopus-mcp
curl -fsSLO https://raw.githubusercontent.com/mattoddie/octopus-mcp/main/compose.yaml
curl -fsSL https://raw.githubusercontent.com/mattoddie/octopus-mcp/main/example.env -o .env

Edit .env and set at least:

Terminal window
OCTOPUS_API_KEY=sk_live_... # from step 1
OCTOPUS_ACCOUNT=A-1234ABCD # optional if the key can only see one account
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.

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

You should see lines like these:

octopus-mcp 1.0.0: https://api.octopus.energy, account A-1234ABCD, writes disabled, toolsets 6, transport http
octopus-mcp listening on http://0.0.0.0:8080/mcp (bearer auth enabled)

Check that the API key works:

Terminal window
docker compose exec octopus-mcp /octopus-mcp status
{
"accounts": ["A-1234ABCD"],
"api_key": "accepted",
"default_account": "A-1234ABCD",
"graphql": "https://api.octopus.energy/v1/graphql/",
"rest": "https://api.octopus.energy/v1"
}

And that the server is reachable from another machine:

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

For Claude Code:

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

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

Start a new conversation and try:

  • “What tariff am I on, and what’s my electricity price right now?”
  • “How much electricity did I use last week, and what did it cost?”
  • “When’s the cheapest two hours to run the dishwasher tonight?”

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

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

  • Let it change things. With OCTOPUS_ALLOW_WRITES=true (in .env, or as another --env with Homebrew) the assistant can change Intelligent Octopus charging settings, start a bump charge and join Saving Sessions. Read Security first.
  • Expose fewer tools with OCTOPUS_TOOLSETS for a faster, more focused assistant. See Configuration.
  • Put it behind HTTPS if you run it as an HTTP service that’s reachable outside your LAN. See Deployment.
  • Learn what it can do in Using octopus-mcp and the tool reference.