Metrx MCP Server

by metrxbots

Not rated
GitHub

About

Track AI agent costs, detect waste, optimize models, and prove ROI. 23 MCP tools for LLM cost tracking, provider arbitrage, budget enforcement, and revenue attribution.

Details

Author
metrxbots
Categories
Cloud Service, AI, Other, Infrastructure

Setup

Install Metrx MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/metrxbots/mcp-server

Follow the installation instructions in the repository README, then restart your MCP client.

Track AI agent costs, detect waste, optimize models, and prove ROI. 23 MCP tools for LLM cost tracking, provider arbitrage, budget enforcement, and revenue attribution.

Your AI agents are wasting money.Metrx finds out how much, and fixes it.

The officialMCP serverforMetrx— the AI Agent Cost Intelligence Platform. Give any MCP-compatible agent (Claude, GPT, Gemini, Cursor, Windsurf) the ability to track its own costs, detect waste, optimize model selection, and prove ROI.

This starts the server with sample data so you can explore all 23 tools instantly.

Option A — Interactive login (recommended):

Opens your browser to get an API key, validates it, and saves it to~/.metrxrcso you never need to set env vars.

METRX_API_KEY=sk_live_your_key_here npx @metrxbot/mcp-server --test

Get your free API key atapp.metrxbot.com/sign-up.

Add to your MCP client (Claude Desktop, Cursor, Windsurf)

If you used--auth, noenvblock is needed — the key is read from~/.metrxrcautomatically:

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

Or pass the key explicitly via environment:

{ "mcpServers": { "metrx": { "command": "npx", "args": ["@metrxbot/mcp-server"], "env": { "METRX_API_KEY": "sk_live_your_key_here" } } } }

For remote agents (no local install needed):

POST https://metrxbot.com/api/mcp Authorization: Bearer sk_live_your_key_here Content-Type: application/json

Pre-built prompt templates for common workflows:

User: What was my AI cost this week? → metrx_get_cost_summary(period_days=7) Total Spend: $234.56 | Calls: 2,450 | Error Rate: 0.2% ├── customer-support: $156.23 (1,800 calls) └── code-generator: $78.33 (650 calls) 💡 Switch customer-support from GPT-4 to Claude Sonnet: Save $42/week
User: Am I overpaying for my agents? → metrx_compare_models(models=["gpt-4o", "claude-3-5-sonnet", "gemini-1.5-pro"]) Model Comparison (per 1M tokens): ├── gpt-4o: $2.50 in / $10.00 out ├── claude-3-5-sonnet: $3.00 in / $15.00 out └── gemini-1.5-pro: $3.50 in / $10.50 out
User: Test Claude 3.5 Sonnet against my GPT-4 setup → metrx_create_model_experiment(agent_id="agent_123", model_a="gpt-4o", model_b="claude-3-5-sonnet-20241022", traffic_split=10) Experiment started: 90% GPT-4o, 10% Claude 3.5 Sonnet Check back in 14 days for statistical significance.

This repo also includes@metrxbot/cost-leak-detector— a free, offline CLI that scans your LLM API logs for wasted spend. No signup, no cloud, no data leaves your machine.

It runs 7 checks (idle agents, premium model overuse, missing caching, high error rates, context overflow, no budgets, arbitrage opportunities) and gives you a scored report in seconds. See thefull docs.

The server looks for your API key in this order:
- METRX_API_KEYenvironment variable
- ~/.metrxrcfile (created by--auth)

Runnpx @metrxbot/mcp-server --authto save your key, or set the env var directly.

*Not required if you've run--auth— the key is read from~/.metrxrcautomatically.

60 requests per minute per tool. For higher limits, contactsupport@metrxbot.com.

git clone https://github.com/metrxbots/mcp-server.git cd mcp-server npm install npm run typecheck npm test

- Website:metrxbot.com
- Docs:
docs.metrxbot.com
- npm:
@metrxbot/mcp-server
- Smithery:
metrxbot/mcp-server
- Support:
support@metrxbot.com

The product isMetrx(metrxbot.com). The npm scope is@metrxbotand the Smithery listing ismetrxbot/mcp-server. The GitHub organization ismetrxbots(with ans) becausemetrxbotwas already taken on GitHub. If you seemetrxbotvsmetrxbotsacross platforms, they're the same project — just a GitHub namespace constraint.

Did Metrx work for you? We'd love to hear it — good or bad.

- GitHub Discussions:Start a thread— questions, ideas, what you're building
- Bug reports:
Open an issue
- Quick feedback: Drop a comment on our
Product Hunt listing

If you installed but hit a snag, tell us what happened — we read every report.

MCP server for Langfuse — query traces, debug errors, analyze sessions and prompts from any AI agent

Behavioral trust scoring for MCP servers and AI agents. Live registry tracking 4,500+ servers with trust scores based on interaction history, success rates, and latency.

Paid remote MCP for AI agent run monitoring, failure detection, tool-call incident replay, SLA receipts, and client status exports.

Monitor team productivity, usage, and spending for AI assistants using the Cursor Admin API.

Behavioral trust layer for the AI agent economy. Check MCP server reliability scores, report interactions, detect anomalies, and discover the most trusted servers. 8 tools, free, real-time.

Behavioral trust scoring for 14,820+ MCP servers. Check reliability, latency, and success rates before tool calls.

An MCP server for fetching conversation history and prompts from the LangSmith observability platform.

Multi-Agent Monitoring LangFuse MCP Server

A Model Context Protocol (MCP) server for comprehensive monitoring and observability of multi-agent systems using Langfuse.

Structural observability for AI conversations. Detects loops, stuck states, and convergence patterns across 17 channels without analyzing content.

Prompt analytics MCP server: score prompts, search history, detect leaked credentials, and scan AI coding sessions.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.