Skip to main content
MCP server CX Codex

Metrx — Claude Code MCP server: what it does, how to install

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

no license 1,849 installs updated 2026-03-04

Install into Claude Code · Platform CLI: remote server All methods and platforms ↓
claude mcp add --transport http mcp-server https://mcp-server--metrxbot.run.tools
Open on GitHub

What Metrx 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.

What it helps with

  • 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 for the agent

  • 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

How to install Metrx

Platform CLI: remote server

claude mcp add --transport http mcp-server https://mcp-server--metrxbot.run.tools

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about Metrx

How to install Metrx in Claude Code?

Run claude mcp add --transport http metrx https://mcp-server--metrxbot.run.tools in your terminal.

What does Metrx do?

It gives coding assistants access to cost auditing, model comparisons, automated budget enforcement, and ROI tracking for AI agents.

Can Metrx halt tasks when spending exceeds limits?

Yes. When you configure budgets with metrx_set_budget or metrx_update_budget_mode, setting the mode to hard_block strictly cuts off further spending.

Similar MCP servers

All MCP servers for AI and ML →

Project sponsors

Companies that keep this analytics open