Eia MCP Server

Browse and query the EIA API v2 — electricity, petroleum, natural gas, coal, forecasts via MCP.

Remote serverstreamable-http

What is the Eia MCP Server?

Browse and query the EIA API v2 — electricity, petroleum, natural gas, coal, forecasts via MCP.

The short version

  • Declarative tool definitions — single file per tool, framework handles registration and validation
  • Unified error handling — handlers throw, framework catches, classifies, and formats
  • Pluggable auth: none, jwt, oauth
  • Swappable storage backends: in-memory, filesystem, Supabase, Cloudflare KV/R2/D1
  • Structured logging with optional OpenTelemetry tracing
  • STDIO and Streamable HTTP transports

What it needs from you

  • Bun v1.3.0 or higher (or Node.js v24+). - A free EIA API key from api.eia.gov. The DEMO_KEY hits rate limits quickly; a real key is required for sustained use.

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
eia_browse_routesLists child routes under a given path in the EIA dataset taxonomy. Start at root to see top-level categories, then drill into subcategories and leaf routes.
eia_describe_routeReturns metadata for a leaf route: available facets with valid values, data column names, frequency options, units, and date range. Call before eia_query_route to understand filter options. Facet values come back capped,
eia_search_routesFuzzy text search across route names, descriptions, category labels, STEO series names, and facet values. Resolves natural-language queries like "electricity retail sales by state" or a fuel type like "wind" to matching
eia_query_routeFetches data from a leaf route with optional facet filters, date range, frequency, and column selection. Pages past the inline preview to stage large result sets as a DataCanvas table for SQL analysis.
eia_dataframe_describeLists active DataCanvas dataframes created by prior eia_query_route calls. Shows table name, column names and types, row count, expiry, and the query that produced it. A handle that is not staged comes back as a miss alo
eia_dataframe_queryRuns a read-only SQL SELECT across DataCanvas dataframes, referenced by their df_<id> table names.
eia_dataframe_dropDrops a DataCanvas dataframe, freeing its memory. Only exposed when EIA_DATAFRAME_DROP_ENABLED=true.

How to install the Eia MCP Server

{
  "mcpServers": {
    "eia-energy-mcp-server": {
      "type": "stdio",
      "command": "bunx",
      "args": ["@cyanheads/eia-energy-mcp-server@latest"],
      "env": {
        "MCP_TRANSPORT_TYPE": "stdio",
        "MCP_LOG_LEVEL": "info",
        "EIA_API_KEY": "your-api-key"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

  • Bun v1.3.0 or higher (or Node.js v24+). - A free EIA API key from api.eia.gov. The DEMO_KEY hits rate limits quickly; a real key is required for sustained use.
VariableDescriptionRequired
MCP_TRANSPORT_TYPEConfiguration value read at startup.Optional
MCP_LOG_LEVELConfiguration value read at startup.Optional
EIA_API_KEYCredential the server authenticates with.Yes
DEMO_KEYCredential the server authenticates with.Yes
EIA_BASE_URLEndpoint or connection string the server talks to.Yes
MCP_HTTP_ENDPOINT_PATHFilesystem location the server is allowed to use.Optional
MCP_PUBLIC_URLEndpoint or connection string the server talks to.Yes

Example prompts to try

  • “Use Eia to eia browse routes.”
  • “Use Eia to eia describe route.”
  • “Use Eia to eia search routes.”

Frequently asked questions

Browse and query the EIA API v2 — electricity, petroleum, natural gas, coal, forecasts via MCP. Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.