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
GET /api/v1/symbolsBrowse the full catalog of price symbols (name, category, country, currency, frequency).
GET /api/v1/latestMost recent price for one or more symbols, e.g. EPEX_DE_DA, TTF_GAS, EUA_CO2.
GET /api/v1/historicalPrice for one or more symbols on a specific past date.
GET /api/v1/timeseriesHistorical price series between two dates, one array of {date, value} per symbol.
GET /api/v1/fluctuationPercent change plus min/max price over a date range, per symbol.
GET /api/v1/ohlcOpen/high/low/close candles per symbol, bucketed weekly, monthly, or quarterly.
Electricity
GET /api/v1/electricity/latestLatest day-ahead electricity price(s) across European and global markets.
GET /api/v1/electricity/hourlyIntraday electricity price curve for one symbol on one date.
GET /api/v1/electricity/pvpcHourly Spanish PVPC retail reference price for one date.
GET /api/v1/forecastNext published day-ahead price for a symbol (a lookup of tomorrow's already-cleared price, not a statistical forecast).
Gas & Carbon
GET /api/v1/gas/latestLatest TTF (EU) and Henry Hub (US) natural gas benchmark prices.
GET /api/v1/emissions/latestLatest EU ETS carbon allowance price (EUA_CO2, EUR/tonne CO2).
GET /api/v1/coal/latestLatest Rotterdam (API2) and Newcastle thermal coal benchmark prices.
GET /api/v1/carbon-intensityGrid carbon intensity in gCO2eq/kWh, optionally filtered to one country.
Utilities
POST /api/v1/cost-estimateEstimates a monthly electricity cost from a kWh usage figure and a wholesale price.
GET /api/v1/statusLast 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):
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:
claude mcp list
Remove it with:
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.
{
"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.
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
?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.