Metrx MCP Server is the official MCP (Model Context Protocol) server launched by Metrx, positioned as an AI Agent cost intelligence platform. Its core goal is to help users discover and correct money waste during the operation of AI agents. Users can connect this MCP server to any agent client that supports MCP (such as Claude, GPT, Gemini, Cursor, Windsurf), enabling the agent to track its own costs, detect waste, optimize model selection, and prove ROI.
[Main Capabilities] The server provides a total of 23 tools, distributed across 10 functional domains:
- Dashboard (3 tools): View spending overview.
- Optimization (4 tools): Optimize model selection.
- Budgets (3 tools): Manage budgets.
- Alerts (3 tools): Alert-related functions.
- Experiments (3 tools): Experiment functions, which can be used to test cheaper models.
- Cost Leak Detector (1 tool): Detect cost leaks.
- Attribution (3 tools): Cost attribution.
- Alert Configuration (1 tool): Alert configuration.
- ROI Audit (1 tool): Return on investment audit.
- Upgrade Justification (1 tool): Upgrade justification.
In addition, preset prompt templates are also provided, covering common workflows, such as "How much have I spent?" "Help me find savings opportunities" "Test a cheaper model".
[How to Use]
- Try without registration: Running it directly starts a server with sample data, allowing you to immediately explore all 23 tools.
- Connect real data:
- Method A (recommended): Interactive login. After running, it opens a browser to obtain an API key, and after verification saves it to ~/.metrxrc, so there is no need to set environment variables afterward.
- Method B: Set METRX_API_KEY via environment variables. A free API key can be obtained at app.metrxbot.com/sign-up.
- Add to an MCP client (Claude Desktop, Cursor, Windsurf): If --auth is used, no env block is needed,The key is automatically read from ~/.metrxrc; the key can also be explicitly passed via an environment variable.
- Remote HTTP endpoint: suitable for remote agents, no local installation required.
An API key is required. The server looks for the key in the following order: the METRX_API_KEY environment variable, then the ~/.metrxrc file (created by --auth). You can run npx @metrxbot/mcp-server --auth to save the key, or simply set the environment variable. If you have already run --auth, there is no need to set it again.
Rate limit: 60 requests per minute per tool. For a higher limit, contact support@metrxbot.com.
[Companion tool: Cost Leak Detector] This repository also includes @metrxbot/cost-leak-detector—a free, offline CLI tool for scanning LLM API logs to find wasted spending. No sign-up, no cloud service, and data never leaves your local machine. It performs 7 checks: idle agents, premium model overuse, missing caching, high error rates, context overflow, no budget, and arbitrage opportunities, and provides a scored report within seconds.
[Use cases]
- Development teams that need to monitor spending across multiple AI agents or model providers.
- AI application developers who want to optimize model selection to reduce costs.
- Managers who need to set budgets, alerts, and cost attribution.
- Business stakeholders who need to prove AI ROI or justify an upgrade.
[Limitations and notes]
- An API key is required.
- Rate limit of 60 requests per minute per tool.
- Naming note: the product name is Metrx (metrxbot.com), the npm scope is @metrxbot, the Smithery listing is metrxbot/mcp-server, and the GitHub organization is metrxbots (with an s), because metrxbot was already taken on GitHub. metrxbot and metrxbots on different platforms refer to the same project.
- License: MIT.
- Website: metrxbot.com; docs: docs.metrxbot.com; npm: @metrxbot/mcp-server; Smithery: metrxbot/mcp-server; support email: support@metrxbot.com.
Other notes: no fee or pricing information is provided in this introduction; for specific pricing, please refer to official channels.