Vibe Coding #2 - AI Agent for European Energy Data | ENTSO-E API with Python
Built MCP tools that let AI agents query the ENTSO-E Transparency Platform. Natural language interface to cross-border flows, day-ahead prices, and generation data across 35+ European countries — deployed to Claude.ai with an interactive dashboard.
Get weekly updates
Live coding sessions, Python libraries for energy data, and hands-on tutorials. One email per week, zero fluff.
Result
Ask “Where is the cheapest electricity in Europe today?” and get a structured comparison across 12 countries — with an interactive dashboard rendered inside Claude.ai.

The problem
- ENTSO-E Transparency Platform has incredible data on European electricity markets, but accessing it requires understanding complex XML-based APIs
- Navigating country codes, bidding zones, and document types is tedious
- Every new question means writing custom Python scripts to parse and transform the data
The solution
Started from the ENTSO-E Transparency Platform — the official source for European electricity market data covering 35+ countries with cross-border flows, day-ahead prices, and generation breakdowns.

The goal: build an MCP (Model Context Protocol) server so an AI agent can query all of this data through natural language.

Building the MCP server
Claude Code scaffolded the project from the presentation slides — reading the agenda, generating a plan, and building the code structure. The key architectural decision was using FastMCP with FastMCP.from_fastapi() to auto-generate MCP tools from a FastAPI REST API, avoiding code duplication between the API and MCP layers.

The entsoe-py library wraps the raw XML API into clean pandas DataFrames. On top of that, an ENTSOEService class handles caching (memory + Parquet files) so repeated queries don’t hit the API:
# Fetch once from API, cache as Parquet for future queries
prices = service.get_day_ahead_prices("DE", start_date, end_date) First results
After refactoring the raw text returns to structured JSON responses, the agent could compare electricity prices across multiple countries in a single query:


Deploying for non-coders
To let colleagues who don’t code use the tool, we deployed via a Cloudflare Quick Tunnel and connected it to Claude.ai as an MCP connector — no Python installation needed on their end:

Interactive dashboard with MCP apps
The final step was building an MCP app — a TypeScript + Chart.js dashboard rendered inside Claude.ai. Select countries from a dropdown, and the dashboard fetches and visualizes prices in real time:

Multi-country comparison with France, Spain, Italy, and Switzerland — all without leaving the chat interface.
Reference
MCP tools
| Tool | Parameters | Description |
|---|---|---|
| get_prices | country, start_date, end_date | Day-ahead electricity prices (EUR/MWh) |
| get_flows | from_country, to_country, dates | Cross-border flows between countries (MW) |
| get_generation | country, date | Generation mix by source type (MW) |
| aggregate_prices | country, dates, operation | Aggregations: mean, min, max, median |
| compare_prices | countries, dates, operation | Side-by-side country comparison |
| list_countries | — | 12 supported European countries |
Supported countries
DE, FR, ES, PT, NL, IT, PL, DK, GB, BE, AT, CH
Project structure
Stack
- Python 3.13 / FastMCP / FastAPI / entsoe-py / pandas / pyarrow
- TypeScript / Chart.js / MCP App SDK
- Cloudflare Quick Tunnel (deployment)
Resources
- ENTSO-E Transparency Platform - Official European energy data source
- entsoe-py - Python client for the ENTSO-E API
- FastMCP - Library for building MCP servers
- MCP Documentation - Model Context Protocol specification
- MCP Apps - Interactive apps inside AI clients