mcp-server-eia
Provides AI agents with structured access to the U.S. EIA Open Data API for energy data including power plants, operations, fuel prices, projections, and state CO2 emissions.
README
mcp-server-eia
Model Context Protocol server for the U.S. EIA Open Data API — domain tools for plants, operations, retail and historical fuel spot prices, AEO projections, and state CO₂ (not raw route mirrors).
Give any AI agent structured access to U.S. energy data from the Energy Information Administration (EIA Open Data API v2).
Scope: stateless live calls to the EIA API only — no database, no hosted projections. Tools return a consistent { "data", "meta" } shape so agents can rely on stable fields.
Prerequisites
- Python 3.11+ (see
requires-pythoninpyproject.toml) - A free EIA API key (below)
- An MCP client that supports stdio (Cursor, Claude Desktop, etc.)
API key
- Register: EIA Open Data registration.
- Recommended: set
EIA_API_KEYin the MCP serverenv(see below). Keys stay out of the repo; each machine uses its own key. - Optional: for a terminal,
export EIA_API_KEY=...beforepython -m mcp_server_eia.
Do not commit API keys or paste them into issues/PRs.
Cursor / Claude Desktop / any stdio MCP host
Point the client at this repo’s Python module and pass your key in env:
{
"mcpServers": {
"eia": {
"command": "python3",
"args": ["-m", "mcp_server_eia"],
"cwd": "/absolute/path/to/mcp-server-eia",
"env": {
"EIA_API_KEY": "paste-your-key-here"
}
}
}
}
cwdmust be the folder where you clonedmcp-server-eia(so imports resolve afterpip install -e .).- Optional: add
"EIA_AEO_RELEASE": "2025"toenvif you need a different AEO release path than the default.
Where to edit config: Cursor — MCP settings (UI or JSON, depending on version). Claude Desktop — macOS: ~/Library/Application Support/Claude/claude_desktop_config.json. Windows: %APPDATA%\Claude\claude_desktop_config.json (path may vary slightly by version).
Why not call the EIA API directly?
- Fuel types are coded (
BIT,NG, …), not “coal” and “gas”. - Plant inventory is generator-level; useful answers need aggregation to plant.
- AEO data uses table IDs, scenario codes, and region facets that are hard to guess.
- This server wraps those details behind nine domain tools and a stable
{ "data", "meta" }response shape.
Quick start (install)
git clone https://github.com/abrose1/mcp-server-eia.git
cd mcp-server-eia
python3 -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
Then add the MCP JSON block above (or export EIA_API_KEY for a one-off terminal run).
Troubleshooting
| Issue | What to check |
|---|---|
| Import / module errors | cwd in MCP config must be the repo root (where pyproject.toml lives). Re-run pip install -e ".[dev]" in that environment. |
401 / invalid key |
Key typo, or key not passed in env / shell. |
Slow calls or 429 |
EIA rate-limits heavy use; back off and retry. This server retries transient errors; sustained 429s need a pause or fewer parallel tools. |
Tools
| Tool | Purpose |
|---|---|
search_power_plants |
EIA-860 inventory aggregated to plants (fuel, state, capacity, status). |
get_plant_operations |
EIA-923 facility-fuel: generation, fuel use, CF, heat rate. |
get_plant_profile |
860 + recent 923 in one response. |
get_generation_mix |
EIA-923 electric-power-operational-data: headline generation mix by fuel (coal, gas, nuclear, hydro, renewables, petroleum, other) for U.S. or a state; annual or one month. |
get_capacity_by_fuel |
EIA-860 operating-generator-capacity: nameplate MW summed by energy source with plant counts (not plant-level search). |
get_electricity_prices |
electricity/retail-sales by state/sector. |
get_aeo_projections |
AEO national fuel prices or regional EMM series (prices, capacity, emissions). |
get_fuel_prices |
Historical spot/market fuel prices: natural gas (Henry Hub, U.S. citygate/wellhead), coal by basin (coal/market-sales-price), crude WTI/Brent (petroleum/pri/spt). Not the same as AEO category=fuel_prices. |
get_steo_forecast |
STEO (Short-Term Energy Outlook) 18-month forecasts with historical actuals (monthly or quarterly). |
get_state_co2_emissions |
SEDS state CO2 (million metric tons) by sector/fuel group. |
Example prompts (natural language)
get_fuel_prices returns historical benchmark (spot/market) fuel prices:
| Example prompt | What you’ll get |
|---|---|
Henry Hub natural gas spot prices for 2024 by month |
natural_gas + henry_hub + monthly |
Citygate natural gas prices (U.S.) for 2022 monthly |
natural_gas + citygate + monthly |
U.S. wellhead acquisition price trend, annual from 2018 to 2022 |
natural_gas + wellhead + annual |
Coal open-market price in the Powder River Basin, annual from 2020 through 2023 |
coal + powder_river + annual |
WTI spot crude oil price monthly for 2023 |
crude_oil + wti + monthly |
Brent crude spot price daily in January 2024 |
crude_oil + brent + daily |
get_steo_forecast returns STEO historical actuals + forecast:
| Example prompt | What you’ll get |
|---|---|
natural_gas_price forecast by month for the next 18 months |
natural_gas_price + monthly |
crude_oil_price forecast by quarter for the next 18 months |
crude_oil_price + quarterly |
electricity_demand forecast by month for the next 18 months |
electricity_demand + monthly |
natural_gas_price forecast by quarter |
natural_gas_price + quarterly |
STEO series keys: natural_gas_price, crude_oil_price, electricity_demand; frequency is monthly or quarterly.
Plant IDs must be STATE-plantid (e.g. OH-3470), not a bare numeric code.
Development
pytest
ruff check src tests
Live API smoke test (optional)
After pip install -e ., set EIA_API_KEY (same as in MCP env) and run:
export EIA_API_KEY=your-key
python scripts/smoke_eia.py
This hits the real EIA API (tens of seconds), checks two different plants for get_plant_operations, and exercises every tool (including get_generation_mix, get_capacity_by_fuel, and get_fuel_prices). Use before releases or after changing EIA integration code. CI runs unit tests only; smoke needs EIA_API_KEY locally.
Contributing
Issues and PRs welcome. Run pytest, ruff check src tests, and (if you touch EIA calls) python scripts/smoke_eia.py with your key before submitting.
Related
Project Burnout — a separate web dashboard (Burnout / Stranded Assets) that explores US fossil plants using EIA-backed data and its own hosted stack. It is a different product from this MCP server: no shared install, and this repo’s tools are for live EIA API access from MCP clients, not the Burnout app UI.
Releases
See CHANGELOG.md and tags on GitHub.
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.