mcp-server-eia
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-server-eiaShow me monthly electricity retail sales for California in 2023"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-server-eia
An MCP server that exposes the U.S. Energy Information Administration (EIA) Open Data API v2 to LLM clients. It provides a small set of generic, composable tools that mirror the API's uniform tree structure (browse → discover facets → query data), giving agents full coverage of all 17 EIA datasets — electricity, natural gas, petroleum, coal, nuclear outages, CO2 emissions, renewables, and the energy outlooks (AEO/IEO/STEO) — without hard-coding hundreds of endpoints.
Tools
Tool | Purpose |
| Explore the dataset tree from any path (empty = the 17 top-level datasets). At a leaf, returns dataset metadata: available frequencies, facet ids, valid data columns, and the covered date range. Primary discovery tool. |
| List the facet ids a dataset can be filtered by (e.g. |
| List the valid option values for a single facet, so filters use real ids. |
| Query dataset rows with column selection, facet filters, frequency, date range, sorting, and pagination. Returns structured JSON with pagination metadata. |
Related MCP server: solar-mcp
How the EIA API is shaped
The API is a recursive tree. A GET on a route path returns either child
routes (an intermediate node) or leaf metadata (a queryable dataset). The
typical workflow is:
eia_browse_routes(route="")— list top-level datasets.Drill down, e.g.
eia_browse_routes(route="electricity/retail-sales")— read the validdata_columns,frequencies, and facet ids.eia_list_facets/eia_get_facet_options— find valid filter values.eia_get_data(...)— retrieve the numbers.
Conventions
Routes are slash paths without a
v2/prefix, e.g.electricity/retail-sales.Date formats depend on frequency:
2020(annual),2020-01(monthly),2020-01-01(daily),2020-01-01T00(hourly).Facets are passed as
{facet_id: [values]}; sort as[{"column": ..., "direction": "asc"|"desc"}].Pagination:
length(page size, max 5000) andoffset. Reuse thenext_offsetreturned by the previouseia_get_dataresponse.
Requirements
Python
>=3.14uvfor dependency managementA free EIA API key: https://www.eia.gov/opendata/register.php
Setup
uv syncAuthentication
Set the EIA_API_KEY environment variable, or create a .env file in the
project root (loaded automatically at startup; .env is gitignored):
EIA_API_KEY=your_key_hereRunning
uv run python -m eia_mcp.appWith no port env var set, the server runs over stdio (for Claude Desktop, Claude Code, and other local MCP clients).
If
PORTorDATABRICKS_APP_PORTis set, it runs over HTTP on that port (for remote/hosted deployment). AGET /healthendpoint is exposed in HTTP mode.
Example MCP client config (stdio)
{
"mcpServers": {
"eia": {
"command": "uv",
"args": ["run", "python", "-m", "eia_mcp.app"],
"cwd": "/path/to/mcp-server-eia",
"env": { "EIA_API_KEY": "your_key_here" }
}
}
}Project layout
src/eia_mcp/
├── app.py # FastMCP init, instructions, transport selection
├── routes.py # HTTP health-check route
├── utils.py # API key, URL building, param encoding, HTTP client, errors
└── tools/
├── __init__.py # register_tools(mcp): wires up all tools
├── browse_routes.py # eia_browse_routes
├── list_facets.py # eia_list_facets
├── get_facet_options.py # eia_get_facet_options
└── get_data.py # eia_get_data
docs/eia-api-swagger/ # EIA API v2 OpenAPI/Swagger referenceEach tool lives in its own file and exposes a register(mcp) function; new tools
are added by dropping a file in tools/ and registering it in
tools/__init__.py.
Data source & attribution
Data is retrieved live from the U.S. Energy Information Administration Open Data API. See the EIA API terms of service for usage and attribution requirements.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceEconomic data MCP server that connects FRED, BLS, BEA, IMF, World Bank, and ECB to any MCP-compatible client, with built-in methodology rules to guide LLMs in selecting appropriate economic indicators.Last updated
- Alicense-qualityAmaintenanceOpen-source MCP servers exposing US solar data (production, resource, economics, market, forecast) as agent-accessible tools with a consistent data envelope.Last updatedMIT
- Alicense-qualityCmaintenanceEnables AI agents to operate a US power-grid data pipeline – ingest, plan, run, and monitor datasets like CAISO, ERCOT, and EIA-930 through MCP tools that mirror the CLI.Last updatedApache 2.0
- AlicenseAqualityBmaintenanceAn MCP server that gives LLM agents typed, cached access to civic open-data portals via Socrata (SODA 2.1 + Discovery API), enabling search, query, profiling, sampling, and CSV export of datasets.Last updated6MIT
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
Hosted MCP server exposing US hospital procedure cost data to AI assistants
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/GSA-TTS/mcp-server-eia'
If you have feedback or need assistance with the MCP directory API, please join our Discord server