EIA MCP Server
A FastMCP server that wraps the U.S. Energy Information Administration Open Data API v2, enabling natural-language queries for electricity, petroleum, and other energy statistics via tools like discover_eia_route and get_eia_data.
README
EIA MCP Server for Microsoft Copilot Studio
A Python FastMCP server that wraps the U.S. Energy Information Administration Open Data API v2 and exposes agent-friendly tools over Streamable HTTP.
Tools
discover_eia_route: discover routes, frequencies, columns, and facets.get_eia_data: query any EIA v2 dataset using a controlled relative route.get_electricity_retail_sales: convenience tool for annual state-level retail electricity data.
1. Configure
Request a free EIA API key from https://www.eia.gov/opendata/register.php, then:
cp .env.example .env
Set EIA_API_KEY in .env. Never commit that file.
2. Run locally
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
set -a && source .env && set +a
python server.py
The MCP endpoint is:
http://localhost:8000/mcp
Test it with MCP Inspector:
npx @modelcontextprotocol/inspector http://localhost:8000/mcp
3. Run with Docker
docker compose up --build
4. Deploy for Copilot Studio
Deploy the container to a host that provides a publicly reachable HTTPS endpoint, such as Azure Container Apps. Configure EIA_API_KEY as a secret, map it to an environment variable, and expose port 8000. The URL supplied to Copilot Studio should end in /mcp.
Illustrative Azure Container Apps flow:
az group create --name rg-eia-mcp --location eastus
az acr create --resource-group rg-eia-mcp --name <uniqueRegistry> --sku Basic
az acr build --registry <uniqueRegistry> --image eia-mcp:1.0 .
az containerapp up \
--name eia-mcp \
--resource-group rg-eia-mcp \
--location eastus \
--image <uniqueRegistry>.azurecr.io/eia-mcp:1.0 \
--target-port 8000 \
--ingress external
az containerapp secret set \
--name eia-mcp \
--resource-group rg-eia-mcp \
--secrets eia-api-key='<YOUR_EIA_KEY>'
az containerapp update \
--name eia-mcp \
--resource-group rg-eia-mcp \
--set-env-vars EIA_API_KEY=secretref:eia-api-key
For enterprise use, protect the endpoint with an API key gateway or OAuth 2.0, apply an ingress allowlist where possible, enable application logging, and rotate secrets.
5. Connect from Copilot Studio
- Open the agent and enable generative orchestration.
- Go to Tools, choose Add a tool, then choose the MCP option/onboarding wizard.
- Enter
https://<your-host>/mcp. - Configure the authentication method used by your deployment.
- Add the discovered MCP tools/resources to the agent and publish it.
Suggested agent instruction:
For U.S. energy statistics, use the EIA Energy Data tools. If you do not know a dataset's exact route, frequency, data columns, or facets, call discover_eia_route first. Cite the returned EIA metadata and state the period and units in the answer.
Example agent requests
- "Show annual residential electricity prices in Texas and California from 2020 through 2025."
- "Discover the available petroleum routes in EIA."
- "Query monthly natural-gas data after first discovering the required route and facets."
Design notes
- The EIA key stays server-side and is never exposed as a tool argument.
- Routes are restricted to relative EIA paths to prevent arbitrary URL access.
- Returned EIA values are preserved because API v2 may represent data points as JSON strings.
MAX_ROWSlimits large agent-triggered responses; useoffsetfor pagination.- The server itself does not implement inbound authentication. Add API-key or OAuth protection before production use.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.