Enedis Linky MCP Server
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.
Enedis Linky MCP Server ⚡
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.
Table of Contents
- Enedis Linky MCP Server ⚡
Features
- 5 MCP tools covering Linky consumption, load curve, max power, and solar production data
- Bearer token authentication via the free Conso API proxy
- Automatic retry with exponential backoff on transient errors
- Rate-limit awareness — respects the 5 req/s and 10k req/h limits
- Dual MCP transports —
stdiofor Claude Desktop,ssefor HTTP clients - Structured logging — JSON logs via
log/slogwith configurable levels - CI/CD — GitHub Actions for testing, linting, and cross-platform releases
Prerequisites
- 🦫 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)
How to enable data collection on your Enedis account
Log in to your Enedis customer space and enable:
- Enregistrement de la consommation horaire
- Collecte de la consommation horaire
Then register at conso.boris.sh to get your free API token and authorize your PRM.
Quick Start
1. Build the binary
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
2. Set your credentials
export CONSO_API_TOKEN="your_token_here"
export LINKY_PRM="12345678901234" # optional but recommended
3. Run (stdio mode)
./bin/enedis-linky-mcp-server
Run in SSE mode
export MCP_TRANSPORT=sse
export PORT=8080
./bin/enedis-linky-mcp-server
# Listening on :8080 — point your MCP client at http://localhost:8080/sse
Using with Claude Desktop
Edit your Claude Desktop config file:
- 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.
You can then ask things like:
- "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?"
Using with Claude CLI
The server supports two transports: stdio (default) and SSE (HTTP). SSE is the recommended approach when running via Docker or Podman as it avoids the stdio-in-container overhead.
stdio transport
Docker
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
Local binary
claude mcp add linky -s local -- /absolute/path/to/bin/enedis-linky-mcp-server
Set CONSO_API_TOKEN and optionally LINKY_PRM in your shell environment before running.
SSE transport
SSE runs the server as a persistent HTTP process. Start it once, then point Claude CLI at its URL.
1. Prepare your env file
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
2. Start the server
Docker
docker run --rm \
--env-file .env.local \
-p 8080:8080 \
ghcr.io/mjrgr/enedis-linky-mcp-server:latest
Podman
podman build -t enedis-linky-mcp -f Containerfile .
podman run --rm \
--env-file .env.local \
-p 8080:8080 \
enedis-linky-mcp
3. Register with Claude CLI
claude mcp add linky --transport sse http://localhost:8080/sse
Example usage
claude "Show me my electricity consumption for today"
claude "What's my average daily power usage this week?"

Docker
docker run --rm \
--env-file .env.local \
-p 8080:8080 \
ghcr.io/mjrgr/enedis-linky-mcp-server:latest
Build locally with Podman
podman build -t enedis-linky-mcp -f Containerfile .
podman run --rm \
--env-file .env.local \
-p 8080:8080 \
enedis-linky-mcp
Dashboard
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
The dashboard provides:
- Connection status — MCP server health + live Conso API reachability check
- Summary stats — total kWh, daily average, peak day, reading count
- Daily Consumption chart (bar)
- Load Curve chart (30-minute intervals, line)
- Max Power chart (bar)

With Docker
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 a separate port from the MCP SSE transport so both can coexist.
Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
CONSO_API_TOKEN | Yes | — | Conso API bearer token (get yours at conso.boris.sh) |
LINKY_PRM | No | — | Default PRM (14-digit meter identifier). When set, the prm parameter becomes optional in all MCP tool calls and is pre-filled in the dashboard. |
MCP_TRANSPORT | No | stdio | stdio (Claude Desktop) or sse (HTTP server) |
PORT | No | 8080 | HTTP port for SSE transport |
LOG_LEVEL | No | info | Log level: debug, info, warn, error |
CONSO_API_BASE_URL | No | https://conso.boris.sh/api | API base URL override (for testing) |
LINKY_DASHBOARD | No | false | Set to true to enable the web dashboard |
LINKY_DASH_ADDR | No | :8081 | Listen address for the dashboard (e.g. :8081) |
Copy
.env.exampleto.env.localand fill in your values for local development.
Security
🔒 Security Best Practices
- Never commit real API tokens to version control. Use environment variables or
.env.localfor local development. - Rotate your token if you suspect it is compromised — regenerate it at conso.boris.sh.
- Report vulnerabilities by opening a security issue or emailing the maintainers.
MCP Tools Reference
| Tool | Description |
|---|---|
get_daily_consumption | Daily electricity consumption (Wh) for a date range |
get_load_curve | 30-minute average power readings (W) |
get_max_power | Maximum power reached each day (VA) |
get_daily_production | Daily solar production (Wh) for solar installations |
get_production_load_curve | 30-minute average production power readings (W) |
All tools accept a PRM (meter identifier) and a date range as parameters.
The prm parameter is optional when LINKY_PRM is set as an environment variable.
Project Structure
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
Development
# 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 .
Troubleshooting
ℹ️ Check that your
CONSO_API_TOKENis valid and your PRM is authorized in your conso.boris.sh account before reporting issues.
- Q: I get
401 Unauthorizederrors.- A: Your token is invalid or expired. Regenerate it at conso.boris.sh.
- Q: I get
403 Forbiddenerrors.- A: Your PRM is not authorized on your Conso API account. Make sure you've added and confirmed it.
- Q: No data is returned for my date range.
- A: Ensure Collecte de la consommation horaire is enabled on your Enedis account and that the date range is not in the future.
- Q: Claude CLI can't connect to the MCP server.
- A: Ensure the server is running and the address/port matches your CLI config. Check firewall or container port mappings.
- Q: I get rate limit errors.
- A: The Conso API allows 5 req/s and 10k req/h. The server retries automatically, but reduce query frequency if errors persist.
Community & Support
- GitHub Issues — bug reports and feature requests
- Discussions — Q&A, ideas, and community help
Contributing
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 see CONTRIBUTING.md or open an issue to discuss major changes first.
License
Acknowledgements
相关服务器
Learning Hub
AI learning assistant that manages game time rewards based on school grades, homework, and bonus tasks
Philidor MCP
DeFi vault risk analytics for AI agents. Search 700+ vaults across Morpho, Aave, Yearn, Beefy, Spark, and more. Compare risk scores, analyze protocols, run due diligence — all through natural language. No API key required. No installation needed.
Gaggimate MCP
Allows an LLM agent to control your Gaggimate espresso machine
MCP Media Processing Server
A server for media processing, offering powerful video and image manipulation using FFmpeg and ImageMagick.
RuneScape
Interact with RuneScape (RS) and Old School RuneScape (OSRS) data, including item prices and player hiscores.
Suppr-MCP (超能文献)
Suppr - AI-powered document translation and academic search service. Supports high-quality translation of PDF, DOCX, PPTX and other formats in 11 languages with optimized mathematical formula handling. Includes PubMed-integrated intelligent literature search for researchers. https://suppr.wilddata.cn/
CHeema-Text-to-Voice-MCP-Server
AI-powered text-to-speech MCP server with instant voice cloning. Generate speech from Claude Desktop, Claude Code, or n8n using 5 built-in voices (English, German, French, Spanish) or clone any voice from a short audio sample. Runs fully local, no API keys, no cloud. Supports stdio, SSE, and HTTP transports.
QMT MCP Server
An MCP server that interfaces with the locally running MiniQMT trading system.
SettlementWitness MCP
SettlementWitness is a stateless MCP verification tool that returns replay-stable settlement receipts (PASS/FAIL) by forwarding task_id, spec, and output to the Default Settlement Verifier. Designed for agent execution gating and x402 settlement flows.
402 Index
MCP server for 402 Index: discover 15,000+ paid API endpoints across L402, x402, and MPP