EIA
- python
2
GitHub Stars
python
Language
4 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"zen-tradings-eia-mcp": {
"command": "python",
"args": [
"-m",
"eia_mcp.server"
],
"env": {
"EIA_API_KEY": "your_api_key_here"
}
}
}
}You run an MCP server to access EIA electricity and natural gas data through convenient endpoints. This guide helps you install, configure, and operate the EIA MCP Server so you can query data like electricity generation, prices, storage, and more directly from your tools or applications.
How to use
You connect to the EIA MCP Server from an MCP client. Start the local MCP server process and configure your client to point at the server. Once running, you can ask for electricity and natural gas data such as state profiles, generator capacity, storage levels, and price data. Use the client’s standard MCP query patterns to request data by route, date, and region, and receive structured responses that you can integrate into dashboards, analyses, or automation scripts.
How to install
Prerequisites: you need Python installed on your system. You also need to install the MCP package from the same project source.
# Install the MCP server package in editable mode
cd eia-mcp
pip install -e .
Configuration
Set up your API key for the EIA Open Data API. You will supply this key to the MCP server via environment variables when starting the server or configuring your client.
Environment variable you will use: EIA_API_KEY. Provide your actual API key value in your environment when you run the server or in your client configuration.
Example server configurations
{
"mcpServers": {
"eia": {
"command": "python",
"args": ["-m", "eia_mcp.server"],
"cwd": "/Users/yanpan/eia-mcp",
"env": {
"EIA_API_KEY": "your_api_key_here"
}
}
}
}
Alternative local start command
{
"mcpServers": {
"eia": {
"command": "eia-mcp",
"env": {
"EIA_API_KEY": "your_api_key_here"
}
}
}
}
Notes on environment and paths
If you use the Python start method, ensure the working directory matches where you installed the package so that the module can be found. When using the package method, you can omit the working directory if the package is installed globally or in your environment path.
Available tools and endpoints
The server exposes a range of endpoints for electricity and natural gas data. The following tools are available to fetch specific data programmatically.
Troubleshooting
If you encounter connection or authentication issues, verify that your EIA_API_KEY is correctly set in the environment where the MCP server runs. Check that the server process starts without errors and that your MCP client is configured to connect to the correct server name (eia) and method (stdio). Review logs for any hints about missing modules or network access problems.
Security and best practices
Keep your EIA_API_KEY secret. Do not commit keys to version control. Use separate keys for development and production environments if possible, and rotate keys as needed.
Support and data scope
This server provides access to electricity and natural gas data, including retail sales, operational data, state profiles, generator capacity, and various price and consumption datasets as described in the data domains.
Available tools
eia_electricity_retail_sales
Get electricity retail sales data by state and sector, including pricing and customer counts.
eia_electricity_operational_data
Retrieve power generation, fuel consumption, and emissions data.
eia_electricity_rto
Query real-time electricity operations by balancing authority (e.g., CISO, PJM, MISO, ERCOT).
eia_electricity_state_profiles
Access state-level electricity profiles and infrastructure data.
eia_electricity_generator_capacity
Obtain the inventory of operable generators and capacity data.
eia_electricity_facility_fuel
Fetch individual power plant operation and fuel data.
eia_natural_gas_summary
Overview of natural gas survey data.
eia_natural_gas_prices
Prices data including spot, futures, citygate, residential, commercial, and industrial prices.
eia_natural_gas_exploration_reserves
Explore exploration data and stockpile reserves.
eia_natural_gas_production
Production metrics and volumes for natural gas.
eia_natural_gas_imports_exports
Cross-border flows and pipeline movement data for natural gas.
eia_natural_gas_storage
Inventory levels, injections, and withdrawals for storage facilities.
eia_natural_gas_consumption
End-use consumption data by sector for natural gas.
eia_explore_routes
Explore available API routes and retrieve metadata.