leneda_mcp_server

bastelbuud/leneda_mcp_server

3.2

If you are the rightful owner of leneda_mcp_server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Leneda Energy MCP Server provides access to energy metering data through Claude Desktop, offering detailed time-series data and flexible querying options.

Tools
3
Resources
0
Prompts
0

Leneda Energy MCP Server

MCP server for accessing Leneda energy metering data through Claude Desktop.

Features

  • Detailed Time-Series: 15-minute interval measurements
  • Aggregated Data: Totals, averages, peaks over periods
  • Friendly Names: Use "active_power_export" instead of "1-1:2.29.0"
  • Flexible Queries: Multiple aggregation levels and transformation modes

Installation

cd ~/claudefiles/leneda-mcp-server
pip3 install -r requirements.txt

Configuration

  1. Create .env file:
cp .env.example .env
nano .env
  1. Add your credentials:
LENEDA_API_KEY=your-api-key
LENEDA_ENERGY_ID=your-energy-id
LENEDA_DEFAULT_METERING_POINT=your-metering-point-code
  1. Test it works:
python3 test_server.py
  1. Add to Claude Desktop:

Edit: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "leneda-energy": {
      "command": "python3",
      "args": [
        "/Users/marcdurbach/claudefiles/leneda-mcp-server/server.py"
      ],
      "env": {
        "LENEDA_API_KEY": "your-api-key",
        "LENEDA_ENERGY_ID": "your-energy-id",
        "LENEDA_DEFAULT_METERING_POINT": "your-metering-point"
      }
    }
  }
}
  1. Restart Claude Desktop

Usage

Ask Claude natural language questions:

  • "What was my total energy consumption in January 2025?"
  • "Show me my average daily power production last week"
  • "What was my peak power export yesterday?"
  • "Compare my consumption between January and February"

Available Tools

1. get_detailed_energy_data

Get 15-minute interval measurements.

Parameters:

  • obis_code (required): Measurement type
  • start_datetime (required): ISO format (e.g., "2024-01-01T01:00:00Z")
  • end_datetime (required): ISO format
  • metering_point (optional): Overrides default

2. get_aggregated_energy_data

Get summarized data over periods.

Parameters:

  • obis_code (required): Measurement type
  • start_date (required): Date (e.g., "2025-01-01")
  • end_date (required): Date
  • aggregation_level (optional): QuarterHour, Hour, Day, Month, Year, Infinite
  • transformation_mode (optional): Accumulation, Average, Maximum, Minimum
  • metering_point (optional): Overrides default

3. list_obis_codes

List all available measurement types and usage tips.

OBIS Codes

Energy (kWh)

  • active_energy_import or 1-1:1.8.0 - Energy consumed
  • active_energy_export or 1-1:2.8.0 - Energy produced
  • reactive_energy_import or 1-1:3.8.0 - Reactive imported
  • reactive_energy_export or 1-1:4.8.0 - Reactive exported

Power (kW)

  • active_power_import or 1-1:1.29.0 - Current consumption
  • active_power_export or 1-1:2.29.0 - Current production

Aggregation Options

Levels: QuarterHour, Hour, Day, Month, Year, Infinite

Modes: Accumulation (totals), Average, Maximum (peaks), Minimum

Troubleshooting

Server not showing in Claude?

  • Validate JSON syntax in config file
  • Check file paths are correct
  • View logs: ~/Library/Logs/Claude/mcp*.log

API errors?

  • Run: python3 test_server.py
  • Verify credentials
  • Check date ranges

No data?

  • Confirm data exists in Leneda portal for the period
  • Try shorter time range
  • Verify OBIS code is supported

Examples

Total Monthly Consumption

"What was my total energy import for October 2024?"

Daily Averages

"Show me average daily power production for last month"

Peak Analysis

"What was my maximum power export in January?"

Comparisons

"Compare my consumption between January and February 2025"

API Reference

Detailed Endpoint

GET /api/metering-points/{code}/time-series
?startDateTime=2024-01-01T01:00:00Z
&endDateTime=2024-01-10T01:00:00Z
&obisCode=1-1:2.29.0

Aggregated Endpoint

GET /api/metering-points/{code}/time-series/aggregated
?startDate=2025-01-01
&endDate=2025-01-31
&obisCode=1-1:1.29.0
&aggregationLevel=Day
&transformationMode=Accumulation

License

Personal use with Claude Desktop.

Support