Measure a program's CPU energy and LLM tokens, then refactor it cheaper. Measure, never estimate.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
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.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/green-mcp)<a href="https://allmcps.com/mcp/green-mcp"><img src="https://allmcps.com/api/badge/green-mcp?style=directory" alt="Green MCP on AllMCPs" /></a>