# Metrx

Metrx tracks LLM deployment spend, highlights budget drains, and routes tasks to cost-effective models.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · 1849 installs
- Author: metrxbot
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://smithery.ai/server/metrxbot/mcp-server
- Updated: 2026-03-04
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/metrx

## What it does

The server connects agent fleets to expense tracking and governance tools. It exposes functions such as `metrx_get_cost_summary` to review total token spend, error rates, and outcome attribution. The audit tool `metrx_run_cost_leak_scan` detects idle agents, excessive context sizes, missed cache setups, and cross-provider arbitrage chances.

Spending limits support three modes: notification-only (`alert_only`), overridable limits (`soft_block`), and strict prevention (`hard_block`). You can also run live model A/B tests to assess latency and output quality before switching defaults. Halting an evaluation via `metrx_stop_experiment` is permanent, so keep tests running until results reach statistical confidence.

## Requirements
- Remote server: `https://mcp-server--metrxbot.run.tools`

## Install

### Claude Code (native platform)

**Platform CLI: remote server**
```bash
claude mcp add --transport http mcp-server https://mcp-server--metrxbot.run.tools
```

### Codex

**Platform CLI: remote server**
```bash
codex mcp add metrx --url https://mcp-server--metrxbot.run.tools
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "metrx": {
            "url": "https://mcp-server--metrxbot.run.tools"
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "metrx": {
            "type": "http",
            "url": "https://mcp-server--metrxbot.run.tools"
        }
    }
}
```

### Gemini CLI

**Platform CLI: remote server**
```bash
gemini mcp add -t http metrx https://mcp-server--metrxbot.run.tools
```

## When to use it
- scan agent fleets for idle runs and context bloat
- run live A/B tests between two LLMs to evaluate cost and latency
- enforce dollar spending caps with hard-block rules
- attribute agent task expenditures to measured business returns

## Example prompts
- Check fleet spending with `metrx_get_cost_summary` and list the highest cost agents
- Run `metrx_run_cost_leak_scan` to spot missing caches and oversized context
- Set an alert-only budget limit using `metrx_set_budget`

## Similar
- [overspend](https://affpapa.org/en/nevibecode/commands/overspend.md) — command · ★ 1198 repo stars
- [Awesome JEV](https://affpapa.org/en/nevibecode/mcp/awesome-jev.md) — MCP server · ★ 13 repo stars
- [claude-code-proxy-patterns](https://affpapa.org/en/nevibecode/skills/claude-code-proxy-patterns.md) — skill · 106 installs
- [savings](https://affpapa.org/en/nevibecode/skills/savings.md) — skill · ★ 130 repo stars
- [Plith Operations](https://affpapa.org/en/nevibecode/mcp/plith-operations.md) — MCP server · 1280 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
