eco2mix-mcp
Connects to real-time French power grid data (carbon intensity, consumption, generation mix) to make Kiro carbon-aware, enabling it to defer heavy jobs when the grid is dirty.
README
eco2mix-mcp — Carbon-Aware Kiro 🌱⚡
eco2mix-mcp is a custom MCP server that connects Kiro to the French power grid in real time (RTE éCO2mix open data: carbon intensity, consumption, generation mix — no API key needed). Paired with a steering rule, it makes Kiro carbon-aware: before launching a heavy job (test suite, docker build, batch), Kiro checks the live grid and answers GO or DEFER. Run your builds when the electrons are clean.
Built for Day 5 of the Kiro Birthday challenge (https://kiro.dev/birthday/): "Build a custom MCP integration".
How Kiro was used
Kiro was used end-to-end, spec-first. The .kiro/specs/eco2mix-mcp/
folder contains the requirements (EARS-style acceptance criteria), the
design (architecture, thresholds, error handling), and the task list that
drove the build — from validating the ODRE open-data API (including its
trap: future 15-minute slots exist with null values and must be filtered)
to implementing and testing the server.
The MCP server is built with the official Python MCP SDK (FastMCP, stdio transport). The pure logic is covered by 8 unit tests; the MCP handshake and each tool were verified against the real API before wiring anything into Kiro.
The integration is registered in .kiro/settings/mcp.json,
so Kiro spawns the server automatically. The interesting part is
.kiro/steering/carbon-aware.md: it
instructs Kiro to call should_i_run_now before launching any heavy
command (full test suite, docker build, batch job, model training) and to
act on the verdict — GO when the grid is CLEAN, defer when fossil peakers
push the intensity up. In the demo, Kiro is asked whether it should run a
full test suite and docker build now: it calls the tool, reads
11 gCO2/kWh (CLEAN, stable trend over the last 2 hours), and answers GO
with its reasoning. This is something Kiro fundamentally could not do
without the integration: no training data can know the state of the power
grid right now.
What it connects to
RTE éCO2mix real-time national data,
served by the ODRE open-data platform
(dataset eco2mix-national-tr). Live, 15-minute resolution:
electricity consumption, carbon intensity (gCO2eq/kWh), and the full
generation mix (nuclear, wind, solar, hydro, gas, coal, oil, bioenergy).
No API key. No secrets. Public open data (Etalab open licence).
Why it matters: an LLM's training data can never know that the French grid is at 11 gCO2/kWh right now because solar is peaking. This integration gives Kiro that knowledge — and something it genuinely could not do without it.
Tools
| Tool | What Kiro gets |
|---|---|
get_current_grid |
Full live snapshot: consumption, intensity, generation mix |
get_carbon_intensity |
gCO2/kWh + verdict: CLEAN / MODERATE / DIRTY |
get_mix_breakdown |
Generation by source (MW), low-carbon & renewable shares |
should_i_run_now |
GO / GO_WITH_CAUTION / DEFER for a heavy job + 2h trend |
What I built with it: a carbon-aware Kiro
.kiro/steering/carbon-aware.md instructs Kiro to call should_i_run_now
before launching any heavy command (full test suite, docker build,
batch job, model training) and to act on the recommendation:
- 🟢
GO— grid is clean, run it (and say the current intensity) - 🟡
GO_WITH_CAUTION— urgent work only - 🔴
DEFER— fossil peakers running; Kiro proposes to wait for a cleaner window using the 2-hour trend
Shifting deferrable compute to low-carbon windows is one of the simplest green-IT practices. This project makes Kiro apply it automatically.
Beyond the demo: a local build is just the illustration — its footprint is symbolic. The pattern is what scales: CI/CD farms, data batch jobs, ML training, any deferrable workload that can slide a few hours into a low-carbon window. This is the core idea of carbon-aware computing, applied to a coding agent.
Setup
git clone https://github.com/el-pedrito/eco2mix-mcp.git
cd eco2mix-mcp
python3 -m venv .venv
./.venv/bin/pip install -r requirements.txt
./.venv/bin/pytest tests/ # 8 tests, no network needed
The server is registered for Kiro in .kiro/settings/mcp.json (stdio):
{
"mcpServers": {
"eco2mix": {
"command": ".venv/bin/python",
"args": ["server/eco2mix_mcp.py"]
}
}
}
Open Kiro in this folder and ask:
"Should I run my full test suite and docker build now?"
Kiro calls the MCP server, which queries the live grid, and answers with the current carbon intensity, the trend, and a go/defer recommendation.
Configuration (optional, no secrets)
See .env.example. Everything works with zero configuration; you can
tune thresholds and timeouts via environment variables:
| Variable | Default | Purpose |
|---|---|---|
ECO2MIX_CLEAN_THRESHOLD |
25 |
Max gCO2/kWh for a CLEAN verdict |
ECO2MIX_MODERATE_THRESHOLD |
60 |
Max gCO2/kWh for MODERATE |
ECO2MIX_TIMEOUT_S |
15 |
HTTP timeout |
ECO2MIX_API_BASE |
ODRE endpoint | Override the data endpoint |
Demo

Kiro calls the eco2mix MCP server, which queries the live French grid,
and decides whether to run the heavy job — end-to-end (MCP server → ODRE
API → live grid data → Kiro's decision).
Full-quality video (mp4, 65s).
Project structure
server/eco2mix_mcp.py # the MCP server (FastMCP, stdio, ~180 lines)
tests/test_eco2mix.py # unit tests on the pure logic
.kiro/settings/mcp.json # Kiro wiring
.kiro/steering/carbon-aware.md # the carbon-aware behavior
.kiro/specs/eco2mix-mcp/ # the Kiro spec that drove the build
Data & licence
Data: RTE éCO2mix via ODRE, Etalab open licence. Scope: France national grid. Carbon intensity method: RTE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。