Energy API / MCP
MCP ready

Connect AI to live energy prices

Integrate Energy API with Claude, Cursor, ChatGPT, or any MCP-compatible assistant. Query natural gas, electricity, coal, and EU ETS carbon prices right inside your AI conversations.

Get API key View REST docs

What is MCP and why does it matter?

The Model Context Protocol (MCP) lets AI assistants call external tools in real time. Instead of stale training data, your AI fetches live energy prices from Energy API — just by being asked a question.

Example: ask Claude "What's the latest German day-ahead power price?" and it calls the latest tool automatically.

⚡

Real energy data

Natural gas, electricity, coal, and carbon prices from OMIE, ENTSO-E, EEX, FRED/EIA, and more.

💬

Natural language

Ask "What's today's day-ahead electricity price in Spain?" and get an accurate, sourced answer.

🔑

Same API quota

MCP calls use your existing energy-api.com plan. Each tool call counts as one API request.

Available MCP tools

Sixteen tools mapped to the real energy-api.com REST endpoints, grouped by category.

Prices

symbolsGET /api/v1/symbols

Browse the full catalog of price symbols (name, category, country, currency, frequency).

latestGET /api/v1/latest

Most recent price for one or more symbols, e.g. EPEX_DE_DA, TTF_GAS, EUA_CO2.

historicalGET /api/v1/historical

Price for one or more symbols on a specific past date.

timeseriesGET /api/v1/timeseries

Historical price series between two dates, one array of {date, value} per symbol.

fluctuationGET /api/v1/fluctuation

Percent change plus min/max price over a date range, per symbol.

ohlcGET /api/v1/ohlc

Open/high/low/close candles per symbol, bucketed weekly, monthly, or quarterly.

Electricity

electricity_latestGET /api/v1/electricity/latest

Latest day-ahead electricity price(s) across European and global markets.

electricity_hourlyGET /api/v1/electricity/hourly

Intraday electricity price curve for one symbol on one date.

electricity_pvpcGET /api/v1/electricity/pvpc

Hourly Spanish PVPC retail reference price for one date.

forecastGET /api/v1/forecast

Next published day-ahead price for a symbol (a lookup of tomorrow's already-cleared price, not a statistical forecast).

Gas & Carbon

gas_latestGET /api/v1/gas/latest

Latest TTF (EU) and Henry Hub (US) natural gas benchmark prices.

emissions_latestGET /api/v1/emissions/latest

Latest EU ETS carbon allowance price (EUA_CO2, EUR/tonne CO2).

coal_latestGET /api/v1/coal/latest

Latest Rotterdam (API2) and Newcastle thermal coal benchmark prices.

carbon_intensityGET /api/v1/carbon-intensity

Grid carbon intensity in gCO2eq/kWh, optionally filtered to one country.

Utilities

cost_estimatePOST /api/v1/cost-estimate

Estimates a monthly electricity cost from a kWh usage figure and a wholesale price.

statusGET /api/v1/status

Last fetch status per upstream data provider (OMIE, ENTSO-E, EEX, FRED/EIA, ...).

Getting started

Same URL for every client. Authenticate by putting your key in the URL as ?apikey=, or send it as an Authorization: Bearer or X-API-Key header if your client supports custom headers. There is no OAuth step — the key you already have from the dashboard works everywhere.

MCP endpoint

No key yet? Register (free trial available), then generate one at https://energy-api.com/api-keys. Every tool requires a key — there is no free/unauthenticated tool.

Connect to Claude

Works the same on claude.ai and in the Claude Desktop app — the connector is saved on your Claude account, not in a local file.

1. Open Connectors

User menu → Settings → Customize → Connectors → Add custom connector.

2. Name and URL

Name: for example Energy API

Remote server URL: https://mcp.energy-api.com/mcp?apikey=YOUR_KEY — replace YOUR_KEY with your own key from https://energy-api.com/api-keys.

3. Authentication

Leave No authentication required selected — the key is already in the URL, so there is nothing else to configure.

4. Add and Connect

Click Add, then Connect on the new connector in the list.

Connect with Claude Code

From any terminal (outside a claude session):

bash
claude mcp add --transport http energy-api "https://mcp.energy-api.com/mcp" \
  --header "Authorization: Bearer YOUR_KEY"

No OAuth callback needed — the header carries your key directly. Verify with:

bash
claude mcp list

Remove it with:

bash
claude mcp remove energy-api

After setup, try: "What's the latest TTF gas and German power price?"

Connect to Cursor

You need an Energy API key from https://energy-api.com/api-keys.

1. Open Cursor Settings

Mac: Cursor → Preferences → Cursor Settings. Windows: Cursor menu → Settings → Cursor Settings.

2. Open Customize → Add an MCP server

Filter by MCPs, then click New MCP Server ("Add a Custom MCP Server").

3. URL

URL: https://mcp.energy-api.com/mcp?apikey=YOUR_KEY. No OAuth client to configure — the server should show a green dot once saved.

Optional: a settings file instead

Paste into ~/.cursor/mcp.json (Mac) or %USERPROFILE%\.cursor\mcp.json (Windows), or .cursor/mcp.json in a project folder for a project-only setup. Save and restart Cursor.

mcp.json
{
  "mcpServers": {
    "energy-api": {
      "url": "https://mcp.energy-api.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_KEY"
      }
    }
  }
}

After setup, try: "Look up the OMIE Spain day-ahead electricity price"

Connect to ChatGPT

ChatGPT connectors call the URL you give them directly — put your key in the URL, never in chat.

1. Get a key

Register and start a free trial, or use a paid Energy API account.

2. Add a custom connector

In ChatGPT, open Settings → Connectors and add a custom MCP connector.

Remote server URL: https://mcp.energy-api.com/mcp?apikey=YOUR_KEY

3. Try it

"What's the latest German day-ahead power price?"

"What's the EU ETS carbon allowance price today?"

"Estimate my monthly electricity cost for 500 kWh in Spain"

Python: fetch a price example

A complete Python example that fetches the latest German day-ahead power price using the MCP protocol.

get_latest_price.py
import httpx
import json
import asyncio

MCP_SERVER_URL = "https://mcp.energy-api.com/mcp"
API_KEY = "YOUR_KEY"

async def call_mcp_tool(tool_name: str, arguments: dict):
    async with httpx.AsyncClient(timeout=60) as client:
        init_response = await client.post(
            MCP_SERVER_URL,
            headers={"Authorization": f"Bearer {API_KEY}"},
            json={
                "jsonrpc": "2.0",
                "id": "1",
                "method": "initialize",
                "params": {
                    "protocolVersion": "2024-11-05",
                    "capabilities": {},
                    "clientInfo": {"name": "PythonClient", "version": "1.0.0"}
                }
            }
        )
        session_id = init_response.headers.get("Mcp-Session-Id")

        response = await client.post(
            MCP_SERVER_URL,
            headers={"Mcp-Session-Id": session_id, "Authorization": f"Bearer {API_KEY}"},
            json={
                "jsonrpc": "2.0",
                "id": "2",
                "method": "tools/call",
                "params": {
                    "name": tool_name,
                    "arguments": arguments
                }
            }
        )
        return response.json()

async def main():
    result = await call_mcp_tool("latest", {"symbols": "EPEX_DE_DA"})
    print(json.dumps(result, indent=2))

asyncio.run(main())

Frequently asked questions

Put your key in the MCP URL as ?apikey=YOUR_KEY, or send it as an Authorization: Bearer YOUR_KEY or X-API-Key: YOUR_KEY header — whichever your client supports. There is no OAuth step. Start a free trial first if you don't have a key.
MCP calls count toward your existing energy-api.com plan quota just like REST API calls — each tool call is one API request. Check the pricing page for plan limits.
Sixteen tools covering prices (symbols, latest, historical, timeseries, fluctuation, ohlc), electricity (latest, hourly, PVPC, forecast), gas & carbon (gas, emissions, coal, carbon intensity), and utilities (cost estimate, provider status). See Available Tools above for the full list and REST mappings.
Yes — any client that implements the Model Context Protocol (Streamable HTTP transport) can connect: Claude, Cursor, ChatGPT, custom Python/Node clients, or any future MCP-compatible platform.