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. That is what the eia mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

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

The tools it exposes

The server publishes 9 tools. What each one is for:

  • eia_browse_routes — Lists 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
  • eia_describe_route — Returns metadata for a leaf route: available facets with valid values, data column names, frequency options, units, and date range. Call before
  • eia_search_routes — Fuzzy text search across route names, descriptions, category labels, STEO series names, and facet values. Resolves natural-language queries like
  • eia_query_route — Fetches data from a leaf route with optional facet filters, date range, frequency, and column selection. Pages past the inline preview to stage large
  • eia_dataframe_describe — Lists active DataCanvas dataframes created by prior eia_query_route calls. Shows table name, column names and types, row count, expiry, and the query
  • eia_dataframe_query — Runs a read-only SQL SELECT across DataCanvas dataframes, referenced by their df_ table names
  • eia_dataframe_drop — Drops a DataCanvas dataframe, freeing its memory. Only exposed when EIA_DATAFRAME_DROP_ENABLED=true
  • Prerequisites — The Prerequisites tool exposed by this server
  • Installation — The Installation tool exposed by this server

Getting it running

Because this one is hosted, setup is mostly authentication — you point your client at the endpoint and approve access. Nothing runs on your machine, so there is no runtime to keep patched.

What it needs from you

Configuration is passed through the environment: MCP_TRANSPORT_TYPE, MCP_LOG_LEVEL, EIA_API_KEY, DEMO_KEY, EIA_BASE_URL, MCP_HTTP_ENDPOINT_PATH, MCP_PUBLIC_URL. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

  • 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.

How it compares

Among the database access options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Eia's toolset — eia_browse_routes, eia_describe_route, eia_search_routes and 6 more — is a fair guide to whether it matches your workflow. It is maintained by cyanheads; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Eia's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Things to watch

  • Your data travels to the provider's service, so the usual questions apply about what you send and what they retain.
  • With 9 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Eia.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

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.
PrerequisitesThe Prerequisites tool exposed by this server.
InstallationThe Installation tool exposed by this server.

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

It connects Eia to MCP-compatible AI assistants such as Claude and Cursor, exposing 9 tools (eia_browse_routes, eia_describe_route, eia_search_routes, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Eia directly.