eia-energy-data-mcp
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., "@eia-energy-data-mcpWhat's the daily Brent crude oil price trend for the last month?"
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.
EIA Energy Data MCP Server
An MCP server that wraps the U.S. Energy Information Administration's Open Data API (v2), so an MCP-aware assistant can pull live energy data through natural conversation instead of you writing API calls by hand.
It exposes four tools:
Tool | What it does |
| Pull a well-known series by its classic EIA id, e.g. |
| Explore what data exists. Call with |
| List valid filter values for a dataset, e.g. all state codes or sector codes. |
| Run a full custom query — any dataset, any filters, any date range. |
This was verified against EIA's current API documentation
(https://www.eia.gov/opendata/documentation.php) and tested against the
current official MCP Python SDK (mcp v2.0.0) before being published.
1. Prerequisites
Python 3.10+ installed on your computer.
An MCP-aware client that supports local (stdio) servers. This includes Claude Desktop, VS Code (1.101+), Cursor, and Windsurf, among others. It runs as a local process on your machine — it does not run inside claude.ai's browser-based chat, which can't launch local subprocesses.
Your own EIA API key — free at https://www.eia.gov/opendata/register.php.
Related MCP server: mcp-server-eia
2. Set up the project
Open a terminal, then:
git clone https://github.com/YOUR_GITHUB_USERNAME/eia-energy-data-mcp.git
cd eia-energy-data-mcp
pip install -r requirements.txt
cp .env.example .env
# then edit .env and add your own EIA_API_KEYNote: one important thing worth knowing — the official MCP Python SDK renamed its main server class from
FastMCPtoMCPServerin the 2.x line. If you see older tutorials online usingfrom mcp.server.fastmcp import FastMCP, that import path no longer exists in the current SDK. This project already uses the current, correct import (from mcp.server.mcpserver import MCPServer), so you don't need to do anything — just worth knowing if you go looking at other examples.
3. Test it runs
EIA_API_KEY=your_real_key_here python server.pyIf it starts without errors and just sits there waiting, that's correct — an MCP server communicates over stdio and expects a client to talk to it, not a human. Press Ctrl+C to stop it.
4. Connect it to a client
Claude Desktop
Open Claude Desktop's config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Add an entry like this (create the file if it doesn't exist), replacing the path and key with your own:
{
"mcpServers": {
"eia-energy-data": {
"command": "python",
"args": ["/absolute/path/to/eia-energy-data-mcp/server.py"],
"env": {
"EIA_API_KEY": "your_real_key_here"
}
}
}
}Restart Claude Desktop. You should see "eia-energy-data" listed as a connected tool (usually via a small hammer/plug icon in the chat box).
VS Code, Cursor, Windsurf, and other MCP hosts
Most hosts use the same mcpServers JSON shape shown above, added to
their own settings file or MCP config panel. Consult your client's docs
for the exact file location — the command, args, and env fields are
typically identical to the Claude Desktop example.
5. Try it
Once connected, just ask things like:
"What's the daily Brent crude oil price trend for the last month?" → calls
get_series("PET.RBRTE.D")."Show me residential electricity prices in Colorado, monthly, for 2023." → calls
browse_routesto confirm the route/facets, thenget_data(route="electricity/retail-sales", data_columns=["price"], facets={"stateid": ["CO"], "sectorid": ["RES"]}, frequency="monthly", start="2023-01", end="2023-12")."What energy datasets does EIA have on natural gas?" → calls
browse_routes("natural-gas").
Notes on the EIA API itself
Max 5,000 rows per request (300 for XML — we always request JSON).
Legacy v1 series IDs (like
PET.RBRTE.D) still work via the/v2/seriesid/{id}compatibility route — that's whatget_seriesuses.Everything else in v2 is organized as a browsable hierarchy of routes, each with its own facets (filters), data columns, and frequency options — that's what
browse_routesandget_dataare for.Rate limits apply per API key; if you hammer it with rapid recursive calls your key can be temporarily throttled (it recovers on its own).
Security
This server reads your API key from the EIA_API_KEY environment
variable — it is never hardcoded or logged. .env is gitignored;
.env.example is a template only and contains no real key. Use your own
key, and don't commit a .env file to a public fork.
Extending this
Ideas if you want to keep building:
Add a
search_seriestool once you find data columns you query often, hardcoding common routes as shortcuts.Add caching (e.g. a simple dict with a TTL) since energy series update at most daily.
Add a resource (not just tools) that exposes a curated list of interesting series ids as a static reference the model can read.
License
MIT — see LICENSE.
This server cannot be installed
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-qualityAmaintenanceAn MCP server that wraps the EPA ENERGY STAR Portfolio Manager REST API, enabling AI assistants to query and update building energy data.
- Alicense-qualityDmaintenanceProvides 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.MIT
- Alicense-qualityAmaintenanceBrowse and query the U.S. Energy Information Administration API v2 — electricity, petroleum, natural gas, coal, forecasts, and more via MCP. STDIO or Streamable HTTP.7992Apache 2.0
- FlicenseAqualityCmaintenanceAn MCP server that exposes the U.S. Energy Information Administration (EIA) Open Data API, enabling LLMs to browse and query energy data across 17 datasets with generic, composable tools.4
Related MCP Connectors
This MCP server provides seamless access to Malaysia's government open data, including datasets, w…
MCP server exposing the Backtest360 engine API as tools for AI agents.
MCP server for Mireye Earth — federal-source-cited geospatial data for any MCP-aware agent.
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/franklan-pm/eia-energy-data-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server