Case Study

PG&E Energy Analyzer

Solar + Battery Intelligence

Role
Creator & Developer
Platform
MCP Server (Claude, Cursor, etc.)
Stack
Python · FastMCP · Pyomo · pypowerwall
28
Tools
4
Rate Plans
Live
MCP Server

Overview

Upload your PG&E energy data. Have a conversation about it. Get real answers — the right rate plan, the right system size, the right battery strategy.

28 domain-informed tools encoding the full complexity of PG&E billing — rate schedules, CCA vs. bundled providers, PCIA vintage charges, NEM 2.0/3.0 export credits, time-of-use windows, and income tiers — so Claude gives accurate, personalized answers instead of hallucinating rates.

Also: Powerwall Control

If you have a Tesla Powerwall, the tool reads live status and controls your battery directly — switch modes, adjust reserve, enable grid charging, optimize dispatch. All through natural language in Claude.

“The right rate plan. The right system size. The right battery strategy.”
— The whole prompt
The Problem

Nobody knows what they actually pay per kWh

PG&E billing is extraordinarily complex. Your effective rate depends on your rate schedule, provider (bundled PG&E vs. Community Choice), PCIA vintage year, NEM version, time-of-use period, and income tier. Rates change roughly twice a year, and CCA rates change independently.

01
Solar Oversizing
Solar companies are paid to sell you the biggest system possible. The smarter approach is to understand your usage first — when you consume, how much is baseload vs. EV charging, what’s your peak exposure.
02
Billing Complexity
Rate schedules, CCA vs. bundled, PCIA vintage (20+ values), NEM version, TOU windows, income tiers — the same kWh costs 2–3x more during peak than off-peak. Most customers have no idea.
03
AI Without Context
Without this tool, Claude hallucinates rates, confuses CCA vs. bundled billing, guesses NEM 3 export values, misses TOU window differences, and breaks true-up math.
Why not just ask Claude?
ProblemWhat happens
Hallucinate ratesDoesn’t know EV2-A winter off-peak is $0.20635 for a PCE 2016-vintage customer
Confuse CCA vs. bundledPG&E bills show delivery rates, not total. Real formula: delivery + CCA generation + PCIA
Guess NEM 3 valuesThe Avoided Cost Calculator has 288 hourly values ($0.025–$0.28). AI guesses "$0.08"
Miss TOU differencesEV2-A peak is every day; E-TOU-D is weekdays only. Wrong windows = wrong math
Break true-up mathNEM credits accumulate monthly and settle annually. The true-up IS the bill
How It Works

Upload your data. Ask a question.

Download your Green Button data and latest bill from PG&E. Upload both to Claude. The tool takes it from there — detecting your solar system, asking about your battery, comparing rate plans, and finding where you're leaving money on the table.

1
Upload Your Data
Green Button CSV from PG&E (hourly usage) + latest bill PDF (rate plan, provider, NEM version, income tier).
2
Tool Detects Everything
Identifies your rate schedule, solar exports, provider (CCA vs. bundled), NEM version, PCIA vintage, and billing structure.
3
Full Analysis
Rate comparison, usage profiling, true-up projection, battery optimization, NEM transition impact — personalized to your actual data.
In Action
PG&E billing analysis in Claude — rate comparison, usage breakdown, and optimization recommendations

Upload your Green Button data and bill — get rate comparisons, usage breakdown, and actionable recommendations

Example Prompts
Best overall optimization
Here is my PG&E data and bill. What are the best ways to optimize my energy usage?
Rate plan check
Am I on the right rate plan?
NEM transition impact
My NEM 2 grandfathering expires next year. How much more will I pay?
True-up forecast
What will my true-up bill be this year?
Battery ROI
Would adding a second Powerwall save me money?
Battery scheduling
When should I charge and discharge my Powerwall to minimize costs?
Architecture

28 tools, four layers

Data ingestion that handles multiple formats, analysis tools for understanding your energy usage, Powerwall control for managing your battery, and a rate engine encoding the full complexity of PG&E billing.

Ingestion5 tools

Parse every data format a PG&E solar customer might have

Green Button hourly
PG&E hourly interval data with TOU classification and solar export detection
Green Button billing
Monthly bill totals with true-up detection and year-over-year comparison
Tesla monthly export
Tesla app CSV with auto-detected MWh/kWh unit normalization
Tesla 5-min power
Granular power data from tesla-solar-download — battery efficiency, cycle counting
Bill detail extraction
Validates rate schedule, provider, NEM version, vintage, and income tier against the rate engine

Analysis8 tools

Energy usage analysis, rate comparison, and optimization

Rate plan comparison
Annual cost across EV2-A, E-ELEC, E-TOU-C, E-TOU-D with TOU period breakdown
Usage profiling
Peak exposure, overnight baseload, seasonal patterns, worst import days
True-up projection
Monthly NEM balance accumulation and annual bill forecast
NEM 2 vs 3 comparison
Transition impact, credit loss by TOU period, worst months
Battery optimization
Mathematically optimal charge/discharge schedule (Pyomo MILP solver)
System simulator
Model adding panels, batteries, or changing dispatch strategy
Seasonal strategy
Season-specific recommendations for TOU shifting and battery use
Solar forecast
Production forecast via Solcast API for planning and optimization
Tesla Powerwall analysis in Claude — battery performance, solar production, and dispatch optimization

Add Tesla data for battery performance analysis, solar production tracking, and dispatch optimization

Powerwall6 tools

Live battery status and direct control via Tesla FleetAPI

Live status
Real-time power flow, battery %, grid status
Battery details
Per-battery health, temps, solar strings
Set mode
Self-consumption, autonomous, or backup
Set reserve
Adjust backup reserve 0–100%
Grid charging
Enable/disable charging from grid
Grid export
Battery+solar, solar only, or never

Rate EngineThe hard part

All rates verified against PG&E tariff sheets effective March 2026

4 rate schedules
EV2-A, E-ELEC, E-TOU-C, E-TOU-D with correct TOU windows
CCA vs. bundled
Provider rates — PCE fully supported, others in progress
20+ PCIA vintages
$0.030–$0.054/kWh charge, or credit for 2025+
NEM 2.0
Full retail export credits
NEM 3.0
288 hourly Avoided Cost Calculator values
Income tiers
Base services charges $0.20–$0.79/day
SchedulePeak WindowPeak DaysBest for
EV2-A4–9 PMEvery dayEV owners, battery systems, heat pumps
E-ELEC4–9 PMEvery dayAll-electric homes
E-TOU-C4–9 PMEvery dayDefault residential TOU
E-TOU-D5–8 PMWeekdays onlyShortest peak, weekday-only
Try It Live

Connect in 30 seconds

PG&E Energy Analyzer runs as a live MCP server. Connect it to Claude right now.

Setup Steps
1
Open claude.ai
2
Go to Settings → Connectors (or claude.ai/settings/connectors)
3
Click "Add custom connector"
4
Paste the server URL:
https://pge-energy-mcp.up.railway.app/mcp
Adding PG&E Energy MCP connector in Claude settings
Then just ask

“Here is my PG&E data and latest bill. Help me optimize my energy costs.”

Upload your Green Button CSV and bill PDF. The tool walks you through everything.

Open Source
github.com/Proprius-Labs/PGE-Energy-MCP
View on GitHub
How I Work

Built from personal frustration

This project started when I realized I had no idea what I was actually paying per kilowatt-hour — and neither did my solar installer. I read every PG&E tariff sheet, decoded the CCA billing structure, mapped the PCIA vintage system, and built the rate engine to make sure nobody else has to do the same detective work.

The Powerwall control layer came from wanting to actually act on the analysis — not just know the optimal dispatch schedule, but execute it. And the battery optimizer uses mixed-integer linear programming (Pyomo + CBC) because energy arbitrage with TOU rates, NEM credits, and reserve constraints is genuinely a hard optimization problem.

Like PocketScout, the design philosophy is the same: the gap in the MCP ecosystem isn't more API wrappers. It's domain expertise encoded into tool design — the rate engine that knows EV2-A winter off-peak is $0.20635 for a PCE 2016-vintage customer, the battery optimizer that understands NEM credits accumulate monthly and settle annually.

“The best tools don't just expose APIs. They encode domain knowledge into the interface between human intent and machine capability.”