# Metrx

Monitor and optimize the operational costs of large language model deployments with real-time spend tracking and performance metrics. Link model actions to specific business outcomes to calculate ret…

## Quick Start

```bash
# Connect this server (installs CLI if needed)
npx -y @smithery/cli@latest mcp add metrxbot/mcp-server

# Browse available tools
npx -y @smithery/cli@latest tool list metrxbot/mcp-server

# Get full schema for a tool
npx -y @smithery/cli@latest tool get metrxbot/mcp-server metrx_get_cost_summary

# Call a tool
npx -y @smithery/cli@latest tool call metrxbot/mcp-server metrx_get_cost_summary '{}'
```

## Direct MCP Connection

Endpoint: `https://mcp-server--metrxbot.run.tools`

**Optional config:**
- `apikey` (query) — Metrx API key for authenticated operations (optional — dashboard and tool listing work without it)

## Tools (23)

- `metrx_get_cost_summary` — Get a comprehensive cost summary for your AI agent fleet. Returns total spend, call counts, error rates, agent breakdow…
- `metrx_list_agents` — List all AI agents in your organization with their status, category, and cost. Optionally filter by status or category.…
- `metrx_get_agent_detail` — Get detailed information about a specific agent including its model, framework, category, outcome configuration, and fa…
- `metrx_get_optimization_recommendations` — Get AI-powered cost optimization recommendations for a specific agent or your entire fleet. Returns actionable suggesti…
- `metrx_apply_optimization` — Apply a one-click optimization recommendation to an agent. Only works for suggestions marked as "one_click: true". Comm…
- `metrx_route_model` — Get a model routing recommendation for a specific task based on complexity. Uses the agent's historical performance dat…
- `metrx_compare_models` — Compare LLM model pricing and capabilities across providers. Returns pricing per 1M tokens, context window sizes, batch…
- `metrx_get_budget_status` — Get the current status of all budget configurations. Shows spending vs limits, warning/exceeded counts, and enforcement…
- `metrx_set_budget` — Create or update a budget configuration for an agent or the entire organization. Budgets enforce spending limits with c…
- `metrx_update_budget_mode` — Change the enforcement mode of an existing budget or pause/resume it. Use "alert_only" for monitoring, "soft_block" for…
- `metrx_get_alerts` — Get active alerts and notifications for your agent fleet. Includes cost spikes, error rate increases, budget warnings, …
- `metrx_acknowledge_alert` — Mark one or more alerts as read/acknowledged. This removes them from the unread alerts list but preserves them in histo…
- `metrx_get_failure_predictions` — Get predictive failure analysis for your agents. Shows upcoming risk of error rate breaches, latency degradation, cost …
- `metrx_create_model_experiment` — Start an A/B test comparing two LLM models for a specific agent. Routes a percentage of traffic to the treatment model …
- `metrx_get_experiment_results` — Get the current results of a model routing experiment. Shows sample counts, metric comparisons, statistical significanc…
- `metrx_stop_experiment` — Stop a running model routing experiment. The experiment results are preserved. If the treatment model won, you can opti…
- `metrx_run_cost_leak_scan` — Run a comprehensive cost leak audit across your entire agent fleet. Identifies 7 types of cost inefficiencies: idle age…
- `metrx_attribute_task` — Link an agent task/event to a business outcome for ROI tracking. This creates a mapping between agent actions and measu…
- `metrx_get_task_roi` — Calculate return on investment for an agent. Shows total costs (LLM API calls), total outcomes (attributed business val…
- `metrx_get_attribution_report` — Get attribution report showing which agent actions led to business outcomes. Shows outcome counts, total values, confid…
- `metrx_get_upgrade_justification` — Generate an ROI report explaining why an upgrade from Free to Lite/Pro tier makes sense. Analyzes current usage pattern…
- `metrx_configure_alert_threshold` — Set up cost or operational alert thresholds for a specific agent or org-wide. Alerts can trigger email notifications, w…
- `metrx_generate_roi_audit` — Generate a comprehensive ROI audit report for your AI agent fleet. Includes per-agent cost/revenue breakdown, attributi…

```bash
# Get full input/output schema for a tool
npx -y @smithery/cli@latest tool get metrxbot/mcp-server <tool-name>
```

## Prompts (3)

- `analyze-costs` — Get a comprehensive overview of your AI agent costs including spend breakdown, top-spending agents, error rates, and op…
- `find-savings` — Discover optimization opportunities across your AI agent fleet. Identifies model downgrades, caching opportunities, and…
- `cost-leak-scan` — Scan for waste patterns in your AI agent operations — retry storms, oversized contexts, model mismatch, and missing cac…
