loading…
Search for a command to run...
loading…
Connects Claude Desktop to the Enphase Developer API v4 for read-only access to solar production, consumption, battery, and EV charger data, with optional write
Connects Claude Desktop to the Enphase Developer API v4 for read-only access to solar production, consumption, battery, and EV charger data, with optional write tools for battery settings and EV charging.
An MCP server connecting Claude Desktop to the official Enphase Developer API v4. Read-only by default; battery and EV-charger writes available behind an opt-in flag. No password scraping — clean OAuth 2.0 access to your own system data.
30 read tools (always on), grouped by purpose:
| Group | Tools |
|---|---|
| Overview | get_systems, get_system_summary, get_latest_telemetry, get_live_data, get_devices |
| Lifetime totals | get_lifetime_production, get_lifetime_consumption, get_lifetime_battery, get_lifetime_grid_import, get_lifetime_grid_export |
| Telemetry (intervals) | get_production_telemetry, get_consumption_telemetry, get_battery_telemetry, get_grid_import_telemetry, get_grid_export_telemetry |
| Events / health | get_events, get_open_events, get_alarms, get_open_alarms, get_event_types |
| Read-only config | get_battery_settings, get_storm_guard_settings, get_grid_status, get_load_control_settings |
| EV charger | get_ev_charger_devices, get_ev_charger_events, get_ev_charger_lifetime, get_ev_charger_telemetry, get_ev_charger_sessions, get_ev_charger_schedules |
3 write tools (opt-in via ENPHASE_ENABLE_WRITES=1):
| Tool | What it changes |
|---|---|
update_battery_settings |
Modifies battery mode/reserve/schedules |
start_ev_charging |
Starts an Enphase IQ EV charger |
stop_ev_charging |
Stops an Enphase IQ EV charger |
These change physical equipment behavior with no undo. Leave them off unless you specifically want LLM-driven control of your hardware.
https://api.enphaseenergy.com/oauth/redirect_uri (default)Log in at https://enlighten.enphaseenergy.com — your system ID is in the URL:
https://enlighten.enphaseenergy.com/web/{SYSTEM_ID}/today
(If you don't know it yet, leave it blank in .env and use get_systems once the server is running to discover it.)
cd enphase-mcp
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
# Edit .env and fill in API key, client ID, client secret, system ID
# (Optional) uncomment ENPHASE_ENABLE_WRITES=1 to expose write tools.
python auth_setup.py
The script prints an authorization URL. Make sure you're already logged into Enlighten in the same browser, then open the URL, approve access for your own system. You'll be redirected to a page showing your authorization code. Copy it and paste into the terminal.
This creates tokens.json with your access and refresh tokens. From there, the client auto-refreshes on every API call.
Edit claude_desktop_config.json:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json{
"mcpServers": {
"enphase": {
"command": "/absolute/path/to/enphase-mcp/.venv/bin/python",
"args": ["/absolute/path/to/enphase-mcp/server.py"]
}
}
}
Restart Claude Desktop fully (⌘Q on macOS, not just close-window). You should see a tools indicator in the chat input. Ask things like "how much did we produce today vs. yesterday?" or "what was our peak production day this month?".
python auth_setup.pyIf you don't query Enphase weekly, you can run keepalive.py on a schedule to keep the refresh token alive. It calls /systems once and logs to keepalive.log. On macOS, drop a LaunchAgent at ~/Library/LaunchAgents/com.enphase-mcp.keepalive.plist pointing at the venv's Python and keepalive.py, with StartInterval set to 259200 (3 days) — that gives ~4 days of slack inside the 7-day inactivity window. Load it with launchctl bootstrap gui/$(id -u) <plist>.
The Enphase v4 API surface is documented at https://developer-v4.enphase.com/docs and the full Swagger spec is at https://developer-v4.enphase.com/swagger/spec/System_API.json (47 endpoints; this server wraps most of them but skips per-microinverter telemetry, heat-pump endpoints, multi-system search, and a few specialized meter-reading endpoints).
To add one, drop a new method into server.py following the existing pattern:
@mcp.tool()
def my_new_tool(some_param: str) -> dict:
"""What this returns."""
sid = client.require_system_id()
return client.get(f"/systems/{sid}/some_endpoint", params={"x": some_param})
401 on certain endpoints: Plan-tier issue. Most reads work on Watt; some require Kilowatt+.
404 on battery / EV-charger endpoints: You don't have that hardware on your system.
406 on the auth URL: You're not logged into Enlighten in the browser. Log in first, then re-open the auth URL.
"No tokens found": Run python auth_setup.py.
Claude doesn't see the tools: Check the Claude Desktop logs at ~/Library/Logs/Claude/ (macOS) or %APPDATA%\Claude\logs\ (Windows). Most issues are absolute-path problems in claude_desktop_config.json.
Add this to claude_desktop_config.json and restart Claude Desktop.
{
"mcpServers": {
"enphase-solar-mcp-server": {
"command": "npx",
"args": []
}
}
}