io.github.lazymac2x/ai-cost-optimizer is an MCP server published by io.github.lazymac2x, hosted at api.lazy-mac.com. When last checked on 2026-11-21 it was working: it answers and lists its tools. It declares 5 tools, including cost_tracker, token_calculator, budget_alert, model_breakdown, cost_forecast.
Cloudflare Workers MCP server: ai-cost-optimizer
160 connections through 5 shared values. Tap any node.
Record and retrieve AI API call costs by team. Persists to Cloudflare KV — survives cold starts and scale-out.
| Parameter | Type | Description |
|---|---|---|
| team | string | Team or project identifier (default: "default") |
| model | string | Model ID (e.g., claude-3-5-sonnet-20241022, gpt-4o, gemini-2.0-flash) |
| action * | string | "record" to log a call, "get" to retrieve recent records |
| metadata | object | Optional key-value metadata (request ID, user, feature flag, etc.) |
| inputTokens | number | Number of input/prompt tokens consumed |
| outputTokens | number | Number of output/completion tokens generated |
None yet. Changes appear after a server's second daily check.
Squares are this server's values; dots are other servers sharing them. A shared address or publisher is a lead, not proof of a common operator.
Inferred from the host name and headers: what a server runs on, not who runs it.
{
"name": "cost_tracker",
"description": "Record and retrieve AI API call costs by team. Persists to Cloudflare KV — survives cold starts and scale-out.",
"inputSchema": {
"type": "object",
"required": [
"action"
],
"properties": {
"team": {
"type": "string",
"description": "Team or project identifier (default: \"default\")"
},
"model": {
"type": "string",
"description": "Model ID (e.g., claude-3-5-sonnet-20241022, gpt-4o, gemini-2.0-flash)"
},
"action": {
"enum": [
"record",
"get"
],
"type": "string",
"description": "\"record\" to log a call, \"get\" to retrieve recent records"
},
"metadata": {
"type": "object",
"description": "Optional key-value metadata (request ID, user, feature flag, etc.)"
},
"inputTokens": {
"type": "number",
"description": "Number of input/prompt tokens consumed"
},
"outputTokens": {
"type": "number",
"description": "Number of output/completion tokens generated"
}
}
}
}Calculate cost from token counts for any supported AI model. Stateless — no KV required.
| Parameter | Type | Description |
|---|---|---|
| model * | string | Model ID to price |
| inputTokens * | number | Input token count |
| outputTokens * | number | Output token count |
{
"name": "token_calculator",
"description": "Calculate cost from token counts for any supported AI model. Stateless — no KV required.",
"inputSchema": {
"type": "object",
"required": [
"model",
"inputTokens",
"outputTokens"
],
"properties": {
"model": {
"type": "string",
"description": "Model ID to price"
},
"inputTokens": {
"type": "number",
"description": "Input token count"
},
"outputTokens": {
"type": "number",
"description": "Output token count"
}
}
}
}Set and check budget limits for teams. Raises a flag when a configurable spending threshold is reached.
| Parameter | Type | Description |
|---|---|---|
| team | string | Team identifier |
| action * | string | "set" to configure a budget, "check" to get current status |
| threshold | number | Alert threshold percentage 0–100 (default: 80) |
| budgetLimit | number | USD budget cap |
{
"name": "budget_alert",
"description": "Set and check budget limits for teams. Raises a flag when a configurable spending threshold is reached.",
"inputSchema": {
"type": "object",
"required": [
"action"
],
"properties": {
"team": {
"type": "string",
"description": "Team identifier"
},
"action": {
"enum": [
"set",
"check"
],
"type": "string",
"description": "\"set\" to configure a budget, \"check\" to get current status"
},
"threshold": {
"type": "number",
"description": "Alert threshold percentage 0–100 (default: 80)"
},
"budgetLimit": {
"type": "number",
"description": "USD budget cap"
}
}
}
}Analyze costs broken down by model for a given team over a configurable time window.
| Parameter | Type | Description |
|---|---|---|
| days | number | Lookback window in days (default: 30) |
| team | string | Team identifier |
{
"name": "model_breakdown",
"description": "Analyze costs broken down by model for a given team over a configurable time window.",
"inputSchema": {
"type": "object",
"properties": {
"days": {
"type": "number",
"description": "Lookback window in days (default: 30)"
},
"team": {
"type": "string",
"description": "Team identifier"
}
}
}
}Forecast future AI spend based on historical usage patterns using daily-average linear projection.
| Parameter | Type | Description |
|---|---|---|
| team | string | Team identifier |
| forecastDays | number | Days to project ahead (default: 7) |
| historicalDays | number | Days of history to base the forecast on (default: 30) |
{
"name": "cost_forecast",
"description": "Forecast future AI spend based on historical usage patterns using daily-average linear projection.",
"inputSchema": {
"type": "object",
"properties": {
"team": {
"type": "string",
"description": "Team identifier"
},
"forecastDays": {
"type": "number",
"description": "Days to project ahead (default: 7)"
},
"historicalDays": {
"type": "number",
"description": "Days of history to base the forecast on (default: 30)"
}
}
}
}Names, descriptions and schemas were written by the server and are shown as data.
Shared addresses on big platforms (Cloudflare, Vercel and the like) put unrelated servers together; those are marked shared_infrastructure. A match is a pivot, not a link between operators.