Inspiration
In Spain, millions of homes are on PVPC, a regulated tariff whose price changes every hour; the UK, the Nordics and many US utilities offer similar dynamic or time-of-use plans. The same dishwasher cycle can cost two to three times more in the evening peak than at night, yet almost nobody opens a price chart before pressing Start. The kitchen already has the right interface: a voice assistant. We wanted Alexa+ to answer "when should I…?" with a time and a number.
What it does
GridShift is a self-hosted MCP server that gives Alexa+ three tools:
- price_outlook: "Is electricity expensive right now?" Current price and level, the cheapest 3-hour stretch ahead, the hour to avoid, and an hourly series for screens such as Echo Show.
- find_best_time: "Charge my car before 7 am." The cheapest start time at 15-minute resolution inside the user's window, the cost versus starting now, and the percentage saved.
- plan_my_day: "Plan my laundry and the car tonight." Schedules several appliances at their cheapest times without exceeding the home's contracted power limit (in Spain 4.6 kW is typical, and running the dryer and the car charger together trips the breaker). The dryer always runs right after the washing machine, and it estimates monthly savings.
Every response carries a speech field written to be spoken ("tomorrow at 2 AM", "8 cents") plus typed structured content for agents and screens.
How we built it
- MCP server in Python with the official MCP Python SDK v2, served over Streamable HTTP at
/mcp. It negotiates protocol 2026-07-28 and accepts 2025-11-25 clients (both handshakes tested). Tools declare annotations (read-only, idempotent, open-world) and output schemas; there is also a resource (appliance catalog) and a prompt (morning energy briefing). - Live data: Spain's PVPC prices from Red Eléctrica's public e·sios daily file (no API key). The parser matches aiopvpc, the library behind Home Assistant's PVPC integration, including 23- and 25-hour daylight-saving days. A time-of-use mode covers US/UK plans, and a sample mode keeps demos working offline.
- Planner: exact cost integration over hourly prices, a 15-minute start grid and a greedy power-aware scheduler.
- Alexa+ simulator: a FastAPI web app with browser speech recognition and synthesis. Its agent is Amazon Nova Pro on Amazon Bedrock (Converse API with tool use). MCP tool schemas are passed to Bedrock unchanged and every call goes to the MCP server over HTTP, the way Alexa+ calls a brand integration. An "Under the hood" panel shows each MCP call with its structured result, and the price chart highlights the planned runs.
Challenges we ran into
- Turning numbers into speech: ISO timestamps and "€/kWh" are unreadable aloud, so every tool composes its own short sentence.
- Daylight-saving days have 23 or 25 hourly prices; we anchor on local midnight converted to UTC so the repeated hour is priced correctly.
- Tomorrow's prices are only published in the evening, so the tools say so instead of guessing.
- Scheduling under a power cap: the cheapest hour for each appliance is not a valid plan if they all overlap.
Accomplishments that we're proud of
- A full voice round-trip: speech in, Nova on Bedrock, MCP over Streamable HTTP, live grid prices, speech out.
- Answers you can act on in one sentence, with the saving in money, not a chart.
- Power-limit-aware planning, a real pain point for Spanish households.
What we learned
MCP tool schemas map one-to-one onto the Bedrock Converse tool format, so a brand can serve Alexa+ and any other agent from the same server. Designing for voice changes the API: the most useful output field turned out to be a sentence.
What's next for GridShift
- Act on the plan: start smart plugs and EV chargers through Alexa+ routines.
- Proactive "cheap hour starting now" notifications; solar, home-battery and CO₂ awareness.
- More live markets (UK Agile, US real-time pricing, Nordics) behind the same three tools.
Built With
- amazon-bedrock
- amazon-nova
- amazon-web-services
- html5
- javascript
- mcp
- model-context-protocol
- pydantic
- python
- web-speech-api
Log in or sign up for Devpost to join the conversation.