mcpField
P
pvpc-mcp-server

pvpc-mcp-server

Local
github.com/rfdezFinance0Updated 23w ago

About pvpc-mcp-server

An MCP server for retrieving daily PVPC hourly electricity prices published by Red Eléctrica for 2.0 TD consumers. It supports date and geographic filters and time or area aggregation.

Key features

  1. 01Fetch prices by date range
  2. 02Filter by geographical area
  3. 03Aggregate by time and area
  4. 04Group data by time or geography

Use cases

  1. 01Checking next-day hourly tariffs
  2. 02Comparing prices across Spanish regions

MCP support

Exposes the `fetch_prices` tool to MCP clients. The tool returns PVPC data in JSON text and requires an Esios Red Eléctrica API key.

Configuration

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

mcp.json · Universal config
{
"mcpServers": {
"rfdez-pvpc": {
"command": "npx",
"args": [
"-y",
"@rfdez/pvpc-mcp-server"
]
}
}
}
Run commandnpx -y @rfdez/pvpc-mcp-server

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@rfdez/pvpc-mcp-server3.2.3

Tools

1

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
localeenumNoGet translations for sources. Accepted values: `es`, `en`. Defaults to `es`.es | en
endDatestringNoEnd of the date range to filter indicator values in iso8601 format. E.g. 2025-06-29T23:59:59.999+02:00. Defaults to the end of today.
startDatestringNoBeginning of the date range to filter indicator values in iso8601 format. E.g. 2025-06-29T00:00:00.000+02:00. Defaults to the start of today.
timeTruncationenumNoTells how to truncate data time series. Accepted values: `hour`, `day`, `month`, `year`.hour | day | month | year
geographicalIdsarrayNoTells the geographical IDs to filter indicator values. 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 them by time. Accepted values: `sum`, `average`. Defaults to `sum`.sum | average
geographicalTruncationenumNoTells how 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 them by geographical ID. Accepted values: `sum`, `average`. Defaults to `sum`.sum | average

Details

From the project README

Voluntary Price for the Small Consumer (PVPC) MCP Server

License: MIT NPM Version

Fetch the Voluntary Price for the Small Consumer (PVPC) published daily by Red Eléctrica at 8:15 p.m. This includes the hourly electricity tariffs that will apply the following day for consumers billed under the 2.0 TD tariff.

🧩 Components

Tools
  • fetch_prices: Fetches the Voluntary Price for the Small Consumer (PVPC) prices for a given date range and geographical area.
    • Inputs:
      • locale: Get translations for sources. Accepted values: es, en. Defaults to es.
      • startDate: Beginning of the date range to filter indicator values in iso8601 format. E.g. 2025-06-29T00:00:00.000+02:00. Defaults to the start of today.
      • endDate: End of the date range to filter indicator values in iso8601 format. E.g. 2025-06-29T23:59:59.999+02:00. Defaults to the end of today.
      • timeAggregation: How to aggregate indicator values when grouping them by time. Accepted values: sum, average. Defaults to sum.
      • timeTruncation: Tells how to truncate data time series. Accepted values: hour, day, month, year. Optional parameter.
      • geographicalAggregation: How to aggregate indicator values when grouping them by geographical ID. Accepted values: sum, average. Defaults to sum.
      • geographicalIds: Tells the geographical IDs to filter indicator values. Accepted values: 3 (España), 8741 (Península), 8742 (Canarias), 8743 (Baleares), 8744 (Ceuta), 8745 (Melilla). Defaults to 8741, 8742, 8743, 8744, 8745.
      • geographicalTruncation: Tells how to group data at geographical level when the geographical aggregation is informed. Accepted values: country, electric_system. Optional parameter.
    • Returns: Text content with the PVPC prices in JSON format.

🔧 Configuration

Requirements

You need to register an API key from Esios Red Eléctrica de España to access the Esios Red Eléctrica de España API.

You will find the API documentation at API e·sios Documentation.

Claude Desktop
Remote Server Connection

Open Claude Desktop and navigate to Settings > Connectors > Add Custom Connector. Enter the name as PVPC and the remote MCP server URL like https://mcp.example.com/mcp.

Local Server Connection

Add this to your Claude Desktop claude_desktop_config.json file. See Claude Desktop MCP docs for more info.

{
  "mcpServers": {
    "pvpc": {
      "command": "npx",
      "args": ["-y", "@rfdez/pvpc-mcp-server@latest", "--api-key", "your_esios_api_key"]
    }
  }
}

💻 Development

Clone this repository and install the dependencies:

npm install

Build the project:

npm run build

Run the server:

node dist/index.js
CLI Arguments

pvpc-mcp-server accepts the following CLI flags:

  • --transport <stdio|http>: Transport to use (stdio by default).
  • --port <number>: Port to listen on when using http transport (default 8080).
  • --api-key <key>: Your e·sios API key for authentication.

Example with http transport and port 8080:

node dist/index.js --transport http --port 8080

Example with stdio transport:

node dist/index.js --transport stdio --api-key YOUR_ESIOS_API_KEY
Local Configuration Example
{
  "mcpServers": {
    "pvpc": {
      "command": "npx",
      "args": ["-y", "tsx", "/path/to/folder/pvpc-mcp-server/src/index.ts", "--api-key", "YOUR_ESIOS_API_KEY"]
    }
  }
}
Testing with MCP Inspector
npx -y @modelcontextprotocol/inspector npx -y @rfdez/pvpc-mcp-server

License

This project is licensed under the MIT License - see the LICENSE file for details.

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.