π v1.0.0 - First Production Release
π REE MCP Server v1.0.0
First production-ready release! Access Spanish electricity data through Claude using natural language.
β¨ What's Included
π οΈ MCP Tools (5)
Query Spain's electricity grid data with simple natural language:
get_indicator_data- Fetch time-series data for any of 1,967+ indicatorslist_indicators- Browse all available REE indicators with metadatasearch_indicators- Find indicators by keyword (e.g., "solar", "precio", "demanda")get_demand_summary- Quick demand overview for any dateget_generation_mix- Generation breakdown by source at specific times
π MCP Resources (2)
ree://indicators- Complete indicator catalogree://indicators/{id}- Individual indicator metadata
ποΈ Architecture Highlights
Built with industry best practices:
- β Domain-Driven Design (DDD) - 4 clean layers (Domain, Application, Infrastructure, Interface)
- β Clean Architecture - Dependencies point inward, domain has zero external deps
- β SOLID Principles - All 5 implemented throughout the codebase
- β Type Safety - 100% type-annotated, passes mypy strict mode
- β NO Mocking - Domain tests use pure functions (no mocks/stubs)
- β Comprehensive Testing - 59 tests covering all layers (unit, integration, e2e)
β‘ Production-Ready Features
- π Automatic retry with exponential backoff for transient failures
- π‘οΈ Comprehensive error handling with domain-specific exceptions
- β Type-safe configuration using Pydantic Settings
- β‘ Async/await for optimal performance
- π Context managers for proper resource cleanup
- π Structured logging with detailed error messages
π Data Access
Access 1,967+ electricity indicators including:
β‘ Real-Time Data (5-minute updates)
- Electricity demand (real-time and forecasts)
- Generation by source (nuclear, wind, solar, hydro, coal, gas)
- Market prices (SPOT, PVPC rates)
- COβ emissions tracking
- International exchanges (imports/exports)
π Common Indicators
1293- Real Demand (Peninsular)2038- Wind Generation (National)1295- Solar PV (Peninsular)549- Nuclear Generation600- SPOT Market Price10355- COβ Emissions
π Installation & Setup
Quick Start (3 minutes)
# Clone and install
git clone https://github.com/ESJavadex/ree-mcp.git
cd ree-mcp
uv venv && source .venv/bin/activate
uv pip install -e ".[dev]"
# Configure
cp .env.example .env
# Edit .env with your REE_API_TOKEN
# Add to Claude Code
./INSTALL_COMMAND.shVerify Installation
claude mcp list
# Should show: ree-mcp: β Connectedπ¬ Example Usage
Open Claude Code and try:
- "Show me the current electricity demand in Spain"
- "What's the generation mix right now?"
- "Compare solar vs wind generation today"
- "Investigate what happened on April 28, 2025"
- "Search for price indicators"
Claude will automatically use the REE MCP tools to fetch and analyze the data!
π Documentation
- README.md - User guide with Quick Start and examples
- CLAUDE.md - Developer guidance for contributing
- API Reference - Common indicator IDs and usage patterns
- Installation Script - Automated Claude Code setup
π Learn More
Created by Javi Santos - AI & Robotics Specialist with published research in computer vision and LLM interpretability.
π Join La Escuela de IA
Learn AI without the fluff! Spanish AI learning community with real-world projects.
π skool.com/la-escuela-de-ia-9955
πΊ YouTube Channel
AI tutorials, MCP servers, and LLM applications.
π @JavadexAI
π€ Connect
- LinkedIn: Javi Santos
- YouTube: @JavadexAI
π§ Technical Details
Requirements:
- Python 3.11+
- REE API token (demo token included)
Dependencies:
- fastmcp 0.2.0+
- httpx 0.27.0+
- pydantic 2.10.0+
- pydantic-settings 2.6.0+
Development:
- pytest, pytest-asyncio, pytest-cov
- mypy (strict mode)
- ruff (linting & formatting)
π License
This project is for educational and research purposes. The REE API is provided by Red ElΓ©ctrica de EspaΓ±a.
π Acknowledgments
- REE (Red ElΓ©ctrica de EspaΓ±a) for providing the eSios API
- FastMCP for the excellent MCP framework
- Anthropic for Claude and the Model Context Protocol
π Issues & Support
- Issues: GitHub Issues
- REE API: consultasios@ree.es
- FastMCP: https://github.com/jlowin/fastmcp
Built with β€οΈ using Domain-Driven Design and modern Python best practices
β Star this repo if you find it useful!