MCP Server logo

MCP Server

by metrxbots

Track AI agent costs, budgets, optimization opportunities, alerts, experiments, and ROI through 23 MCP tools.

Install MCP Server

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "metrxbots-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@metrxbot/mcp-server"
      ],
      "env": {
        "METRX_API_KEY": "YOUR_VALUE_HERE",
        "METRX_API_URL": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y @metrxbot/mcp-server

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked 1mo ago.

Overview

The metrxbots/mcp-server MCP server exposes Metrx cost intelligence features to MCP-compatible agents through local stdio or a remote HTTP endpoint. It provides 23 tools for spend reporting, agent inspection, model comparison and routing, budget enforcement, alerts, experiments, cost-leak scans, attribution, and ROI reporting. Use demo mode to explore sample data without credentials, or authenticate with a Metrx API key for real account data. It fits teams that need agent-level cost visibility and controls from Claude Desktop, Cursor, or Windsurf.

Use cases

  • Review weekly AI spend by agent and provider
  • Compare models and identify lower-cost routing options
  • Set budgets with hard, soft, or monitor enforcement
  • Scan an agent fleet for retry, context, and model waste
  • Track agent costs against attributed business outcomes

Key features

  • Cost summaries and agent-level metrics
  • Model comparison, routing, and experiments
  • Budget creation and enforcement controls
  • Alerts and predictive failure analysis
  • Cost leak scanning and optimization recommendations
  • ROI attribution and audit reports

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

18/22 checks healthy over the last 79d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 9d ago via OSV.dev · @metrxbot/mcp-server (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars2Stargazers on the source repository.
npm downloads281Package downloads in the last 30 days.
Last commit15d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Directory activity6 viewsConfig copies, upvotes, and views on AllMCPs.

How MCP Server works

What metrxbots/mcp-server MCP server does

The metrxbots/mcp-server MCP server connects an MCP-compatible agent to Metrx, an AI agent cost intelligence platform. Its tool set covers operational cost analysis rather than general-purpose model execution. Agents can inspect spend, call volume, error rates, model usage, agent health, budgets, alerts, and optimization opportunities.

The server also supports actions and analysis beyond reporting. It can apply an optimization recommendation, create or stop a model-routing experiment, change budget enforcement, acknowledge alerts, attribute agent work to business outcomes, and generate ROI-oriented reports. A separate cost leak detector package is included in the repository, but it is an offline CLI rather than part of this server's MCP tool set.

How it works

The metrxbots/mcp-server MCP server communicates with the Metrx API when connected to real account data. The API key can come from the METRX_API_KEY environment variable or from ~/.metrxrc, which is created by the interactive authentication flow. METRX_API_URL can override the default API base URL of https://metrxbot.com/api/v1.

For evaluation, npx @metrxbot/mcp-server --demo starts the server with sample data and does not require signup or an API key. The normal client configuration starts the package over stdio. A remote option is also documented at https://metrxbot.com/api/mcp, where requests use a bearer token and JSON content type.

Setup and configuration

Install and run the package with:

Terminal
npx -y @metrxbot/mcp-server

To authenticate interactively, run npx @metrxbot/mcp-server --auth. The process opens a browser, obtains and validates an API key, then stores it in ~/.metrxrc. Alternatively, set METRX_API_KEY in the environment. The README identifies the key as free to obtain through the Metrx sign-up page.

An MCP client can use this stdio configuration:

config.json
{
  "mcpServers": {
    "metrx": {
      "command": "npx",
      "args": ["@metrxbot/mcp-server"]
    }
  }
}

If the key is not stored in ~/.metrxrc, add METRX_API_KEY under the client's env object. Claude Desktop, Cursor, and Windsurf are named as supported client examples.

Tools and capabilities

The 23 tools are organized into ten functional areas:

  • Dashboard tools summarize costs and list or inspect agents.
  • Optimization tools recommend changes, apply recommendations, route tasks to models, and compare provider pricing and capabilities.
  • Budget tools report status, create or update limits, and change enforcement modes including hard, soft, monitor, paused, and resumed states.
  • Alert tools retrieve and acknowledge alerts and provide failure predictions.
  • Experiment tools run traffic-split model comparisons, report results, and stop experiments.
  • Cost leak scanning audits for waste patterns across an agent fleet.
  • Attribution tools connect agent actions with outcomes and calculate task or fleet ROI.
  • Alert configuration sets cost or operational thresholds with email, webhook, or auto-pause behavior.
  • ROI audit produces a report intended for review of agent-fleet returns.
  • Upgrade justification evaluates tier upgrades using current usage patterns.

Prompt templates named analyze-costs, find-savings, and cost-leak-scan provide predefined workflows for common investigations.

Limitations and notes

Real-data operation depends on access to the Metrx API and normally requires an API key, although the server can use a locally saved key instead of an environment variable. Demo mode uses sample data and therefore is not a substitute for checking an actual account.

The repository is licensed under MIT. The companion cost leak detector is separate from the MCP server: it scans local LLM API logs offline and should not be represented as one of the server's 23 MCP tools.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP Server

Run `npx -y @metrxbot/mcp-server` for a local stdio launch.

Yes. Claude Desktop is listed among the MCP clients that can connect through the documented stdio configuration.

Real account data requires a Metrx API key, supplied through `METRX_API_KEY` or `~/.metrxrc`. Demo mode runs with sample data and no key.

Its tools cover spend, call counts, error rates, agents, budgets, alerts, model usage, cost leaks, optimization opportunities, and ROI attribution.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/metrxbots-mcp-server?style=directory)](https://allmcps.com/mcp/metrxbots-mcp-server)
HTML Embed
<a href="https://allmcps.com/mcp/metrxbots-mcp-server"><img src="https://allmcps.com/api/badge/metrxbots-mcp-server?style=directory" alt="MCP Server on AllMCPs" /></a>