Getting started
This guide takes you from nothing to asking your first question about your Octopus Energy account. It takes about ten minutes.
- Option A: Homebrew (macOS or Linux)
- Option B: Docker (a long-running service)
- 3. Ask something
- Next steps
What you need
Section titled “What you need”- 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
amd64andarm64. - 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.
1. Get your API key
Section titled “1. Get your API key”Octopus gives every customer a personal API key.
- Log in to your Octopus account in a browser.
- Open Personal details → API access. You’ll see your API key, which starts
sk_live_, and your account number, which looks likeA-1234ABCD. - Copy both.
2. Run the server
Section titled “2. Run the server”Pick one of these options.
Option A: Homebrew (macOS or Linux)
Section titled “Option A: 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.
Install it:
brew install mattoddie/tap/octopus-mcpCheck that the API key works:
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:
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.
Option B: Docker (a long-running service)
Section titled “Option B: Docker (a long-running service)”Run it once on a server or NAS and connect any number of clients over HTTP.
Set up the server
Section titled “Set up the server”Create a folder and download the compose file and the example settings:
mkdir octopus-mcp && cd octopus-mcpcurl -fsSLO https://raw.githubusercontent.com/mattoddie/octopus-mcp/main/compose.yamlcurl -fsSL https://raw.githubusercontent.com/mattoddie/octopus-mcp/main/example.env -o .envEdit .env and set at least:
OCTOPUS_API_KEY=sk_live_... # from step 1OCTOPUS_ACCOUNT=A-1234ABCD # optional if the key can only see one accountMCP_AUTH_TOKEN=a-long-random-string # generate one with: openssl rand -hex 32Leave everything else for now. The server starts read-only, which is the right way to begin.
Start the server
Section titled “Start the server”docker compose up -ddocker compose logs -f octopus-mcpYou should see lines like these:
octopus-mcp 1.0.0: https://api.octopus.energy, account A-1234ABCD, writes disabled, toolsets 6, transport httpoctopus-mcp listening on http://0.0.0.0:8080/mcp (bearer auth enabled)Check that the API key works:
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:
curl http://<docker-host>:8080/health# {"status":"ok"}Connect your assistant
Section titled “Connect your assistant”For Claude Code:
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.
3. Ask something
Section titled “3. Ask something”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.
Next steps
Section titled “Next steps”- Let it change things. With
OCTOPUS_ALLOW_WRITES=true(in.env, or as another--envwith 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_TOOLSETSfor 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.