octopus-mcp
An MCP server for Octopus Energy UK that lets an AI assistant query energy account data, usage, costs, tariffs, devices, and rewards; this schema exposes read-only tools only.
Account: account overview, balance, bills, transactions, meter points, serials, and current tariffs.
Usage and cost: electricity import/export and gas consumption by half-hour/day/etc., tariff-based cost estimates, solar/export summaries, and live Home Mini demand.
Tariffs: list products, get product prices, unit rates, standing charges, region lookup, and compare tariffs against actual usage.
Optimization: find cheapest or greenest half-hour slots and plan battery/EV/heat-pump schedules around time-of-use tariffs.
Devices and rewards: Intelligent Octopus devices/dispatches, Octoplus points, and Saving Sessions.
Public data: some tariff and region tools work without an account; account tools use your Octopus API key.
octopus-mcp
Talk to your energy.
An open-source Model Context Protocol server for Octopus Energy customers in the UK. It lets Claude and other AI assistants read your smart meter usage, costs, tariffs and bills, find the cheapest Agile half-hours and, if you allow it, manage Intelligent Octopus EV charging and join Saving Sessions. Install it with Homebrew, run it in Docker, or add it to Claude Desktop in one click.
Quick start · Documentation · Tool reference · Contributing
▶️ Watch the two-minute trailer
octopus-mcp is anunofficial, independent community project. It is not affiliated with, endorsed by or supported by Octopus Energy. It uses the public customer APIs with your own API key.
"How much did I spend on electricity last week, and when should I run the dishwasher tonight?" Last week you used 58.4 kWh for £11.92, including £2.66 of standing charges, an average of 15.9p/kWh on Agile. Wednesday was the priciest day: you used 4.1 kWh between 4pm and 7pm, when prices were over 30p. Tonight the cheapest two hours are 01:30 to 03:30 at an average of 7.8p/kWh, so a 1.5 kWh dishwasher cycle would cost about 12p, against 46p if you started it now.
Ask about your energy in plain English. The assistant picks from 26 tools to look things up and, if you allow it, make changes. Some examples:
📊 "Give me a report on my energy use for September."
⚡ "What are the Agile prices for tomorrow? Any negative ones?"
🕑 "Find the cheapest 3 hours overnight to charge the home battery."
🔥 "How much gas did we use this month, in kWh?"
🚗 "When will the car charge tonight? Make it 90% by 7am tomorrow."
🎁 "Is there a Saving Session coming up? Sign me up."
Highlights
📦 Install it your way. It's a single static Go binary with no dependencies:
brew install mattoddie/tap/octopus-mcpon macOS or Linux.A tiny Docker image (
ghcr.io/mattoddie/octopus-mcp, about 20 MB) forlinux/amd64andlinux/arm64, on a distroless base with no shell or package manager, running as a non-root user with nothing to write. It serves Streamable HTTP for a long-running service.A one-click extension bundle (
.mcpb) for Claude Desktop.Plain binaries for macOS, Linux and Windows on
amd64andarm64.
💷 Real costs, half-hour by half-hour. Consumption is priced with the actual unit rate for every half-hour from the tariff you were on at the time, plus standing charges, so Agile, Go, Intelligent Go, Cosy, Flux and Tracker are costed properly.
🕑 Cheapest-time finder. Finds the cheapest continuous block for a job, runner-up times and the cheapest half-hours, and says what it'll cost against running it now.
🔥 Honest about units. SMETS2 gas meters report m³. octopus-mcp knows which your meter uses, converts with the standard formula, and tells you what it assumed.
🛡️ Safe by default. The server is read-only unless you turn on writes. Tools that aren't allowed aren't registered at all. The raw API tools are off unless you ask for them, and the raw GraphQL tool can't run mutations without writes, or ever touch tokens or API keys.
🔑 Simple, secret-safe auth. Just your Octopus API key: REST requests use it directly, and GraphQL gets short-lived Kraken tokens that are renewed automatically and kept in memory. Neither the key nor tokens ever appear in output or logs.
🎛️ Tunable. Expose only the toolsets you need, which keeps the model's context small and focused.
🧪 Tested. The test suite runs against a mock Octopus REST API and GraphQL APIs on every build.
Related MCP server: mcp-teslamate-fleet
Quick start
You need an Octopus Energy account (with a smart meter for usage data) and an MCP client such as Claude Code.
1. Get your API key from Personal details → API access in your Octopus account. Note your account number (A-1234ABCD) too.
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.
brew install mattoddie/tap/octopus-mcp
OCTOPUS_API_KEY=sk_live_... octopus-mcp status # checks the API key
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. Now ask "What tariff am I on, and what's my electricity price right now?" in Claude Code. brew upgrade picks up new releases. For VS Code, Cursor or Codex, see Without Docker.
With Docker (a long-running service)
Run it once on a server or NAS and connect any number of clients over HTTP.
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: set OCTOPUS_API_KEY, OCTOPUS_ACCOUNT
# and a random MCP_AUTH_TOKEN (e.g. `openssl rand -hex 32`)
docker compose up -d
docker compose exec octopus-mcp /octopus-mcp status # checks the API key
claude mcp add --transport http octopus http://<docker-host>:8080/mcp \
--header "Authorization: Bearer <MCP_AUTH_TOKEN>"For other clients, see Connecting MCP clients. Docker also has a stdio mode with docker run -i.
Claude Desktop in one click
On a Mac or Windows PC, download the .mcpb bundle for your computer from the latest release, open it, and enter your API key in the settings. See Claude Desktop.
octopus-mcp is listed in the MCP Registry as io.github.mattoddie/octopus-mcp, so clients that install from the registry can find it there, with the Docker image and the bundles.
Turning on changes
Out of the box the assistant can look but not touch. To let it change Intelligent Octopus charging settings, start a bump charge and join Saving Sessions, 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.
OCTOPUS_ALLOW_WRITES=true
OCTOPUS_TOOLSETS=account,consumption,tariffs,intelligent,octoplus # optional: expose fewer toolsOctopus API keys can't be limited to read-only, so this switch, enforced by octopus-mcp, is what keeps the assistant read-only. Read Security before turning it on. To keep a record of every change the assistant makes, set OCTOPUS_AUDIT_LOG to a file path (see Audit log).
What it can do
Toolset | What's covered |
| The account overview (properties, MPAN/MPRN, meter serials, smart meter device IDs, current tariffs), balance, bills and transactions |
| Smart meter usage for electricity import and export and gas, by half-hour, hour, day, week or month, with cost estimates; what your real usage would have cost on other tariffs; solar and export summaries with net cost and self-consumption; live demand from a Home Mini |
| Products on sale, prices by region, half-hourly unit rates (Agile, Go and more), standing charges, the cheapest times to use electricity, the greenest times from the regional carbon intensity forecast, charging and heating schedules for batteries, heat pumps and cars, region by postcode. No account needed |
| Intelligent Octopus cars and chargers: status, schedule, planned and completed charging slots; with writes, target and ready-by time, bump charge, smart control |
| Octoplus points, Saving Sessions with rewards and results; with writes, joining a session |
| Escape hatches: any GraphQL query (mutations only with writes) and any REST GET. Opt-in: only enabled when named in |
See the tool reference for every tool and argument. Ready-made prompts like energy_report, plan_cheap_usage and compare_tariffs chain the tools together for common jobs.
Documentation
The docs are also published at octopus-mcp.mattoddie.dev/docs, with search.
Step-by-step setup, from API key to first question | |
Claude Code, Claude Desktop, VS Code, Cursor, Codex, stdio mode | |
Every environment variable, how authentication works, Docker secrets, toolsets | |
Compose, image tags, upgrades, TLS reverse proxy, hardening, running without Docker | |
Example conversations, prompts, units, cost estimates, gas in m³, EV charging, Saving Sessions | |
Every tool and prompt, generated from the code | |
🛡️ Security | Threat model, the API key, safe write setups |
The Octopus APIs, meters and tariffs, and known gaps | |
Common errors and how to fix them | |
🛠️ Development | Architecture, adding a tool, testing |
Contributing
Contributions are very welcome, whether that's bug reports, docs or new tools. Read the contributing guide to get started, and please follow the code of conduct. To report a vulnerability, see the security policy. Please don't open a public issue for one.
License
MIT © Matt Oddie
octopus-mcp is an independent community project. It is not affiliated with, endorsed by or sponsored by Octopus Energy Ltd or Kraken Technologies Ltd. "Octopus Energy", "Agile Octopus", "Intelligent Octopus", "Octoplus" and related names are trademarks of their owners and are used here only to describe what the software works with.
Available Tools
20 toolsoctopus_compare_tariffsCompare tariffs on your usageARead-only
Re-price your actual half-hourly smart meter readings on other Octopus tariffs, such as Agile, Go, Cosy, Tracker, Flux or a fixed deal, and compare them with what the tariffs you were on would have cost: unit costs at each tariff's real rate for every half-hour, plus standing charges, including VAT. Give product codes from octopus_list_products (your meter's region and fuel are used) or full tariff codes. Works for electricity import, export (compares earnings) and gas. These are estimates from past usage, which would change if you shifted it to suit a tariff; they ignore eligibility (Go and Intelligent Go need an EV or charger, Cosy a heat pump), exit fees, discounts and credits. Half-hours a tariff has no rate for (for example before a product existed) are left out and counted.
Inputs: products (required), to, from, fuel, +6 more.
octopus_find_cheapest_slotsFind the cheapest timesARead-only
Find the cheapest time to use electricity on a time-of-use tariff such as Agile: the cheapest continuous block of a given length (for a dishwasher, washing machine, battery or car), runner-up blocks that don't overlap, and the cheapest individual half-hours. Only looks at prices Octopus has published (Agile prices for the next day usually appear around 4pm). Choose the tariff by tariff_code, by product_code with region or postcode, or leave them out for the account's current tariff.
Inputs: to, kwh, from, fuel, +8 more.
octopus_find_greener_slotsFind the greenest timesARead-only
Find the lowest-carbon times to use electricity in your region over the next 48 hours, from the official regional carbon intensity forecast of NESO (Great Britain's electricity system operator, api.carbonintensity.org.uk), alongside your tariff's prices: the greenest continuous block of a given length, runner-up blocks, the greenest half-hours, the cheapest block for comparison, and the intensity now. Intensity is grams of CO2 per kWh of electricity generated in the region (a forecast), with NESO's index from very low to very high. The region comes from the tariff, or from region or postcode on their own (then without prices). Choose the tariff by tariff_code, by product_code with region or postcode, or leave them out for the account's current tariff. Northern Ireland isn't covered.
Inputs: to, kwh, from, fuel, +8 more.
octopus_find_regionFind region by postcodeARead-only
Find which of the 14 electricity regions (A to P) a UK postcode is in. Tariff prices differ by region, and tariff codes end with the region letter. Public data; no account needed.
Inputs: postcode (required).
octopus_get_accountAccount overviewARead-only
A one-call overview of the Octopus Energy account and a good first call: each property's address, its electricity meter points (MPAN, import or export, meter serial numbers, smart meter device IDs) and gas meter points (MPRN, serials, whether the meter reports in kWh or m³), the current tariff on each (tariff and product codes, region), the estimated annual consumption Octopus holds, and the account balance. Use the tariff codes with the tariffs tools, and the MPAN/MPRN and serials with octopus_get_consumption.
Inputs: raw, account_number, include_balance, include_history.
octopus_get_balanceAccount balanceARead-only
Get the account balance in pounds (positive means in credit, negative means you owe Octopus), any overdue balance and the account status.
Inputs: account_number.
octopus_get_consumptionEnergy consumption and costARead-only
Get smart meter readings for electricity (import or export) or gas, totalled by half-hour, hour, day, week or month in UK time, with an estimated cost from the tariff that was active at the time: the actual unit rate for every half-hour (so Agile, Go and other time-of-use tariffs are priced correctly) plus standing charges, including VAT. Readings come from the smart meter, usually a day behind; there is no data for meters that aren't smart or don't send half-hourly reads. Electricity is in kWh. SMETS2 gas meters report m³, which is converted to kWh for costing with the standard formula (m³ × 1.02264 × calorific value ÷ 3.6). For export meters the estimate is what Octopus pays you. Day/night (Economy 7) tariffs are priced assuming night hours of 00:30 to 07:30 GMT, which may not match your meter. Estimates exclude discounts and credits; your bill is the source of truth.
Inputs: to, from, fuel, limit, +8 more.
octopus_get_dispatchesIntelligent Octopus dispatchesARead-only
Get Intelligent Octopus charging slots (dispatches) for a car or charger: the planned slots Octopus has scheduled (with the energy each should add) and recent completed slots. On Intelligent Octopus Go, home electricity is charged at the off-peak rate during planned smart-charging slots even outside the usual off-peak hours (Octopus caps how many hours a day this applies to; check your tariff terms). Completed slots are reported about 12 hours late.
Inputs: hours, device_id, account_number.
octopus_get_live_usageLive electricity demandARead-only
Get near real-time electricity readings from the smart meter through an Octopus Home Mini: current demand in watts and energy used in each interval. Needs a Home Mini paired with the smart meter; without one this returns no data. Readings are typically a few seconds to a few minutes old.
Inputs: hours, limit, grouping, device_id, +1 more.
octopus_get_octoplusOctoplus status and pointsBRead-only
Get whether the account is enrolled in Octoplus, Octopus's rewards scheme, and its OctoPoints balance with the value Octopus gives it in pounds.
Inputs: limit, account_number.
octopus_get_productGet product and pricesARead-only
Get an Octopus product's details and its current prices in each region, including VAT: unit rate (pence per kWh; day and night rates for Economy 7), standing charge (pence per day) and any exit fee, for electricity and gas. For half-hourly tariffs such as Agile the unit rate shown is only indicative; use octopus_get_unit_rates. Public data; no account needed.
Inputs: product_code (required), at, raw, region, +1 more.
octopus_get_saving_sessionsSaving SessionsARead-only
Get Octoplus Saving Sessions (and turn-up and weekend happy hour sessions): upcoming sessions for your region with their start and end times, the OctoPoints reward per kWh, whether you've joined each one and the code to join it; whether you've signed up to the campaign; your points balance; and results of past sessions you took part in.
Inputs: limit, account_number.
octopus_get_solar_summarySolar and export summaryARead-only
Combine a home's electricity import and export smart meters (for solar panels or a battery) over a period: kWh imported and exported, what the imports cost and the exports earned at the actual rate for every half-hour (so Agile Outgoing and other time-of-use export tariffs are priced correctly), standing charges and the net cost, by day, week or month. Octopus has no generation data, so to get self-consumption (generation minus export) and self-sufficiency, pass generated_kwh from your inverter app. Readings are usually a day behind. Estimates exclude discounts and credits; your bill is the source of truth.
Inputs: to, from, limit, group_by, +4 more.
octopus_get_standing_chargesStanding chargesARead-only
Get a tariff's daily standing charge (pence per day, including VAT): the current charge and how it has changed over a period. Choose the tariff by tariff_code, by product_code with region or postcode, or leave them out for the account's current tariff.
Inputs: to, from, fuel, region, +5 more.
octopus_get_unit_ratesUnit ratesARead-only
Get a tariff's unit rates (pence per kWh, including VAT) over a period: every half-hour for Agile, the cheap and peak periods for Go, Intelligent Go, Cosy and Flux, daily prices for Tracker, and the flat rate for fixed and flexible tariffs. Also gives the price now, when it next changes, and the minimum, maximum and average. Choose the tariff by tariff_code, by product_code with region or postcode, or leave them out for the account's current tariff. Day/night tariffs list day and night rates separately.
Inputs: to, from, fuel, limit, +6 more.
octopus_list_billsList billsARead-only
List the account's bills (statements), newest first: the period covered, issue date, charges and credits, and the opening and closing balances, all in pounds. Set include_pdf_links for a temporary link to each bill's PDF.
Inputs: to, from, limit, account_number, +1 more.
octopus_list_devicesList smart devicesBRead-only
List the devices Octopus controls for smart tariffs such as Intelligent Octopus Go: electric cars, chargers, batteries and heat pumps, with each one's make and model, status (for example SMART_CONTROL_CAPABLE, BOOSTING or LOST_CONNECTION), whether smart charging is suspended, battery level where reported, and its charging schedule (target charge and ready-by time for each day).
Inputs: device_id, account_number.
octopus_list_productsList Octopus productsARead-only
List the energy products (tariffs) Octopus Energy sells now, such as Agile, Go, Intelligent Go, Cosy, Tracker, Flux, Flexible and fixed deals, with whether each is variable, a tracker, green, import or export. Public data; no account needed. Use the codes with octopus_get_product for prices.
Inputs: brand, search, variable, direction, +2 more.
octopus_list_transactionsList transactionsARead-only
List the account's transactions, newest first: charges for energy, payments (such as direct debits), credits (such as Octoplus rewards or Saving Session payouts) and refunds, in pounds, with the balance after each.
Inputs: to, from, limit, account_number.
octopus_plan_schedulePlan a charging or heating scheduleARead-only
Plan when to charge a home battery or car, or run a heat pump, so that a given amount of energy goes in as cheaply as possible on a time-of-use tariff such as Cosy, Flux, Go, Intelligent Go or Agile. Unlike octopus_find_cheapest_slots, which finds one continuous block, this spreads the energy over the cheapest half-hours the device's power allows, across every cheap window in the period, and merges them into start and stop times. Also lists the tariff's price windows over the period (for example Cosy's three cheap windows and its peak) and compares the cost with starting straight away. It only plans; it doesn't change any device. Only uses published prices. Choose the tariff by tariff_code, by product_code with region or postcode, or leave them out for the account's current tariff.
Inputs: power_kw (required), energy_kwh (required), to, from, +7 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 20 tools
Tools are largely distinct, and several descriptions explicitly cross-reference their neighbours (plan_schedule explains how it differs from find_cheapest_slots). The main soft spots are the three slot-finding tools (find_cheapest_slots, find_greener_slots, plan_schedule) and the overlapping price/overview tools (get_product vs get_unit_rates, get_balance vs get_account), but the descriptions give enough detail to choose correctly.
Every tool uses the octopus_ prefix plus a consistent snake_case verb_noun pattern (find_region, get_consumption, list_bills, plan_schedule, compare_tariffs). The small number of verbs (find, get, list, plan, compare) is used uniformly and predictably.
20 tools is on the heavy side but is justified by a broad domain spanning accounts, tariffs, consumption, solar, devices, rewards and scheduling. Each tool maps to a distinct API area, though it sits at the upper edge of comfortable scope.
Read/analysis coverage is excellent: account overview, balance, bills, transactions, consumption, live usage, solar, tariff pricing, comparison, scheduling and Octoplus rewards are all present, plus a postcode-to-region helper. Gaps are on the action side — no submitting meter readings and no way to actually join a Saving Session or execute a schedule, only retrieve its join code.
Maintenance
Related MCP Connectors
LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
Free WhatsApp MCP server for ChatGPT and Claude: read and search chats, every send you approve.
Hosted MCP server for Cliniko — patients, appointments, availability, and invoices for AI agents.
Hosted MCP server exposing US hospital procedure cost data to AI assistants
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server for the Octopus Energy Japan GraphQL API that allows users to retrieve electricity consumption, cost estimates, and contract details. It enables 30-minute interval usage analysis and postal code area searches while ensuring privacy by excluding personal address information.37 npm1MIT
- AlicenseBqualityDmaintenanceMCP server combining TeslaMate historical analytics with Fleet API live data and commands. Works with Claude Code, Claude Desktop, Cursor, and any MCP-compatible client.292MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for EmonCMS energy monitoring API, enabling AI assistants to query energy feeds, inputs, and historical data.1MIT
- AlicenseAqualityDmaintenanceAn MCP server that enables any AI agent to call Claude using your existing Max/Pro subscription via OAuth, avoiding additional API billing.11MIT