Skip to main content
Glama

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 | sh

Already 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@latest

Codex (~/.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 get_agent_guide

Any MCP client: the server's instructions ask the model to call it once per conversation.

Claude Code / Claude skill

Copy skills/aivy into ~/.claude/skills/ (or a project's .claude/skills/).

Codex, Cursor, other rule files

Paste src/aivy_mcp/playbook.md into AGENTS.md or your rules.

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.json

A 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

get_status

SOC ring and the four power flows (solar, home, grid, battery)

get_prices

Buying / selling now, the next hours as bars, the best hours to sell highlighted

plan_discharge

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 set_energy_mode

get_registration_terms

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

get_energy_mode

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

list_vendors

Connect a system: pick the brand, enter what it needs (or sign in at the vendor), see the new site appear

get_curve

Power history: solar, home, battery, grid lines with SOC

get_earnings

A day's net, earned, cost, exported and imported, hour by hour

get_operations

Timeline of what the platform did and why

list_alerts

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

create_alert, delete_alert

The same card, already showing the rule just added (marked new) or the remaining rules

list_sites

Your sites with a Status button each

start_strategy, get_strategy, end_strategy

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

get_agent_guide

no

The playbook above

get_registration_terms, register_account, verify_registration

account only

Create an Aivy account from the chat; the key is stored locally

sign_in

account only

Create and store a key for an existing account (password used once)

list_sites

no

Your sites (ids look like sungrow:1445844) and whose key this is, read or control; says when there is no key yet

get_status

no

Live SOC and power flows, with the site's capacity, limits, timezone and mode

get_curve

no

5-minute or daily history

get_earnings

no

A day's energy, priced at Amber's actual prices

get_operations

no

What the platform did and why

get_prices

no

Amber prices now and forecast

list_alerts

no

Alert rules on a site and the 20 most recent firings

create_alert, delete_alert

account only

Threshold alerts to inbox, push and email; never control the battery

list_vendors

no

Supported brands and what connecting one needs

connect_site

yes

Link the user's system (serial + NMI, system id, or an OAuth link to open)

disconnect_site

yes

Remove a site from the account

get_energy_mode

no

Mode, windows, pending hand-back; Ai+ variant, settings and tunable ranges

set_energy_mode

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

plan_discharge

no

Propose a sell schedule from the forecast (goal: best_price) or a discharge that lands on a SOC at a time (goal: target_soc)

get_strategy

no

Strategy mode: what is running

start_strategy, end_strategy

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 proposal_id; the server keeps the limits and hands the site back when it ends

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_KEY

The 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 tools
connect_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 alertA
DestructiveIdempotent

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 systemA
DestructiveIdempotent

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 strategyA
DestructiveIdempotent

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 playbookA
Read-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 historyA
Read-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 earningsA
Read-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 modeA
Read-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 logA
Read-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 pricesA
Read-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 termsA
Read-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 statusA
Read-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 strategyB
Read-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 rulesA
Read-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 sitesA
Read-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 brandsA
Read-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 planA
Read-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 modeA
Destructive

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 strategyA
Destructive

Preview or start a custom strategy: YOU write the rules from what the person wants. Two calls, the second needs the first.

  1. 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.

  2. 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

    A3.9/5.0

    Scored across 23 tools

    Disambiguation4/5

    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.

    Naming Consistency4/5

    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.

    Tool Count3/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers