Skip to main content
Glama
zen-tradings

EIA MCP Server

by zen-tradings
README.md
# EIA MCP Server

An MCP (Model Context Protocol) server for the U.S. Energy Information Administration (EIA) API, providing access to electricity and natural gas data.

## Features

### Electricity Data
- **Retail Sales** - Sales to customers by state and sector, pricing, and customer counts
- **Operational Data** - Monthly/annual generation, fuel consumption, and emissions
- **RTO Data** - Hourly/daily operations by balancing authority (CISO, PJM, MISO, ERCOT, etc.)
- **State Profiles** - State-level electricity profiles and infrastructure data
- **Generator Capacity** - Inventory of operable generators in the U.S.
- **Facility Fuel** - Individual power plant operational data

### Natural Gas Data
- **Summary** - Overview of natural gas survey data
- **Prices** - Spot prices, futures, citygate, residential, commercial, industrial prices
- **Exploration & Reserves** - Resource discovery and stockpile levels
- **Production** - Output metrics and production volumes
- **Imports/Exports** - Cross-border flows and pipeline movement data
- **Storage** - Inventory levels, injections, and withdrawals
- **Consumption** - End use data by sector

## Installation

```bash
cd eia-mcp
pip install -e .
```

## Configuration

1. Get an API key from [EIA Open Data](https://www.eia.gov/opendata/)
2. Set the environment variable:
   ```bash
   export EIA_API_KEY=your_api_key_here
   ```

## Usage with Claude Desktop

Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "eia": {
      "command": "python",
      "args": ["-m", "eia_mcp.server"],
      "cwd": "/Users/yanpan/eia-mcp",
      "env": {
        "EIA_API_KEY": "your_api_key_here"
      }
    }
  }
}
```

Or if installed as a package:

```json
{
  "mcpServers": {
    "eia": {
      "command": "eia-mcp",
      "env": {
        "EIA_API_KEY": "your_api_key_here"
      }
    }
  }
}
```

## Available Tools

| Tool | Description |
|------|-------------|
| `eia_electricity_retail_sales` | Get electricity retail sales data by state and sector |
| `eia_electricity_operational_data` | Get power generation and fuel consumption data |
| `eia_electricity_rto` | Get real-time grid operations by balancing authority |
| `eia_electricity_state_profiles` | Get state-level electricity profiles |
| `eia_electricity_generator_capacity` | Get generator inventory and capacity data |
| `eia_electricity_facility_fuel` | Get individual power plant data |
| `eia_natural_gas_summary` | Get natural gas summary data |
| `eia_natural_gas_prices` | Get natural gas price data |
| `eia_natural_gas_exploration_reserves` | Get exploration and reserves data |
| `eia_natural_gas_production` | Get production data |
| `eia_natural_gas_imports_exports` | Get import/export and pipeline data |
| `eia_natural_gas_storage` | Get storage facility data |
| `eia_natural_gas_consumption` | Get consumption data by sector |
| `eia_explore_routes` | Explore available API routes and metadata |

## Example Queries

Just ask Claude naturally:

- "What were California's electricity retail sales in 2024?"
- "Show me the current electricity generation in ERCOT"
- "What are the natural gas storage levels this week?"
- "How much electricity did Texas generate last month?"
- "Compare natural gas prices across different regions"
- "What's the electricity demand in PJM right now?"
- "Show me natural gas import/export data for 2024"

## API Reference

Base URL: `https://api.eia.gov/v2/`

For full API documentation, visit: https://www.eia.gov/opendata/documentation.php

TDQS

A3.6/5.0

Scored across 14 tools

Disambiguation5/5

Each tool has a clearly distinct purpose targeting specific EIA data categories like electricity facility fuel, generator capacity, retail sales, natural gas consumption, production, prices, etc. The descriptions specify unique data sources and metrics, with no overlapping functionality that would cause agent confusion.

Naming Consistency5/5

All tools follow a consistent eia_domain_data_pattern naming convention (e.g., eia_electricity_facility_fuel, eia_natural_gas_prices). The structure is uniform with domain (electricity/natural_gas) and specific data type clearly separated by underscores, making the set highly predictable and readable.

Tool Count5/5

With 14 tools, this is well-scoped for an EIA data server covering electricity and natural gas domains. Each tool earns its place by addressing distinct data facets (e.g., capacity, sales, prices, storage), avoiding bloat while providing comprehensive access to key EIA datasets.

Completeness5/5

The tool surface offers complete coverage for electricity and natural gas data, including operational data, capacity, sales, RTO operations, state profiles, consumption, production, prices, storage, imports/exports, reserves, and an exploration tool. No obvious gaps exist; agents can perform full data retrieval workflows across these domains.

Maintenance

ActivityInactive
ResponsivenessNo issues