Enphase Solar MCP Server
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.
README
Enphase Solar MCP Server
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.
What you get
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.
Plan and hardware caveats
- Subscription plan. The free Watt plan covers system details + site-level production/consumption — enough for most of the read tools. Per-device telemetry, storm guard, and some battery endpoints may require Kilowatt or higher. A 401 on a specific tool usually means "upgrade your plan."
- Hardware required. Battery tools need an Enphase IQ Battery / Encharge. EV charger tools need an Enphase IQ EV charger (Tesla Wall Connectors and 3rd-party chargers are invisible to Enphase). A 404 from one of these usually means "you don't have that device."
- API errors propagate as-is so you can tell which case you're hitting.
Prerequisites
- Python 3.11+
- An Enphase Enlighten account with your system
- An Enphase Developer account at https://developer-v4.enphase.com (free Watt plan is enough — 1,000 calls/month)
Setup
1. Register a developer app
- Sign up at https://developer-v4.enphase.com
- Subscribe to the Watt plan (free)
- Create a new application
- Set the Redirect URI to
https://api.enphaseenergy.com/oauth/redirect_uri(default) - Note your API Key, Client ID, and Client Secret
2. Find your System ID
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.)
3. Install
cd enphase-mcp
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
4. Configure credentials
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.
5. Run the one-time auth flow
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.
6. Connect to Claude Desktop
Edit claude_desktop_config.json:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%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?".
Token refresh behavior
- Access tokens last 1 hour
- Refresh tokens last ~1 week of inactivity — any API call resets the timer
- If refresh fails, re-run
python auth_setup.py
Optional: automated keepalive
If 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>.
Adding more endpoints
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})
Troubleshooting
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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。