Tracks AI agent spend across providers, suggests cheaper model choices, enforces budgets, detects cost leaks and reports ROI.
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add metrx --env METRX_API_KEY='<METRX_API_KEY>' -- npx -y @metrxbot/mcp-server~/.codex/config.toml
[mcp_servers.metrx]
command = "npx"
args = ["-y", "@metrxbot/mcp-server"]
env = { METRX_API_KEY = "<METRX_API_KEY>" }
# codex mcp add metrx --env METRX_API_KEY='<METRX_API_KEY>' -- npx -y @metrxbot/mcp-server~/.cursor/mcp.json
{
"mcpServers": {
"metrx": {
"command": "npx",
"args": [
"-y",
"@metrxbot/mcp-server"
],
"env": {
"METRX_API_KEY": "<METRX_API_KEY>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"metrx": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@metrxbot/mcp-server"
],
"env": {
"METRX_API_KEY": "<METRX_API_KEY>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"metrx": {
"command": "npx",
"args": [
"-y",
"@metrxbot/mcp-server"
],
"env": {
"METRX_API_KEY": "<METRX_API_KEY>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"metrx": {
"command": "npx",
"args": [
"-y",
"@metrxbot/mcp-server"
],
"env": {
"METRX_API_KEY": "<METRX_API_KEY>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"metrx": {
"command": "npx",
"args": [
"-y",
"@metrxbot/mcp-server"
],
"env": {
"METRX_API_KEY": "<METRX_API_KEY>"
}
}
}
}Environment variables
METRX_API_KEY
Replace the placeholders with your own credentials and keep them out of version control.