aivy-mcp
OfficialAn MCP server for AI assistants to read, analyze, and (with a control key) manage an Aivy solar + battery system.
Sign up or sign in from chat and store an API key locally.
List sites, inspect live SOC/power flows, site facts, power history, earnings, operations, and Amber prices.
Connect or disconnect inverter/battery systems across vendors such as Sungrow, Sigenergy, FoxESS, AlphaESS, and SolaX.
Create/delete threshold alerts and review alert events; send test alert emails.
Read or change energy mode: self-consumption, Ai+, AU student strategies, or time-boxed forced charge/discharge windows.
Read and tune Ai+ settings and engine variants.
Plan discharge to a target SOC or best-price selling, then apply through forced mode with confirmation.
Preview, start, update, inspect, and end AI-written strategies under server-enforced leases and limits.
Use the built-in agent playbook and interactive cards where supported; writes need control scope and confirmation.
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., "@aivy-mcp What are prices doing tonight? Should I sell?"
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.
aivy-mcp
An MCP server that lets your own AI assistant (Claude Code, Claude Desktop, ChatGPT, Codex, Cursor, ...) read and control your own solar + battery system through the Aivy Developer API by Ivy Energy.
Works with every brand Aivy runs: Sungrow, Sigenergy, FoxESS, AlphaESS, SolaX and more. The same tools, whatever the inverter.
1. Get a key (or let the chat do it)
In the chat. Add the server without any key (step 2) and say "sign me up
to Aivy" or "sign in to my Aivy account". The assistant walks through the
terms, the emailed code and the permission level (read only, or read and
control), and the server stores the key on your computer
(~/.aivy/credentials.json, readable by you only). The key is never shown
in the chat.
On the web. Open bridge.ivyenergy.com.au/developer,
sign up or sign in, and create a key. Pick Read only to let an assistant
look, or Read and control to let it change the energy mode, Ai+ settings
and connect systems. Then pass it as AIVY_API_KEY (step 2). The key sees
exactly what your account sees, nothing more.
No hardware yet? Every key also lists demo sites (sandbox:..., replayed real
data); mode and Ai+ changes on them are kept for your account only and never
reach hardware, so you can try everything first. Accounts and keys can also
be created from the API itself; see the
Quickstart.
Related MCP server: victron-tcp
2. Add the server
Claude Desktop, no terminal: download aivy-mcp-<version>.mcpb from the
latest release and
open it; Claude Desktop installs it as an extension with the Aivy icon, and
fetches the server with its own uv. Then say "sign me up to Aivy".
(mcpb/build.py builds that file from the released package.)
One line (macOS, Linux; installs uv if missing, then writes the server
into every MCP client it finds: Codex, Claude Code, Claude Desktop, Cursor):
curl -fsSL https://raw.githubusercontent.com/IVYEnergy/aivy-mcp/main/install.sh | shAlready have uv? uvx --from aivy-mcp@latest aivy-mcp-setup does the same, and
aivy-mcp setup --client codex --key aivy_sk_... targets one client or
stores an existing key. Files are backed up before they change. Restart the
client, then say "sign me up to Aivy". An assistant that can run shell
commands (Claude Code, Codex) can run the line for you.
Or by hand. Claude Code (drop -e AIVY_API_KEY=... to sign up or sign in from the chat instead):
claude mcp add aivy -e AIVY_API_KEY=aivy_sk_... -- uvx aivy-mcp@latestCodex (~/.codex/config.toml):
[mcp_servers.aivy]
command = "uvx"
args = ["aivy-mcp@latest"]
# optional: [mcp_servers.aivy.env] AIVY_API_KEY = "aivy_sk_..."Claude Desktop / Cursor / any MCP client (mcpServers block):
{
"mcpServers": {
"aivy": {
"command": "uvx",
"args": ["aivy-mcp@latest"],
"env": { "AIVY_API_KEY": "aivy_sk_..." }
}
}
}No uv? pipx run aivy-mcp or pip install aivy-mcp && aivy-mcp work too.
Updating. aivy-mcp@latest makes uv check PyPI every time the client
starts the server, so restarting the client is the update. An entry written
before 0.11.3 ran plain uvx aivy-mcp, which uv keeps at the version it
first resolved: run the one-line installer again and it rewrites the entry
(key kept), or edit it by hand. The Claude Desktop extension pins its
version: open the new .mcpb from the latest release. The server checks
PyPI once per start and, when a newer release exists, the playbook
(get_agent_guide) ends with a short update note the assistant passes on;
AIVY_MCP_NO_UPDATE_CHECK=1 turns that off.
Assistants that cannot run local tools (ChatGPT in the browser) can use the HTTP API directly. Paste this into the chat:
Use the Aivy Developer API at https://bridge.ivyenergy.com.au/v1 with the header
Authorization: Bearer aivy_sk_.... Read https://bridge.ivyenergy.com.au/v1/llms.txt first, then GET /sites.
3. Ask
"How's my battery doing?"
"Why did it charge at 3am?"
"What are prices doing tonight? Should I sell?"
"Plan the best time to sell tonight, keep 20%, then apply it."
"Charge at 5 kW to 90% for the next two hours." (control key)
"Make Ai+ a bit more aggressive on exports." (control key)
"Connect my Sungrow inverter, serial A2340000001, NMI 2001234567." (control key)
"Email me when the battery drops below 20%."
"I want to write my own strategy: sell above 40c, charge when import goes negative, hold overnight." (control key; the AI writes the rules, you approve)
For agents: the playbook
Tool descriptions say what each call does. The playbook says how to get a job done with them: which tools answer which questions, when to stop and confirm, how forced mode and its hand-back work, what each error means, and the step-by-step workflows (status, diagnosis, prices, earnings, selling tonight, keeping a reserve, charging now, connecting a system, Ai+ tuning). It is one text, delivered four ways:
Where | How to use it |
MCP tool | Any MCP client: the server's instructions ask the model to call it once per conversation. |
Claude Code / Claude skill | Copy |
Codex, Cursor, other rule files | Paste |
HTTP-only assistants (ChatGPT in the browser) | Tell it to read https://bridge.ivyenergy.com.au/v1/agent-guide.md first. |
Checking an agent against it
evals/cases.json holds conversation cases (the user's
words, the tools a good agent calls in order, the ones it must not call, and
whether the turn has to end in a question). evals/check.py
judges a transcript:
# Claude Code, headless, with the server configured as "aivy":
claude -p "Sell at the best prices tonight, keep 20%." --output-format stream-json > t.json
python evals/check.py sell-tonight-propose t.jsonA transcript can also be a plain list: [{"name": "get_status", "args": {}}],
or {"calls": [...], "text": "final reply"}. Run the cases after changing
the playbook, the tool descriptions or the model.
Cards in chat
Hosts that render MCP Apps (and ChatGPT through its Apps SDK) show sixteen of the tools as cards instead of text, in the same style as the Aivy mobile app, light and dark:
Tool | Card |
| SOC ring and the four power flows (solar, home, grid, battery) |
| Buying / selling now, the next hours as bars, the best hours to sell highlighted |
| The sell plan (revenue headline, the chosen windows on a timeline) or the hold-a-reserve plan, with an Apply button; the click is the user's yes and calls |
| A sign-up / sign-in form: email, password, permission level and the terms are entered in the card and sent to Aivy by the card itself, never through the chat |
| Control panel: today's windows on a 24-hour bar, the pending hand-back, mode buttons and a manual charge / discharge form; under Ai+, its levers as sliders and switches built from the engine's own ranges, with Save. A click is the user's yes |
| Connect a system: pick the brand, enter what it needs (or sign in at the vendor), see the new site appear |
| Power history: solar, home, battery, grid lines with SOC |
| A day's net, earned, cost, exported and imported, hour by hour |
| Timeline of what the platform did and why |
| Alert rules with Delete, and a form to add one; called with the rule the person asked for, the form comes filled in and one click adds it |
| The same card, already showing the rule just added (marked new) or the remaining rules |
| Your sites with a Status button each |
| Strategy mode: the rules the AI wrote in plain words, what they would do right now, the lease and the limits, with Start; then the running strategy with its last action, recent decisions and Stop |
Every card is one self-contained HTML document (no network, no assets), so
it works under the extension's default content security policy. Hosts
without the extension get the same data as JSON. To look at the cards
locally: node tests/ui/shoot.mjs (needs playwright).
Tools
Tool | Changes anything? | What it does |
| no | The playbook above |
| account only | Create an Aivy account from the chat; the key is stored locally |
| account only | Create and store a key for an existing account (password used once) |
| no | Your sites (ids look like |
| no | Live SOC and power flows, with the site's capacity, limits, timezone and mode |
| no | 5-minute or daily history |
| no | A day's energy, priced at Amber's actual prices |
| no | What the platform did and why |
| no | Amber prices now and forecast |
| no | Alert rules on a site and the 20 most recent firings |
| account only | Threshold alerts to inbox, push and email; never control the battery |
| no | Supported brands and what connecting one needs |
| yes | Link the user's system (serial + NMI, system id, or an OAuth link to open) |
| yes | Remove a site from the account |
| no | Mode, windows, pending hand-back; Ai+ variant, settings and tunable ranges |
| yes | selfConsumption / amber_smart (Ai+) / au_forecast_export, au_negative_price, au_smart_energy, au_weather_season (AU-01..04 student strategies) / forced (time-boxed); without a mode, change Ai+ levers or variant |
| no | Propose a sell schedule from the forecast ( |
| no | Strategy mode: what is running |
| yes | Preview the AI-written rules against the readings (a dry run), then run them or replace the running ones; stop them. Nothing starts without the previewed |
What the server enforces, whatever the assistant does
A key sees only its owner's sites; writes need the control scope.
A forced (manual) mode set through the API always reverts to the previous mode after
duration_minutes(default 4 h, max 24 h).A strategy written by the AI runs on a lease (default a day, max a week), may change the action at most three times an hour, treats stale readings as
auto, and hands the site back to its previous mode when it ends.The SOC floor and grid export limits cannot be overridden.
Every call is recorded with the key id and client; keys can be revoked in the app at any time and stop working immediately.
Per-key rate limit (default 120/min). Readings refresh about once a minute.
Development
git clone https://github.com/IVYEnergy/aivy-mcp && cd aivy-mcp
uv run --with pytest pytest
uv run aivy-mcp # needs AIVY_API_KEYThe package also lives in Ivy Energy's main repository under sdk/aivy-mcp;
this public repository is where it is released from.
Point at another deployment with AIVY_API_URL=https://host/v1.
License
Apache License 2.0. See LICENSE.
Available Tools
23 toolsconnect_siteConnect a systemA
CHANGES THE ACCOUNT (control scope). Confirm with the user before calling.
Link the user's system to their Aivy account. Serial-number vendors (Sungrow and FoxESS need sn + nmi, Sigenergy needs system_id, most others sn) return connected site ids. OAuth vendors (AlphaESS, SolaX) return an authorize_url: give it to the user to open in a browser and approve; the site then appears in list_sites within a minute. Demo sites need no connecting.
Inputs: vendor (required), sn, nmi, region, +1 more. Returns: result
create_alertAdd alertA
Set up a threshold alert on a site: it fires when the watched metric crosses the threshold. Every firing goes to the app inbox (and the phone when the app is installed); email=True also mails the account's verified address (list_sites account.email_alerts says whether that works). An alert only tells the person something; it never changes what the battery does. Confirm the rule with the user before creating it (or let them add it from the list_alerts card). Returns the site's rules with the new one under created.
Inputs: name (required), metric (required), site_id (required), operator (required), +7 more. Returns: object
delete_alertRemove alertADestructiveIdempotent
Retire an alert rule (past firings stay in the inbox). Confirm with the user first. Returns the site's remaining rules with the removed id under deleted.
Inputs: rule_id (required), site_id (required). Returns: object
disconnect_siteDisconnect a systemADestructiveIdempotent
CHANGES THE ACCOUNT (control scope). Confirm with the user before calling.
Remove a site from the user's account. The vendor-side link and history are left alone; the account just stops seeing it. Demo sites cannot be removed.
Inputs: site_id (required). Returns: result
end_strategyStop strategyADestructiveIdempotent
Stop the running strategy now; the site goes back to the mode it had before it started. Confirm with the person first unless they asked for it.
Inputs: site_id (required). Returns: object
get_agent_guideAgent playbookARead-onlyIdempotent
The Aivy agent playbook: which tools answer which questions, the rules for writes (confirm first, forced mode is time-boxed, never guess numbers, do not poll), the step-by-step workflows (status, diagnosis, prices, earnings, selling tonight, keeping a reserve, charging now, connecting a system, Ai+ tuning) and what each error code means. Read it once at the start of a conversation. When a newer aivy-mcp is released, a short update note follows the playbook.
Inputs: no named parameters. Returns: result
get_curvePower historyARead-onlyIdempotent
Power and SOC history of a site: 5-minute points for one local day, or daily values over the last 7 or 30 days. Returns times (UTC), local_times, and series per channel (pv, load, battery, grid, soc). Large: summarise before quoting. For the reading right now use get_status.
Inputs: site_id (required), day, range. Returns: object
get_earningsDay earningsARead-onlyIdempotent
Energy bought, sold and self-consumed on one day, or in part of it, priced at the actual Amber half-hourly prices when Amber is linked. An estimate from vendor power samples, not the bill; read coverage and say so when it is partial.
Inputs: site_id (required), date, window_end, window_start. Returns: object
get_energy_modeEnergy modeARead-onlyIdempotent
How the site is run now and how Ai+ is configured.
Returns energy_mode (selfConsumption | amber_smart = Ai+ | au_* = the AU-01..04 student strategies | forced), time_slots (the forced windows), soc_floor_pct, the variant and settings in force, and reverts_at / reverts_to when a forced mode will hand back by itself.
ai_plus is the Ai+ configuration whether or not Ai+ is the mode: active, variant, variant_options, settings, and tunable (every lever with type, min, max, unit and default). Take ranges from it before changing Ai+ with set_energy_mode.
Hosts that support cards render a control card; a click on its buttons is the person's yes.
Inputs: site_id (required). Returns: object
get_operationsOperations logARead-onlyIdempotent
What the platform did to the site and why, newest first: each automatic (Ai+) and manual command with its reason and the prices at the time. Use it to explain 'why did it charge at 3am'.
Inputs: site_id (required), limit. Returns: object
get_pricesAmber pricesARead-onlyIdempotent
Amber Electric prices for the site: the current interval and the forecast as import price and feed-in earn (c/kWh incl. GST), with a summary of cheapest/dearest periods. Fails with 409 when no Amber account is linked to the site.
Inputs: site_id (required), hours, resolution. Returns: object
get_registration_termsSign-up termsARead-onlyIdempotent
Whether sign-up is open and the terms of use / privacy policy a new account accepts (version, hash and a link). Show the link to the person and ask whether they accept BEFORE register_account. Hosts that support cards render a sign-up / sign-in form here instead: the person types email and password into the card, which calls register_account / verify_registration / sign_in itself, so nothing passes through the chat. When the card is shown, wait for the person to say they are done.
Inputs: locale. Returns: object
get_statusSite statusARead-onlyIdempotent
What one site is doing now, and what it is.
Top level is the live reading: soc_pct, pv_w, load_w, grid_w (>0 exporting), battery_w (>0 charging), at, and source (vendor = fresh, stored = last kept reading). A null channel is one the vendor does not report, not zero. Refreshes about once a minute.
site holds the fixed facts: timezone, battery_capacity_kwh and its source, max_power_w, export_limit_w, soc_floor_pct (the floor Ai+ keeps), usable_kwh_now, the current energy_mode and time_slots, today's energy and income when reported. Take capacity and limits from here, never from an estimate.
A newly connected site may have no live reading yet: the facts still come back, with reading_error.
Inputs: site_id (required). Returns: object
get_strategyRunning strategyBRead-onlyIdempotent
Strategy mode on a site: the AI-written rules running now (name, rules, lease, last action, recent evaluations), status none when there has never been one, or ended with end_reason. limits is what the server enforces on every strategy.
Inputs: site_id (required). Returns: object
list_alertsAlert rulesARead-onlyIdempotent
Read the alerts on a site: the rules and what fired. Never creates or changes a rule.
rules: what each watches (soc %, import/export price c/kWh, forecast temperature °C), the threshold, whether it emails, when it last fired. events: the 20 most recent firings, newest first (rule, value, time, delivery). Answers "did anything happen overnight?".
To propose a NEW alert, pass it in the draft arguments (metric, operator and threshold at least). Nothing is saved: hosts with cards show the form filled in and the person's click on "Add alert" is their yes, so wait for them. Without a card, restate the rule and call create_alert once they agree.
Inputs: site_id (required), name, email, metric, +3 more. Returns: object
list_sitesMy sitesARead-onlyIdempotent
Start here: the user's solar + battery sites across vendors, and whose API key this is.
sites: for each, id (vendor:station_id, used by every other tool), vendor, name, online and the vendor's headline power in W. account: who the key belongs to, its scope (read, or control = may change settings) and email_alerts (whether alert emails can reach the account's verified address).
Without a key it says so (has_key false): register_account (new) or sign_in (existing account) then sets one up from the chat.
Inputs: no named parameters. Returns: object
list_vendorsSupported brandsARead-onlyIdempotent
Every inverter / battery brand Aivy can connect, whether it is available on this deployment, what connecting one needs (connect: serial + NMI, a system id, or an OAuth sign-in at the vendor) and how much of it can be controlled. Use before connect_site.
Inputs: no named parameters. Returns: object
plan_dischargeDischarge planARead-onlyIdempotent
Work out when and how hard to discharge. Calculates only: nothing is applied, a read key is enough.
goal='best_price' ("sell at the best prices tonight"): the best-paid Amber intervals between window_start and window_end for the energy above reserve_soc, optionally only above min_sell_c. Returns the intervals, expected revenue and the average it beats.
goal='target_soc' ("keep 30% for 9 pm"): one steady discharge from window_start (default now) that reaches target_soc at window_end; needs both of those; prices play no part. Returns power_w.
Both return proposed time_slots: apply with set_energy_mode(mode='forced', time_slots=...) after the user agrees. On hosts with cards the plan's Apply button is the user's yes.
Inputs: goal (required), site_id (required), min_sell_c, target_soc, +4 more. Returns: object
register_accountCreate account (step 1)A
Create an Aivy account from the chat, step 1 of 2: a verification code is emailed to email. Needs no API key. Ask the person to choose the password (8+ characters; it is also their Aivy app password); do not invent one. Then ask them for the code and call verify_registration. The reply looks the same whether or not the address already has an account: a code that never arrives means check spam or use sign_in instead.
Inputs: email (required), password (required), locale, display_name. Returns: result
set_energy_modeSet energy modeADestructive
CHANGES THE SITE (control scope). Confirm with the user before calling.
Switch how the site is run (pass mode), or tune Ai+ without switching (omit mode, pass settings and/or variant). A rejected value changes nothing; rejected says why.
mode=forced is manual and time-boxed: the site returns to its previous mode when duration_minutes is up. Give action for one window starting now, or time_slots. Refused (409) while a strategy is running, or when an au_* mode cannot run on the site. Takes effect within about a minute; the SOC floor and export limits hold. On a demo site (sandbox:...) nothing reaches hardware.
Inputs: site_id (required), mode, action, power_w, +6 more. Returns: result
sign_inSign inA
Use an existing Aivy account from the chat: creates an API key with the account's username (or email) and password, stores it on this computer (~/.aivy/credentials.json) and uses it from now on. Needs no existing key. The password is used once and not stored; never repeat the key back.
Inputs: password (required), username (required), scope, key_name. Returns: result
start_strategyPreview or start strategyADestructive
Preview or start a custom strategy: YOU write the rules from what the person wants. Two calls, the second needs the first.
accept_risk=false (default): starts nothing; dry-runs the rules on the current readings and returns a proposal_id. A card host shows a Start button that makes call 2 itself, so wait; otherwise read the rules back and ask.
accept_risk=true with that proposal_id and every other argument unchanged, only after the person said yes (control scope; demo sites dry-run). Refused without a matching proposal_id or after 15 minutes: preview again.
A strategy already running has its rules replaced by the same two calls.
Inputs: name (required), rules (required), site_id (required), summary, +4 more. Returns: object
verify_registrationCreate account (step 2)A
Create an Aivy account from the chat, step 2 of 2: confirms the emailed code, accepts the terms (only pass accept_terms=true after the person said yes), creates the account and an API key, and stores that key on this computer (~/.aivy/credentials.json) so every other tool works from now on, in this and future sessions. Never repeat the key back; say it is saved and can be managed at https://bridge.ivyenergy.com.au/account.
Inputs: code (required), accept_terms (required), registration_id (required), registration_session (required), +2 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Most tools target a distinct resource+action: status vs curve vs earnings vs prices vs operations are cleanly separated, and plan_discharge (read-only calculation) is explicitly contrasted with set_energy_mode (applies). Some boundaries blur — get_status already returns energy_mode/time_slots that get_energy_mode also covers, and the four auth tools (get_registration_terms, register_account, verify_registration, sign_in) require careful reading of the numbered steps to pick correctly.
Strong verb_noun pattern throughout: get_*, list_*, create_*, delete_*, start_*/end_*, connect_site/disconnect_site, set_energy_mode, register_account/verify_registration. Minor deviations are sign_in (verb+preposition) and plan_discharge, but both are conventional enough not to confuse.
23 tools sits at the heavy end of the range for a solar/battery control server. Several are defensible (alerts CRUD, strategy lifecycle), but get_agent_guide plus four separate auth/registration tools push it past what a typical session needs.
Covers the full lifecycle: onboarding (terms, register, verify, sign in), site connect/disconnect, monitoring (status, curve, earnings, operations, prices, vendors), alerts, strategy get/start/end, and energy-mode read/write with discharge planning. Minor gaps: no update_alert (must delete and recreate a rule) and no explicit site-removal of history or settings beyond Ai+ tuning.
Maintenance
Related MCP Connectors
Home energy for AI assistants: live Power flow, Energy history, solar forecast, and device control.
Control your Tesla from your AI assistant - climate, charging, access, and security.
Solar, weatherization, EV charging, battery and heat-pump decision tools for AI agents.
Real-time electricity price signals for AI agents. Spot prices, cheapest hours, and contract recommendations. 31 countries across Europe and Oceania. No authentication required.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to control and monitor Tesla vehicles via natural language through the Tessie API, supporting battery, climate, security, charging, and more.611MIT
- AlicenseAqualityBmaintenanceConnect AI assistants to Victron Energy systems to read real-time solar, battery, grid, and inverter data from your local network via Modbus TCP or MQTT.3222 npm7MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to monitor and control Tesla Powerwall 2 systems via local gateway API.18MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to monitor and control neoom BEAAM energy management systems, including solar production, battery, grid power, and device control via natural language.1ISC