Metrx MCP Server
An MCP server for Metrx — provides tools for construction, healthcare, logistics, manufacturing, and legal mid-market businesses to query and analyze their operational data via AI.
README
Metrx MCP Server
<!-- mcp-name: io.github.metrxbots/mcp-server -->
Your AI agents are wasting money. Metrx finds out how much, and fixes it.
The official MCP server for Metrx — 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.
Why Metrx?
| Problem | What Metrx Does |
|---|---|
| No visibility into agent spend | Real-time cost dashboards per agent, model, and provider |
| Overpaying for LLM calls | Provider arbitrage finds cheaper models for the same task |
| Runaway costs | Budget enforcement with auto-pause when limits are hit |
| Wasted tokens | Cost leak scanner detects retry storms, context bloat, model mismatch |
| Can't prove AI ROI | Revenue attribution links agent actions to business outcomes |
Quick Start
One-command install (Claude Desktop, Cursor, Windsurf)
{
"mcpServers": {
"metrx": {
"command": "npx",
"args": ["@metrxbot/mcp-server"],
"env": {
"METRX_API_KEY": "sk_live_your_key_here"
}
}
}
}
Get your free API key at metrxbot.com/settings/security.
Remote HTTP endpoint
For remote agents (no local install needed):
POST https://metrxbot.com/api/mcp
Authorization: Bearer sk_live_your_key_here
Content-Type: application/json
From npm
npm install @metrxbot/mcp-server
23 Tools Across 10 Domains
Dashboard (2 tools)
| Tool | Description |
|---|---|
metrx_get_cost_summary |
Total spend, call counts, error rates, agent breakdown, and optimization opportunities |
metrx_list_agents |
All agents with status, category, cost metrics, and health indicators |
Optimization (4 tools)
| Tool | Description |
|---|---|
metrx_get_provider_arbitrage |
Compare costs across providers — find cheaper alternatives |
metrx_get_revenue_intelligence |
Revenue per agent with confidence scores and ROI metrics |
metrx_get_token_guardrails |
Token limit recommendations and overflow detection |
metrx_get_model_recommendations |
Model switching recommendations based on cost, latency, quality |
Budgets (4 tools)
| Tool | Description |
|---|---|
metrx_create_budget |
Create monthly/daily budgets with hard, soft, or monitor enforcement |
metrx_update_budget |
Update limits, frequency, or enforcement mode |
metrx_list_budgets |
All budgets with current spend vs. limits |
metrx_delete_budget |
Remove a budget (historical data preserved) |
Alerts (3 tools)
| Tool | Description |
|---|---|
metrx_create_alert_policy |
Alert on cost overages, error rates, latency spikes, anomalies |
metrx_update_alert_policy |
Update thresholds, channels, enable/disable |
metrx_list_alerts |
Active alerts and current status per agent |
Experiments (2 tools)
| Tool | Description |
|---|---|
metrx_start_experiment |
A/B test comparing two LLM models with traffic splitting |
metrx_get_experiment_results |
Statistical significance, cost delta, and recommended action |
Cost Leak Detector (2 tools)
| Tool | Description |
|---|---|
metrx_scan_cost_leaks |
Find cost anomalies and waste across your fleet |
metrx_analyze_cost_leak |
Deep-dive into a specific anomaly with timeline and root cause |
Attribution (2 tools)
| Tool | Description |
|---|---|
metrx_attribute_task |
Link agent actions to business outcomes for ROI tracking |
metrx_get_attribution_report |
Multi-source attribution report with confidence scores |
ROI & Reporting (2 tools)
| Tool | Description |
|---|---|
metrx_get_upgrade_justification |
ROI report for tier upgrades based on usage patterns |
metrx_generate_roi_audit |
Board-ready ROI audit report |
Alert Configuration (2 tools)
| Tool | Description |
|---|---|
metrx_configure_alert_threshold |
Set cost/operational thresholds with email, webhook, or auto-pause |
metrx_get_failure_predictions |
Predictive analysis — identify agents likely to fail before it happens |
Prompts
Pre-built prompt templates for common workflows:
| Prompt | Description |
|---|---|
analyze-costs |
Comprehensive cost overview — spend breakdown, top agents, optimization opportunities |
find-savings |
Discover optimization opportunities — model downgrades, caching, routing |
cost-leak-scan |
Scan for waste patterns — retry storms, oversized contexts, model mismatch |
Examples
"How much am I spending?"
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
"Find me savings"
User: Am I overpaying for my agents?
→ metrx_get_provider_arbitrage(agent_id="agent_123")
Current: GPT-4 @ $15.20/1K calls
Alternative: Gemini 1.5 @ $6.80/1K calls (-55%)
Estimated Savings: $420/month
"Test a cheaper model"
User: Test Claude 3.5 Sonnet against my GPT-4 setup
→ metrx_start_experiment(name="Claude Trial", agent_id="agent_123",
model_a="gpt-4", model_b="claude-3-5-sonnet", traffic_split=10)
Experiment started: 90% GPT-4, 10% Claude 3.5 Sonnet
Check back in 14 days for statistical significance.
Configuration
| Variable | Required | Description |
|---|---|---|
METRX_API_KEY |
Yes | Your Metrx API key (get one free) |
METRX_API_URL |
No | Override API base URL (default: https://metrxbot.com/api/v1) |
Rate Limiting
60 requests per minute per tool. For higher limits, contact support@metrxbot.com.
Development
git clone https://github.com/metrxbots/mcp-server.git
cd mcp-server
npm install
npm run typecheck
npm test
Contributing
See CONTRIBUTING.md for guidelines.
Links
- Website: metrxbot.com
- Docs: docs.metrxbot.com
- npm: @metrxbot/mcp-server
- Smithery: metrxbot/mcp-server
- Support: support@metrxbot.com
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。