The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Green MCP listing page.
A pluggable MCP server that measures two efficiency axes of a program and refactors it to be cheaper while preserving behavior:
Defining principle: measure, never estimate. Every claim is a measurement with the command, the number, and its run-to-run uncertainty — or it's labeled an estimate. The comparison verdict is a real statistical test (Welch's t with the idle-baseline uncertainty folded in), not a heuristic.
Mount it in your IDE (configs in deploy/):
| IDE | File |
|---|---|
| Claude Code | .mcp.json |
| Cursor | .cursor/mcp.json |
| OpenAI Codex | ~/.codex/config.toml (codex mcp add green -- green-mcp) |
| Google Antigravity | ~/.gemini/config/mcp_config.json |
Then ask your agent to measure or compare energy/tokens of a command. See
deploy/README.md for the full mount + harness guide.
measure_energy · compare_energy · measure_tokens · compare_tokens ·
verify_equivalence · energy_backend_info
No server to host. green-mcp is not a web service — your IDE launches it as a local stdio subprocess. There's no cloud, no account, and no LLM key needed for the measurement server itself.
| To run the server | Python 3.10+, pip install green-mcp. That's it — tools mount immediately. |
|---|
Energy axis — needs a power-sensor backend on the host (the largest prerequisite):
/sys/class/powercap (RAPL); no extra install, but energy_uj is root-only on
some distros.powermetrics, which requires root / passwordless sudo.energy_available: false and refuse to estimate. Energy generally does NOT work in Docker/CI —
containers and VMs have no power-sensor passthrough. Use the token axis there.Token axis — no special hardware, works anywhere, but:
ANTHROPIC_BASE_URL,
OPENAI_BASE_URL, …) so we can route it through the counting proxy. A hardcoded endpoint won't be
measured (reports 0 calls).Bundled agent (optional) — pip install green-mcp[agent] adds the Claude Agent SDK and needs
Anthropic credentials. The MCP server alone needs none.
usage path and rate-limit behavior are still only
exercised against a local fake upstream. These gaps are tracked, not hidden.Architecture and decisions live in North Star.md, Green.md,
and docs/. Licensed under MIT.