DR

da-real-frog/powerwall-mcp-agent

Developer tools
0 stars 0 forks Quality 40 Trend 20

Trying to figure how to configure my batteries based on weatger forecast

Overview

Trying to figure out how to configure my batteries based on the weather forecast. An AI workflow lab integrating Model Context Protocol (MCP), local Tesla Powerwall telemetry, multi-array solar forecasting (Open-Meteo), National Weather Service alerts, and an LLM agent running on either Gemini or Claude. - server/: Python FastMCP server exposing the Powerwall status, the 3-array solar forecast and active weather alerts as MCP tools over streamable HTTP. See server/README.md. - client/: chat.py, an interactive terminal chat for asking Claude questions through the server's tools, and an agent client that discovers those tools, calls them, and recommends a backup reserve for the night. The LLM provider (Gemini or Claude) is selected in its .env file. See client/README.md. - web/: Home Chat, a chat page for phones on the home Wi-Fi. It runs on percula, keeps the Claude API key there, and on an iPhone is added to the Home Screen like an app. See web/README.md.

README

Powerwall MCP Agent

Trying to figure out how to configure my batteries based on the weather forecast.

An AI workflow lab integrating Model Context Protocol (MCP), local Tesla Powerwall telemetry, multi-array solar forecasting (Open-Meteo), National Weather Service alerts, and an LLM agent running on either Gemini or Claude.

Project Structure

  • server/: Python FastMCP server exposing the Powerwall status, the 3-array solar forecast and active weather alerts as MCP tools over streamable HTTP. See server/README.md.
  • client/: chat.py, an interactive terminal chat for asking Claude questions through the server’s tools, and an agent client that discovers those tools, calls them, and recommends a backup reserve for the night. The LLM provider (Gemini or Claude) is selected in its .env file. See client/README.md.
  • web/: Home Chat, a chat page for phones on the home Wi-Fi. It runs on percula, keeps the Claude API key there, and on an iPhone is added to the Home Screen like an app. See web/README.md.
  • bridge/: Setting up a Raspberry Pi in the garage as a bridge so the server can reach the gateway’s local API over its TEG Wi-Fi. See bridge/README.md.
  • server/site.toml: The physical layout (arrays, panels, strings and Powerwall+ inputs) from the Tesla permit plans.
  • .github/workflows/ci.yml: Lint, unit tests and a secret scan on every pull request, on GitHub-hosted runners.
  • .github/workflows/deploy.yml: Rebuilds and restarts the server’s Docker container on a self-hosted runner whenever server/ changes on main; deploy-web.yml does the same for web/.

Quick Start

  1. Start the server (see server/README.md), or let the deploy workflow do it.
  2. Point the client at it with MCP_SERVER_URL and run uv run client.py from client/.
  3. To ask your own questions, run uv run chat.py from client/ for an interactive chat in the terminal, or open http://percula.local:8080 on a phone at home (see web/README.md).

.env files hold credentials and are ignored by git; each README lists the variables it needs.

More to follow as I will then start collecting the status of all strings and compare them against the solar forecast…

View this README on GitHub

Install

This server does not publish a one-line install command.

Open the repository installation guide