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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。