# eia-energy-mcp-server MCP server

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

## Links
- Registry page: https://www.getdrio.com/mcp/io-github-cyanheads-eia-energy-mcp-server
- Repository: https://github.com/cyanheads/eia-energy-mcp-server

## Install
- Command: `npx -y @cyanheads/eia-energy-mcp-server`
- Endpoint: https://eia-energy.caseyjhand.com/mcp
- Auth: Auth required by registry metadata

## Setup notes
- Package: Npm @cyanheads/eia-energy-mcp-server v0.2.0
- Environment variable: EIA_API_KEY (required)
- Environment variable: EIA_DATASET_TTL_SECONDS (default 86400)
- Environment variable: EIA_DATAFRAME_DROP_ENABLED (default false)
- Environment variable: CANVAS_PROVIDER_TYPE
- Environment variable: MCP_LOG_LEVEL (default info)
- Package: Npm @cyanheads/eia-energy-mcp-server v0.2.0
- Environment variable: EIA_API_KEY (required)
- Environment variable: EIA_DATASET_TTL_SECONDS (default 86400)
- Environment variable: EIA_DATAFRAME_DROP_ENABLED (default false)
- Environment variable: CANVAS_PROVIDER_TYPE
- Environment variable: MCP_HTTP_HOST (default 127.0.0.1)
- Environment variable: MCP_HTTP_PORT (default 3010)
- Environment variable: MCP_HTTP_ENDPOINT_PATH (default /mcp)
- Environment variable: MCP_PUBLIC_URL
- Environment variable: MCP_AUTH_MODE (default none)
- Environment variable: MCP_LOG_LEVEL (default info)
- The upstream registry signals required auth or secrets.
- Remote endpoint: https://eia-energy.caseyjhand.com/mcp

## Tools
- eia_browse_routes (Browse EIA Routes) - Lists child routes under a given path in the EIA dataset taxonomy. Start with no path to get the 14 top-level categories (electricity, petroleum, natural-gas, steo, aeo, ieo, seds, etc.), then drill into subcategories. Each result includes an isLeaf flag — leaf routes are queryable endpoints; non-leaf routes have children to browse. When isLeaf is true on the browsed path itself, switch to eia_describe_route. Endpoint: https://eia-energy.caseyjhand.com/mcp
- eia_describe_route (Describe EIA Route) - Returns full metadata for a leaf route: available facets with their valid values, data column names and units, frequency options, and date range. Call this before eia_query_route to discover valid facet IDs, facet values, column IDs, and frequency codes. Facet values are fetched from separate EIA endpoints and merged — results are cached per-route for the process lifetime to minimize API calls. Endpoint: https://eia-energy.caseyjhand.com/mcp
- eia_search_routes (Search EIA Routes) - Fuzzy text search across route names, descriptions, and category labels. Resolves natural-language queries like "electricity retail sales by state" or "natural gas imports" to matching route paths. STEO series names are indexed so queries like "ethanol net imports" or "crude oil production forecast" also resolve. Results include isLeaf so you know whether to browse further or query directly. Results with score > 0.5 are weak matches — try a more specific query or use eia_browse_routes to explore the taxonomy. Endpoint: https://eia-energy.caseyjhand.com/mcp
- eia_query_route (Query EIA Route Data) - Fetches data from a leaf route with optional facet filters, date range, frequency, and column selection. Use eia_describe_route first to discover valid facet IDs, facet values, column IDs, and frequency codes. Data values are strings in the response (EIA API returns all numeric values as strings, e.g. "9.13"); cast to DOUBLE in SQL when arithmetic is needed. Returns a preview inline; large result sets (total > length) spill to a DataCanvas table when canvas is enabled — use the returned canvas_id and dataset name with eia_dataframe_query for SQL analysis. Pass the same canvas_id on subsequent eia_query_route calls to accumulate multiple route results into one canvas for cross-route joins. Endpoint: https://eia-energy.caseyjhand.com/mcp
- eia_dataframe_describe (Describe EIA Dataframes) - List canvas dataframes (df_<id>) materialized by eia_query_route, with provenance, TTL, row count, and column schema. Lazy-sweeps expired tables before responding so the list is always current. Pass a specific name to inspect one dataframe; omit to list all active dataframes for this tenant. Endpoint: https://eia-energy.caseyjhand.com/mcp
- eia_dataframe_query (Query EIA Dataframes) - Run a single-statement SELECT against canvas dataframes registered by eia_query_route. Standard DuckDB SQL — joins, aggregates, window functions, CTEs all supported. Reference dataframes by the df_<id> handles returned by eia_query_route or listed by eia_dataframe_describe. Read-only: writes, DDL, DROP, COPY, PRAGMA, ATTACH, and external-file table functions are rejected. System catalogs (information_schema, pg_catalog, sqlite_master, duckdb_*) are denied at the bridge layer. EIA data values are VARCHAR — use CAST(col AS DOUBLE) for arithmetic and aggregation. Optional register_as chains results as a new dataframe with a fresh TTL. Endpoint: https://eia-energy.caseyjhand.com/mcp

## Resources
Not captured

## Prompts
Not captured

## Metadata
- Owner: io.github.cyanheads
- Version: 0.2.0
- Runtime: Npm
- Transports: STDIO, HTTP
- License: Not captured
- Language: Not captured
- Stars: Not captured
- Updated: May 24, 2026
- Source: https://registry.modelcontextprotocol.io
