MCP Energy Hub
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
β‘ MCP Energy Hub
Real-Time Energy Grid Intelligence for Carbon-Aware AI
Enterprise-grade MCP server providing real-time US power grid intelligence for carbon-aware AI compute scheduling
π Documentation β’ π Quick Start β’ π€ Contributing β’ π License
π― The Problem
AI compute is exploding, but the grid isn't always green.
Data centers consume 1-2% of global electricity and growing rapidly
AI training runs can emit as much CO2 as 5 cars over their lifetime
Most AI workloads run without awareness of grid carbon intensity
Enterprises lack tools to schedule compute when renewables are high
Related MCP server: US ISO Grid MCP
π‘ The Solution
MCP Energy Hub is an enterprise-grade MCP server that gives AI agents real-time visibility into the US power grid, enabling carbon-aware compute scheduling.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π€ AI Agent (Claude, etc.) β
β β β
β βββββββββββΌββββββββββ β
β β MCP Protocol β β
β βββββββββββ¬ββββββββββ β
β β β
β βββββββββββββββββΌββββββββββββββββ β
β β β‘ MCP Energy Hub β β
β β βββββββββββββββββββββββββββ β β
β β β 8 MCP Tools for Energy β β β
β β β Grid Intelligence β β β
β β βββββββββββββββββββββββββββ β β
β βββββββββββββββββ¬ββββββββββββββββ β
β β β
β βββββββββββββββ¬ββββββββββββΌββββββββββββ¬ββββββββββββββ β
β βΌ βΌ βΌ βΌ βΌ β
β βββββββ βββββββ βββββββ βββββββ βββββββ β
β βERCOTβ βCAISOβ β PJM β βNYISOβ βMISO β β
β βTexasβ βCalifβ β Mid β β NY β βMidwest β
β βββββββ βββββββ βββββββ βββββββ βββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¨ Key Features
Feature | Description |
π 7 Grid Regions | ERCOT, CAISO, PJM, NYISO, MISO, SPP, ISONE |
β‘ Real-Time Data | Live from EIA (US Energy Information Administration) |
π± Carbon Intensity | kg CO2/MWh for each region, updated hourly |
π Generation Mix | Natural gas, coal, nuclear, wind, solar, hydro |
π’ Data Center Tracking | Energy estimates, PUE, AI workload impact |
π― Smart Scheduling | Find the greenest region for your compute |
π AI Impact KPIs | Track AI's share of grid load |
π MCP Native | Full Model Context Protocol support |
π οΈ MCP Tools
8 Tools for Energy Intelligence
Tool | Description | Use Case |
| Real-time grid metrics | Monitor current load & generation |
| Carbon intensity + recommendation | Carbon-aware scheduling |
| Load & carbon forecast | Plan future workloads |
| Available grid regions | Discover coverage |
| Data center info | Track facilities |
| Energy consumption estimates | Audit energy use |
| AI compute KPIs | Measure AI's grid footprint |
| Find greenest region | Optimize for carbon/cost |
Example: Carbon-Aware Scheduling
# AI Agent asks: "Where should I run this training job?"
result = mcp.call_tool("get_best_region_for_compute", {
"optimize_for": "carbon"
})
# Response:
{
"recommendation": "CAISO",
"reason": "Lowest carbon intensity at 180 kg CO2/MWh",
"rankings": [
{"region": "CAISO", "carbon": 180, "renewable_pct": 45},
{"region": "ERCOT", "carbon": 320, "renewable_pct": 28},
{"region": "PJM", "carbon": 420, "renewable_pct": 12}
]
}π Quick Start
Prerequisites
Python 3.11+
EIA API Key (free)
Installation
# Clone the repository
git clone https://github.com/your-username/mcp-energy-hub.git
cd mcp-energy-hub
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env and add your EIA_API_KEYRun the Server
# Start the FastAPI server
python -m uvicorn app.main:app --reload --port 8000
# Or run the standalone MCP server (for Claude Desktop)
python mcp_server.pyTry the API
# Get carbon intensity for Texas grid
curl -X POST http://localhost:8000/mcp/tools/call \
-H "Content-Type: application/json" \
-d '{"name": "get_grid_carbon", "arguments": {"region_id": "ERCOT"}}'Example Response
{
"success": true,
"result": {
"region_id": "ERCOT",
"timestamp": "2024-11-28T22:00:00Z",
"carbon_intensity_kg_per_mwh": 320.5,
"renewable_fraction_pct": 28.3,
"recommendation": "Good - Moderate carbon intensity"
}
}Connect to Claude Desktop
Add to your Claude Desktop MCP settings (claude_desktop_config.json):
{
"mcpServers": {
"energy-hub": {
"command": "python",
"args": ["/absolute/path/to/mcp-energy-hub/mcp_server.py"],
"env": {
"EIA_API_KEY": "your-api-key-here"
}
}
}
}π API Endpoints
Endpoint | Method | Description |
| GET | Interactive Swagger UI |
| GET | MCP server information |
| GET | List all MCP tools |
| POST | Execute an MCP tool |
| GET | List grid regions |
| GET | Real-time metrics |
| GET | Carbon intensity |
| GET | Health check |
ποΈ Architecture
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MCP Energy Hub β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββ β
β β FastAPI β β MCP Server β β Data Ingestion β β
β β REST API β β (8 Tools) β β (EIA Collector) β β
β ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββββ¬ββββββββββ β
β β β β β
β βββββββββββββββββββΌβββββββββββββββββββββ β
β β β
β ββββββββΌβββββββ β
β β SQLite DB β β
β β Grid Metricsβ β
β βββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β External Data Sources β
β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β
β β EIA β β ERCOT β β CAISO β β PJM β β
β β API β β API β β API β β API β β
β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββπ Real-World Impact
For Enterprises
Reduce carbon footprint by scheduling AI workloads during high-renewable periods
Cost optimization by running compute when energy prices are low
ESG reporting with accurate AI energy consumption data
For AI Developers
Carbon-aware training - Train models when the grid is green
Transparent impact - Know your model's carbon footprint
Automated scheduling - Let AI agents make green decisions
Potential Impact
If 10% of AI workloads shifted to low-carbon periods: ~500,000 tons CO2/year saved
Real-time visibility enables 30-50% carbon reduction for flexible workloads
π§ Tech Stack
Component | Technology |
Backend | FastAPI, Python 3.11 |
Database | SQLite (HF) / PostgreSQL (Production) |
MCP Protocol | Native implementation |
Data Source | EIA Open Data API |
Deployment | Docker, Hugging Face Spaces |
π Project Structure
mcp-energy-hub/
βββ app/
β βββ main.py # FastAPI application
β βββ config.py # Configuration
β βββ api/routes/ # REST endpoints
β βββ mcp/ # MCP server implementation
β β βββ server.py # MCP protocol handler
β β βββ tools.py # Tool definitions
β β βββ routes.py # HTTP MCP endpoints
β βββ ingestion/ # Data collectors
β β βββ eia_collector.py # EIA API integration
β βββ models/ # Database models
βββ mcp_server.py # Standalone MCP server (stdio)
βββ Dockerfile # HuggingFace deployment
βββ README.md # This fileοΏ½ Docker Deployment
# Build the Docker image
docker build -t mcp-energy-hub .
# Run the container
docker run -p 8000:8000 -e EIA_API_KEY=your-key mcp-energy-hubπ§ͺ Testing
# Run tests
pytest
# Run with coverage
pytest --cov=app --cov-report=htmlπ€ Contributing
Contributions are welcome! Please see our Contributing Guidelines for details.
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
π Acknowledgments
Anthropic - For creating the MCP protocol
EIA - For open energy data APIs
FastAPI - For the excellent web framework
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Links
οΏ½ MCP Protocol: modelcontextprotocol.io
β‘ EIA Open Data: eia.gov/opendata
π Report Issues: GitHub Issues
Made with β€οΈ for sustainable AI
Helping AI compute become carbon-aware, one query at a time β‘π±
β Star this repo if you find it useful!
This server cannot be deployed
Maintenance
Related MCP Connectors
Live U.S. electric-grid data, forecasts, alerts, and analysis across major grid regions.
Live US power market prices, load, generation, weather and permits for AI agents.
Protocol-native energy infrastructure orchestration for AI data centers. Provides 46 MCP tools across 8 grid protocols (IEC-61850, DNP3, Modbus, OCPP, OpenADR, IEEE 2030.5, IEC 60870-5-104, ICCP) with 5 core API primitives: connect, dispatch, settle, comply, and intel. Enables AI agents to programmatically interact with substations, grid interfaces, and energy assets for real-time workload-grid coordination.
Real-time electricity prices for AI agents. 40+ countries, 100+ zones. No auth required.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides real-time electricity grid data including CO2 intensity, power mix, and wholesale prices, plus optimal green time windows for energy-intensive AI tasks. Supports UK, Germany, and global regions with optional API keys.9MIT
- AlicenseNot gradedqualityBmaintenanceEnables real-time access to US electricity generation, fuel mix, and demand data through natural language queries.186 npmMIT
- AlicenseNot gradedqualityFmaintenanceEnables querying of real-time and forecast UK carbon intensity data from National Grid ESO, allowing AI agents to retrieve carbon emissions by region and time.3 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables users to query current and historical UK electricity carbon intensity, generation mix, and regional intensity data to schedule energy-intensive tasks during low-carbon periods.409 npmMIT