Enedis Linky MCP Server

by mjrgr

Not rated
GitHub

About

A production-ready Model Context Protocol (MCP) server written in Go that wraps the Conso API, giving AI assistants like Claude direct access to your Enedis Linky smart meter data.

Details

Author
mjrgr
Categories
Other, API

Setup

Install Enedis Linky MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/mjrgr/enedis-linky-mcp-server

Follow the installation instructions in the repository README, then restart your MCP client.

A production-readyModel Context Protocol(MCP) server written in Go that wraps theConso API, giving AI assistants like Claude direct access to yourEnedis Linkysmart meter data.

- Enedis Linky MCP Server ⚡

- Table of Contents
-
Features
-
Prerequisites
-
Quick Start

- 1. Build the binary
-
2. Set your credentials
-
3. Run (stdio mode)
-
Run in SSE mode

- stdio transport
-
SSE transport

- 1. Prepare your env file
-
2. Start the server
-
3. Register with Claude CLI

- 5 MCP toolscovering Linky consumption, load curve, max power, and solar production data
- Bearer token authenticationvia the free
Conso APIproxy
- Automatic retrywith exponential backoff on transient errors
- Rate-limit awareness— respects the 5 req/s and 10k req/h limits
- Dual MCP transportsstdiofor Claude Desktop,ssefor HTTP clients
- Structured logging— JSON logs vialog/slogwith configurable levels
- CI/CD— GitHub Actions for testing, linting, and cross-platform releases

- 🦫Go(latest version recommended)
- 🔑Conso API token— register for free at
conso.boris.sh
- 🆔PRM number— your 14-digit Linky meter identifier (found on your electricity bill)

Log in to yourEnedis customer spaceand enable:

- Enregistrement de la consommation horaire
- Collecte de la consommation horaire

Then register atconso.boris.shto get your free API token and authorize your PRM.

git clone https://github.com/mjrgr/enedis-linky-mcp-server.git cd enedis-linky-mcp-server go mod download make build # Binary is at ./bin/enedis-linky-mcp-server
export CONSO_API_TOKEN="your_token_here" export LINKY_PRM="12345678901234" # optional but recommended
export MCP_TRANSPORT=sse export PORT=8080 ./bin/enedis-linky-mcp-server # Listening on :8080 — point your MCP client at http://localhost:8080/sse

- macOS:~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:%APPDATA%\Claude\claude_desktop_config.json

{ "mcpServers": { "linky": { "command": "/absolute/path/to/bin/enedis-linky-mcp-server", "env": { "CONSO_API_TOKEN": "your_token_here", "LINKY_PRM": "12345678901234" } } } }

Restart Claude Desktop — the Linky tools will appear in the tool list.

- "Show me my electricity consumption for the past week"
- "What was my peak power usage this month?"
- "Compare my daily consumption over the last 30 days"
- "How much solar energy did I produce today?"

The server supports two transports:stdio(default) andSSE(HTTP). SSE is the recommended approach when running via Docker or Podman as it avoids the stdio-in-container overhead.

claude mcp add linky -s local -- docker run -i --rm \ -e CONSO_API_TOKEN=your_token_here \ -e LINKY_PRM=12345678901234 \ ghcr.io/mjrgr/enedis-linky-mcp-server:latest
claude mcp add linky -s local -- /absolute/path/to/bin/enedis-linky-mcp-server

SetCONSO_API_TOKENand optionallyLINKY_PRMin your shell environment before running.

SSE runs the server as a persistent HTTP process. Start it once, then point Claude CLI at its URL.

cp .env.example .env.local # Edit .env.local — set CONSO_API_TOKEN, LINKY_PRM, and MCP_TRANSPORT=sse
CONSO_API_TOKEN=your_token_here LINKY_PRM=12345678901234 MCP_TRANSPORT=sse PORT=8080
docker run --rm \ --env-file .env.local \ -p 8080:8080 \ ghcr.io/mjrgr/enedis-linky-mcp-server:latest
podman build -t enedis-linky-mcp -f Containerfile . podman run --rm \ --env-file .env.local \ -p 8080:8080 \ enedis-linky-mcp
claude mcp add linky --transport sse http://localhost:8080/sse
claude "Show me my electricity consumption for today"
claude "What's my average daily power usage this week?"
docker run --rm \ --env-file .env.local \ -p 8080:8080 \ ghcr.io/mjrgr/enedis-linky-mcp-server:latest
podman build -t enedis-linky-mcp -f Containerfile . podman run --rm \ --env-file .env.local \ -p 8080:8080 \ enedis-linky-mcp

Enable the built-in web dashboard to test your API connection and visualize meter data directly in the browser — no Claude client required.

export CONSO_API_TOKEN=your_token_here export LINKY_DASHBOARD=true export LINKY_PRM=12345678901234 # optional — pre-fills the PRM field in the dashboard ./bin/enedis-linky-mcp-server # Dashboard available at http://localhost:8081

- Connection status— MCP server health + live Conso API reachability check
- Summary stats— total kWh, daily average, peak day, reading count
- Daily Consumptionchart (bar)
- Load Curvechart (30-minute intervals, line)
- Max Powerchart (bar)

docker run --rm \ -e CONSO_API_TOKEN=your_token_here \ -e LINKY_PRM=12345678901234 \ -e LINKY_DASHBOARD=true \ -e MCP_TRANSPORT=sse \ -p 8080:8080 \ -p 8081:8081 \ ghcr.io/mjrgr/enedis-linky-mcp-server:latest

The dashboard runs on aseparate portfrom the MCP SSE transport so both can coexist.

Copy.env.exampleto.env.localand fill in your values for local development.

- Never commit real API tokensto version control. Use environment variables or.env.localfor local development.
- Rotate your tokenif you suspect it is compromised — regenerate it at
conso.boris.sh.
- Report vulnerabilitiesby opening a security issue or emailing the maintainers.

All tools accept aPRM(meter identifier) and adate rangeas parameters. Theprmparameter is optional whenLINKY_PRMis set as an environment variable.

enedis-linky-mcp-server/ ├── cmd/ │ └── server/ │ └── main.go # Entrypoint — wires config, client, service, MCP server ├── internal/ │ ├── config/ │ │ └── config.go # ENV-based configuration with validation │ ├── client/ │ │ └── client.go # Typed HTTP client — retry, backoff, User-Agent │ ├── service/ │ │ └── service.go # Business logic — validation, aggregation │ └── mcp/ │ ├── server.go # MCP server lifecycle (stdio / SSE transport) │ └── tools.go # Tool definitions & handlers ├── .github/ │ └── workflows/ │ ├── ci.yml # lint → test → build │ └── release.yml # GoReleaser + Docker (triggered on tags) ├── Containerfile # Multi-stage, distroless final image ├── Makefile # Developer shortcuts ├── .env.example # Configuration template └── go.mod
# Install dependencies go mod download # Run tests make test # Lint make lint # Build for all platforms make build # Build container image podman build -f Containerfile .

ℹ️ Check that yourCONSO_API_TOKENis valid and your PRM is authorized in yourconso.boris.shaccount before reporting issues.

- Q: I get401 Unauthorizederrors.

- A: Your token is invalid or expired. Regenerate it atconso.boris.sh.

- A: Your PRM is not authorized on your Conso API account. Make sure you've added and confirmed it.

- A: EnsureCollecte de la consommation horaireis enabled on your Enedis account and that the date range is not in the future.

- A: Ensure the server is running and the address/port matches your CLI config. Check firewall or container port mappings.

- A: The Conso API allows 5 req/s and 10k req/h. The server retries automatically, but reduce query frequency if errors persist.

- GitHub Issues— bug reports and feature requests
-
Discussions— Q&A, ideas, and community help

Contributions are welcome! To get started:
- Fork the repository
- Create a new branch for your feature or fix
- Make your changes and add tests if needed
- Open a pull request with a clear description

Please seeCONTRIBUTING.mdor open an issue to discuss major changes first.

- Conso APIbyBoris K— the underlying free Linky data proxy (GPL-3.0)
-
mcp-go— Go MCP SDK

Interact with the Flespi telematics platform API for fleet management, device tracking, and telemetry data processing.

Interact with your TagoIO account to access devices, data, and platform resources for development and intelligent data analysis.

Global postal code lookups, validation, and city search for 70+ countries. Sub-10ms responses.

Connect to any financial, utility, billing accounts; retrieve balance, transactions, payment and identity data instantly.

A healthcare MCP server for EMRs like Cerner and Epic, providing tools to interact with FHIR data and medical resources.

65+ AI tools as an MCP server. Research, write, code, scrape, translate, analyze, agent memory, workflows. Pay per call from $0.006.

Real-time flight tracking, airport schedules, delays, and reference data for airlines, airports, aircraft, and routes via the AirLabs API.

MCP server that connects to the Airplanes.live API to provide real-time flight and aircraft data for analysis or visualization.

A Model Context Protocol (MCP) server that provides comprehensive access to the ALMA (Atacama Large Millimeter/submillimeter Array) archive through a clean, extensible architecture.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.