mcp-edf
Read-only access to EDF Suivi Conso data for a home: authenticate, inspect contracts, and query electricity/gas usage, weather, comparisons, and EDF estimates.
Check auth status, log in/out, and manage stored login/silent renewal via Safari on macOS.
Retrieve EDF contracts: tariff option, subscribed kVA, gas tariff, and history.
Get electricity consumption in kWh/€ per day or month, split by tariff heading.
Get electricity load curve at 30m/1h and daily peak kVA versus subscribed power.
Get gas consumption in kWh/m³/€ per day or month.
Get weather (temperature and sky) aligned with consumption dates.
Compare years or periods, including EDF's qualitative weather verdict for electricity.
Get EDF's modelled usage breakdown and monthly electric-heating estimate.
Make raw read-only GET requests to other Suivi Conso API paths.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-edf What was my electricity consumption last month in kWh and euros?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@mgcrea/mcp-edf
A Model Context Protocol server for EDF Suivi Conso, the consumption pages of EDF's French customer area: daily and monthly electricity (Linky) and gas (Gazpar) consumption in kWh and in euros, the 30-minute load curve, daily peak power, and the contracts behind them.
It reads; it never writes. There are no mutating tools to enable.
How it talks to EDF. EDF offers no API to its customers. This server uses the same JSON API the Suivi Conso website (suiviconso.edf.fr) uses, after the same EDF login, and borrows that website's own login client to do it. It sends the same requests a browser on that site would, at a similar volume. It is not endorsed by EDF, and it can break whenever EDF changes the site.
Tools
Tool | What it does |
| Signed in or not, which home it reads, where the login is stored |
| Logs in through a Safari tab (macOS); later renewals happen on their own |
| Revokes the login at EDF, deletes it locally, and stops silent renewal |
| Electricity option (BASE / HPHC / TEMPO…), subscribed kVA, gas tariff, history |
| kWh and € per day or month, split by tariff heading, with totals |
|
|
| Daily peak kVA against the subscribed power |
| kWh, m³ and € per day or month, with the conversion factor |
| Daily (with sky) or monthly temperature at the home's weather station |
| Each month against the same month last year, electricity or gas |
| Electricity in two periods, with EDF's warmer/colder weather verdict |
| EDF's modelled split by use (heating, hot water…), and monthly electric heating |
| GET any other Suivi Conso API path (raw JSON) |
None of the comparisons is weather-adjusted: EDF gives a qualitative verdict (warmer or colder, higher or lower) and the temperatures, and the analysis is left to whoever reads them. The usage breakdown is EDF's model, fed by the home profile declared on Suivi Conso, so it lags behind new equipment until that profile is updated.
Costs are EDF's own estimate at the contract's prices, taxes included, as shown on Suivi Conso. They follow the bill closely, but they are not the invoice. Invoices are not available through this API.
Related MCP server: data-odre
Logging in
There is nothing to configure. Ask your agent to call edf_auth_login:
It opens the EDF login in a background Safari tab. If Safari is already signed in to EDF, the login completes on its own within a second or two.
Otherwise Safari comes forward after two seconds, and you log in as usual.
The first time, macOS asks whether the app running the server (your editor, a terminal, or Bastion) may control Safari. Allow it. That grant is how the server reads the one-time code from the tab's address.
Why Safari automation. EDF registers exactly one redirect for this client,
https://suiviconso.edf.fr/openid, so there is no localhost callback to listen on. The page at
that address uses up the code as soon as it loads. The server polls the tab's address every
20 ms and closes the tab the moment the code arrives, before the page can use it.
How long a login lasts. An EDF login is a 20-minute access token, kept in
~/.config/edf/tokens.json (mode 600). EDF does issue a refresh token with it, but that token is
valid for about one second (measured: a refresh 0.8 s after login works, one at 1.5 s is refused),
so it cannot keep a login alive. What lasts is EDF's web session in Safari. When the 20 minutes
are up, the next tool call renews the login silently through Safari: a background tab opens and
closes itself within a second, without bringing Safari forward (0.8 to 0.9 s measured). That
keeps working for as long as Safari stays signed in to EDF, and EDF ends that session after about
20 minutes without use (there is no "stay signed in" option). So a login carries through a working
session, but not through a longer break. Once Safari's EDF session has expired, the silent renewal
fails once, stops trying, and the tools answer signedIn: false: call edf_auth_login again, and
log in in the tab it opens.
EDF_SILENT_RELOGIN=0 turns silent renewal off. Each login then lasts exactly 20 minutes.
The login tab opens in a regular Safari window, never a Private Browsing one: Safari hides private tabs' addresses from automation, and a private window has none of your EDF cookies.
Without macOS. edf_auth_login also takes a redirect_url: the address the browser lands
on after logging in, https://suiviconso.edf.fr/openid?code=…. The Suivi Conso page strips the
code within a second, so you have to copy the address before the page runs, for example with
JavaScript disabled for that site. Such a login lasts 20 minutes: silent renewal needs Safari.
Configure (all optional)
Variable | Description |
| The home to read, as part of its address (e.g. |
|
|
| Where the login is stored. Defaults to |
| A JSON config file with the same settings ( |
| Retries for 401 / 429 / 5xx. Default 3. |
| Per-request timeout. Default 30000. |
|
|
The environment wins over the config file, field by field.
Quick start
pnpm install
pnpm build{
"mcpServers": {
"edf": { "command": "node", "args": ["/absolute/path/to/mcp-edf/dist/cli.js"] }
}
}Develop
pnpm dev # tsdown --watch
pnpm test # vitest, against recorded and anonymised Suivi Conso responses
pnpm typecheck
pnpm lint
pnpm formatAPI notes
The Suivi Conso API's traps are documented in the code at the point where each is handled:
Date formats differ by endpoint (
src/client/time.ts):beginTs,beginDateandtswant2026-11-01T00:00:00+01:00;begin-datewants2026-11-01;begin-monthwants2026-11.
v1 and v2 are not interchangeable. Each endpoint lives in exactly one, and the wrong one answers 404.
Site headers. Every
/sites/-/…call needs theperson-ext-idandsite-ext-idheaders (src/client/edf.ts). Without them it answers 401.
Publish
pnpm dlx release-it # bump, commit, tag
git push --follow-tags # CI publishes to npm from the tagLicense
MIT
Available Tools
13 toolsedf_auth_loginEDF: LoginAIdempotent
Sign in to EDF. On macOS this opens the EDF login in a Safari tab and catches the one-time code when EDF redirects back: if Safari is already signed in to EDF it completes in a second or two with nothing to do; otherwise Safari comes forward and the user logs in as usual. The first run triggers macOS's 'allow to control Safari' prompt. Waits up to wait_seconds, then keeps listening in the background for 5 minutes: call edf_auth_status afterwards. Elsewhere, pass redirect_url instead (see that argument). Logging in again replaces the stored login. An EDF login lasts 20 minutes; after that the server renews it silently through Safari while Safari stays signed in to EDF, so calling this again is only needed when a tool answers signedIn: false.
Inputs: redirect_url, wait_seconds.
edf_auth_logoutEDF: LogoutADestructiveIdempotent
Revoke the stored access token at EDF (best effort) and delete it locally, which also ends silent renewal: no Safari tab opens until the next edf_auth_login. It does not sign Safari out of EDF. Recoverable by calling edf_auth_login again.
Inputs: no named parameters.
edf_auth_statusEDF: Auth StatusARead-only
Whether the server is signed in to EDF, which home it reads (the login picks the account, and an account can hold several homes), when the 20-minute login runs out and how it is renewed, and where it is stored. Signed out, returns the steps to sign in. Call this first when a data tool answers signedIn: false. Like any tool call, it may renew a lapsed login silently through Safari (a background tab that closes itself).
Inputs: no named parameters.
edf_compare_periodsEDF: Compare PeriodsARead-only
Electricity used in one period against a reference period (by default the same dates a year earlier), with EDF's weather verdict: whether the period was warmer, similar or colder than the reference, and whether consumption was higher, similar or lower. Use it to ask "did we use more this summer than last, and was it hotter?". The verdict is qualitative and reads temperature only: the kWh are NOT weather-adjusted, and in summer "colder" just means cooler, which lowers a cooling load rather than raising a heating one. Electricity only; EDF answers FLUID_NOT_SUPPORTED for gas, so use edf_compare_years with energy=gas plus edf_get_weather there.
Inputs: from (required), to, reference_to, reference_from.
edf_compare_yearsEDF: Compare YearsARead-only
Each month of a year against the same month of the year before, from EDF's own comparison: kWh and euros both years and the change in %, for electricity or gas. total_complete_months sums only months present in both years. EDF rounds to whole kWh and euros. These are raw figures, NOT weather-adjusted: pair them with edf_get_weather (step=month) to tell a colder winter from a change in the home, or use edf_compare_periods for EDF's weather verdict on electricity.
Inputs: energy (required), year.
edf_get_contractsEDF: ContractsARead-only
The home's EDF contracts. Electricity: the tariff option (BASE, HPHC for peak/off-peak, TEMPO…), the subscribed power in kVA and EDF's tariff code, as a history of versions, since EDF writes a new one at every price or option change; current is the one in force. For options with off-peak hours, the meter's calendar (e.g. "HC 01:30-07:00"). Gas: tariff code, consumption option and price zone, or null with no gas contract. Call it to learn the option before reading costs by tariff heading.
Inputs: no named parameters.
edf_get_electricity_consumptionEDF: Electricity ConsumptionARead-only
Electricity used per day or per month, in kWh and in euros, from the Linky meter via EDF Suivi Conso. Each row has the total cost, the daily share of the subscription (standing_charge_eur), and, on a peak/off-peak or Tempo contract, the split by tariff heading. total sums the range and gives the average price per kWh. Costs are EDF's own estimate at the contract's prices, taxes included; they track the bill closely but are not the invoice. Rows flagged nature other than REAL are estimates. Use step=month for anything over a few months: a year of days is ~25 kB.
Inputs: from (required), to, step.
edf_get_electricity_load_curveEDF: Electricity Load CurveARead-only
The Linky load curve: energy per 30 minutes (or per hour) as compact rows of [start, kWh, average kW], with the range total and the peak interval. Use it to see when power is drawn (night vs day, a heater, a car charging); use edf_get_electricity_consumption for daily or monthly totals and costs. Paris local times. At most 7 days at 30m, 31 days at 1h, since a single day is 48 rows. The curve only exists if load-curve collection is switched on for the meter (it is on Suivi Conso's hourly view).
Inputs: from (required), to, resolution.
edf_get_electricity_max_powerEDF: Electricity Max PowerARead-only
The highest power drawn each day, in kVA, as [date, max_kva] rows, with the range maximum and the subscribed power of the current contract to compare against. Use it to decide whether the subscription (e.g. 6, 9, 12 kVA) is too high or close to tripping. The meter's history goes back years; this filters it to the range asked.
Inputs: to, from.
edf_get_gas_consumptionEDF: Gas ConsumptionARead-only
Gas used per day or per month from the Gazpar meter via EDF Suivi Conso: kWh, m³, the conversion factor between them, and euros (energy plus the daily share of the subscription). total sums the range. Costs are EDF's estimate at the contract's prices, taxes included. Daily figures need a communicating Gazpar meter and arrive a day or two late; months are available further back. Answers 404 on an account with no gas contract.
Inputs: from (required), to, step.
edf_get_usage_breakdownEDF: Usage BreakdownARead-only
EDF's ESTIMATE of where the energy went over the last 12 months, by use (heating, hot water, cooking, fridge and freezer, washing, lighting…), in kWh, euros and %. For electricity it adds EDF's estimate of electric heating per month as [month, kWh, €] rows. This is a model (model names EDF's algorithm) fed by the home profile declared on suiviconso.edf.fr, not a measurement: profile_declares_air_conditioning shows one profile field that changes it most. A profile that predates new equipment skews it, so update the profile on the site first. For measured figures use the consumption tools.
Inputs: energy (required).
edf_get_weatherEDF: WeatherARead-only
The weather at the home's weather station, as Suivi Conso shows it beside the consumption: the average outdoor temperature per day (to 0.1 °C) with the sky (sunny, sunny spells, overcast, light rain…), or per month (whole °C). Use it to read consumption against the weather: heating demand follows the temperature, cooling the heat, and a sunny day lowers heating needs. The sky is one coarse label per day; for sunshine hours or solar radiation use an external weather archive. Same Paris-time days as the consumption tools, so rows line up with edf_get_electricity_consumption and edf_get_gas_consumption.
Inputs: from (required), to, step.
edf_requestEDF: RequestARead-only
Escape hatch: GET any Suivi Conso API path for this home, returning the raw JSON (cut at 60,000 characters). GET only; the same login and home headers as the other tools. Prefer the dedicated tools: their output is shaped, this one's is not. Paths seen in the Suivi Conso site include /v2/sites/-/elec-price-changes (beginTs, endTs), /v1/sites/-/billing-windows (fluids=ELEC,GAS), /v2/sites/-/elec-tariff-calendars (date=2026-11-11, a bare date), /v1/sites/-/usage-breakdowns (ts, fluid=ELEC|GAS), /v2/sites/-/forecast-consumptions (beginDate, endDate, fluid, strategy=ESTIMATION_AFTER_REAL). - stands for the current home. Some endpoints are v1 and others v2, and a wrong version answers 404.
Inputs: path (required), query.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Each tool targets a distinct data slice (gas vs electricity consumption, load curve, max power, contracts, weather), and descriptions explicitly cross-reference each other ("use edf_get_electricity_consumption for daily or monthly totals", "prefer the dedicated tools" over edf_request). The only real overlap is edf_compare_years vs edf_compare_periods, which both answer consumption comparisons and differ mainly by output shape and gas support; the descriptions help but an agent could still pick either for an electricity year-over-year question.
All tools use a uniform snake_case `edf_` prefix with consistent verb/object phrasing: `edf_auth_*` for the session lifecycle and `edf_get_*` for data retrieval, plus `edf_compare_*` for comparisons. No camelCase or mixed verb styles anywhere.
13 tools is squarely in the well-scoped range for a read-only energy-data server: four auth/lifecycle tools, six shaped data readers, two comparators, and one escape hatch. Nothing appears redundant or padded.
The read surface is thorough — auth lifecycle (status/login/logout), contracts, electricity/gas consumption, load curve, max power, weather, comparisons, usage breakdown — with edf_request as a genuine catch-all for endpoints like billing-windows and price-changes. Minor gaps remain: no dedicated invoices/price-change tool, no forecast-consumption tool, and no way to list or switch between the several homes an account can hold, all of which would otherwise need raw edf_request calls.
Maintenance
Related MCP Connectors
Read-only electricity, gas, and weather data with structured provenance and units.
EVM chain reads for agents: balances, gas, fees, blocks, txs, logs, ENS. 15 tools, x402 per call.
Paid Electricity Market & Grid Intelligence API via x402. Unpaid tool calls return 402.
LLM API prices and AI agent cost estimates, verified daily. Read-only cost lookup tools.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceProvides read-only access to Shelly Cloud energy data, including live power, lifetime energy, and historical consumption with cost, enabling AI agents to monitor electricity usage without device control.1-
- AlicenseNot gradedqualityCmaintenanceProvides tools to search, inspect, and query energy open data from ODRE (electricity & gas production, consumption, grid load, renewables) using natural language or direct tool calls.57 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to access and analyze Spanish electricity consumption data via the Datadis API, providing tools for supply management, consumption analysis, anomaly detection, and executive reporting.MIT
- AlicenseAqualityCmaintenanceEnables read-only access to a customer's Enedis Linky electricity meter data, so an agent can answer questions about daily and period consumption, half-hourly load curves, and peak power. Every call is logged, and no writes or meter changes are possible.4MIT