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.

February 4, 2026 16:00 CET 1:32:00
pythonmcpai-agentsenergyapiseurope

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.

Multi-country price comparison dashboard with France, Spain, Italy, and Switzerland

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.

ENTSO-E Transparency Platform showing European electricity market data

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

MCP server architecture connecting AI agents to ENTSO-E API

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.

MCP server code with tools for querying ENTSO-E data

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:

First successful query: comparing electricity prices across European countries

Structured JSON response with country codes, dates, and price summaries

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:

Using the ENTSO-E tool directly from Claude.ai via Cloudflare tunnel

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:

Interactive energy dashboard for Spain rendered inside Claude.ai

Multi-country comparison with France, Spain, Italy, and Switzerland — all without leaving the chat interface.

Reference

MCP tools

ToolParametersDescription
get_pricescountry, start_date, end_dateDay-ahead electricity prices (EUR/MWh)
get_flowsfrom_country, to_country, datesCross-border flows between countries (MW)
get_generationcountry, dateGeneration mix by source type (MW)
aggregate_pricescountry, dates, operationAggregations: mean, min, max, median
compare_pricescountries, dates, operationSide-by-side country comparison
list_countries12 supported European countries

Supported countries

DE, FR, ES, PT, NL, IT, PL, DK, GB, BE, AT, CH

Project structure

src
mcp_server.py# MCP server (auto-generated from FastAPI)
api.py# REST API endpoints (FastAPI)
client.py# ENTSO-E API wrapper (entsoe-py)
entsoe_service.py# Business logic + caching (Parquet)
app.py# HTTP server entry point
mcp-app
src/mcp-app.ts# Dashboard (Chart.js + MCP App SDK)
src/mcp-app.html# Dashboard UI
data/cache# Parquet cache files

Stack

  • Python 3.13 / FastMCP / FastAPI / entsoe-py / pandas / pyarrow
  • TypeScript / Chart.js / MCP App SDK
  • Cloudflare Quick Tunnel (deployment)

Resources

Table of Contents
Search sections

Subscribe to our newsletter

Get weekly insights on data, automation, and AI.

© 2026 Datons. All rights reserved.