mcpField
W
wattprice

wattprice

Local
github.com/CloudCorpRecordsFinance0Updated 1w ago

About wattprice

wattprice fetches Spain's regulated PVPC electricity prices from the ESIOS API. It is for querying prices by date range and geographical area, with optional time and area aggregation settings.

Key features

  1. 01Fetch PVPC prices as JSON
  2. 02Set date range and locale
  3. 03Choose time aggregation and truncation
  4. 04Select geographical areas and aggregation

Use cases

  1. 01Retrieve today's PVPC prices
  2. 02Query prices for a chosen date range
  3. 03Compare prices across Spanish electricity areas
  4. 04Request aggregated prices by hour or day

MCP support

Its MCP server provides a fetch_prices tool for retrieving PVPC prices by date range and geographical area. The ESIOS_API_KEY is required.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"cloudcorprecords-wattprice": {
"command": "npx",
"args": [
"-y",
"@reneturcios/wattprice"
]
}
}
}
Run commandnpx -y @reneturcios/wattprice

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@reneturcios/wattprice0.1.0
ocighcr.io/cloudcorprecords/wattprice:0.1.0

Tools

1

Saved tool list · updated 1w ago

ParameterTypeRequiredDescription
localeenumNoTranslations for sources. Accepted values: es, en. Defaults to es.es | en
endDatestringNoEnd of the date range, ISO 8601. Defaults to the end of today.
startDatestringNoBeginning of the date range, ISO 8601 (e.g. 2025-06-29T00:00:00.000+02:00). Defaults to the start of today.
timeTruncationenumNoHow to truncate data time series. Accepted values: hour, day, month, year.hour | day | month | year
geographicalIdsarrayNoGeographical IDs to filter by. Accepted values: 3 (España), 8741 (Península), 8742 (Canarias), 8743 (Baleares), 8744 (Ceuta), 8745 (Melilla). Defaults to 8741, 8742, 8743, 8744, 8745.
timeAggregationenumNoHow to aggregate indicator values when grouping by time. Accepted values: sum, average. Defaults to sum.sum | average
geographicalTruncationenumNoHow to group data at geographical level when the geographical aggregation is informed. Accepted values: country, electric_system.country | electric_system
geographicalAggregationenumNoHow to aggregate indicator values when grouping by geographical ID. Accepted values: sum, average. Defaults to sum.sum | average

Details

From the project README

wattprice

What does electricity cost right now under Spain's regulated PVPC tariff? wattprice asks the ESIOS API — the data service run by Red Eléctrica de España — for the PVPC (Voluntary Price for the Small Consumer) indicator and returns the prices payload as JSON, for a date range and geographical area you choose.

Everything except the API key itself is optional, with the defaults the upstream documents:

  • locale — es (default) or en
  • startDate / endDate — ISO 8601 bounds; an absent range means today, start to end of day
  • timeAggregation — sum (default) or average
  • timeTruncation — hour, day, month, or year
  • geographicalAggregation — sum (default) or average
  • geographicalIds — string IDs: 3 España, 8741 Península, 8742 Canarias, 8743 Baleares, 8744 Ceuta, 8745 Melilla; defaults to the five system IDs 8741–8745
  • geographicalTruncation — country or electric_system

Configuration

You bring your own ESIOS API key (free registration at esios.ree.es):

export ESIOS_API_KEY="your key"

Without it, wattprice does not guess: the call fails with an error naming ESIOS_API_KEY, and no prices are invented. ESIOS_API_BASE overrides the API base URL (https://api.esios.ree.es by default).

CLI

ESIOS_API_KEY=... npx @reneturcios/wattprice prices
ESIOS_API_KEY=... npx @reneturcios/wattprice prices --locale en --time-truncation day --geographical-ids 8741
npx @reneturcios/wattprice --version

Output is the ESIOS prices payload as JSON. Exit codes: 0 on success, 1 on a runtime error (including a missing key or a non-200 upstream response), 2 on a usage error.

MCP server

npx -y @reneturcios/wattprice mcp

MCP client config:

{
  "mcpServers": {
    "wattprice": {
      "command": "npx",
      "args": ["-y", "@reneturcios/wattprice", "mcp"],
      "env": { "ESIOS_API_KEY": "your key" }
    }
  }
}
Tools
  • fetch_prices — Fetch PVPC prices for a given date range and geographical area. All arguments are optional; see the defaults list above.

Docker

docker run -i -e ESIOS_API_KEY="your key" ghcr.io/cloudcorprecords/wattprice
docker run --rm -e ESIOS_API_KEY="your key" ghcr.io/cloudcorprecords/wattprice prices --locale en

Development

npm install
npm run build   # tsc -> dist/
npm test        # tsx --test test/*.test.ts (fake fetch, no network)
npm run dev     # run the CLI from source

License

MIT — Copyright (c) 2026 Rene Turcios

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.