Skip to main content
Glama
kimhjort

aria-mcp-elpriser

by kimhjort
README.md
# aria-mcp-elpriser

MCP server exposing Danish electricity spot prices (DK1/DK2) — keyless, open-source.

Designed for use with [ARIA](https://github.com/kimhjort/aria), Kim Hjort's personal AI assistant, but works with any MCP-compatible client.

## What it does

Provides four tools to fetch real-time and day-ahead Danish electricity spot prices from [elprisenligenu.dk](https://www.elprisenligenu.dk), which publishes Nord Pool spot prices sourced via Energi Data Service.

**Important:** All prices are raw Nord Pool spot prices and **exclude** Danish taxes, tariffs (Energinet, network operator), and transport costs. The total consumer price on your electricity bill is significantly higher.

## Tools

| Tool | Description |
|------|-------------|
| `get_prices` | Hourly spot prices for a date (24 entries with local Copenhagen timestamps) |
| `get_current_price` | Spot price for the current hour |
| `get_cheapest_hours` | The N cheapest hours for a date, sorted ascending by price |
| `get_price_summary` | Min / max / avg + cheapest and most expensive hour for a date |

### `get_prices({ area?, date? })`

Returns an array of 24 hourly `{ DKK_per_kWh, time_start_local, time_end_local }` entries.

### `get_current_price({ area? })`

Returns the single entry covering the current Europe/Copenhagen hour.

### `get_cheapest_hours({ area?, date?, count? })`

Returns the `count` cheapest hours (default 3) sorted by price ascending. Use this to advise on the best time to run the dishwasher or charge an EV.

### `get_price_summary({ area?, date? })`

Returns `{ area, date, min_DKK_per_kWh, max_DKK_per_kWh, avg_DKK_per_kWh, cheapest_hour, most_expensive_hour }`.

### Common parameters

- **`area`** — `"DK1"` (West Denmark, postal codes > 4999) or `"DK2"` (East Denmark). Defaults to the `DEFAULT_PRICE_AREA` env var, or `"DK2"` if not set.
- **`date`** — `"today"` (default), `"tomorrow"`, or `"YYYY-MM-DD"`.

### Tomorrow's prices

Tomorrow's prices are published by Nord Pool around **13:00 CET**. Before that, the API returns 404 and the tools return a clear message asking to try again later.

## Data source & attribution

- **API:** [elprisenligenu.dk](https://www.elprisenligenu.dk) — free, keyless public API
- **Underlying data:** Nord Pool spot prices via [Energi Data Service](https://www.energidataservice.dk/)
- No API key or registration required.

## Requirements

- Node.js >= 20 (uses global `fetch` and `Intl.DateTimeFormat`)

## Environment variables

| Variable | Default | Description |
|----------|---------|-------------|
| `DEFAULT_PRICE_AREA` | `DK2` | Default price area when the `area` parameter is omitted. Set to `DK1` for West Denmark. |

## ARIA configuration

Add to your ARIA `McpServers` configuration:

```json
{
  "Name": "elpriser",
  "Command": "npx",
  "Args": ["-y", "aria-mcp-elpriser"],
  "Env": {
    "DEFAULT_PRICE_AREA": "DK2"
  }
}
```

Omit the `Env` block to use the default (`DK2`). Set `DEFAULT_PRICE_AREA` to `DK1` if you are on West Denmark (postal codes above 4999, i.e. Jutland and Funen outside the Lillebælt bridge area).

## Development

```bash
npm install
npm run build
npm test
node dist/index.js   # runs the stdio MCP server
```

## License

MIT — see [LICENSE](LICENSE).

TDQS

A4.3/5.0

Scored across 4 tools

Disambiguation5/5

Each tool targets a distinct query: current price, all prices per date/area, cheapest hours, and a summary. No overlap.

Naming Consistency5/5

All tools follow a consistent 'get_*' pattern with descriptive nouns, all in snake_case.

Tool Count5/5

4 tools is well-scoped for a focused electricity price server, covering all typical queries without unnecessary redundancy.

Completeness4/5

Covers current, daily, cheapest, and summary queries. Missing historical multi-day comparison, but core functionality is complete.

Maintenance

ActivityMaintained
ResponsivenessSyncing