MCP-Server

ai-cost-optimizer

io.github.lazymac2x/ai-cost-optimizer
Business & Betrieb Daten & Analytik Öffentlich und erreichbar MCP 2026-07-28

Was dieses MCP kann

Tracks AI API costs, calculates token charges, analyzes model spending, forecasts costs, and monitors team budget thresholds.

budget_alert
Set and check budget limits for teams. Raises a flag when a configurable spending threshold is reached.
Eingabeschema
{'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'}}}
cost_forecast
Forecast future AI spend based on historical usage patterns using daily-average linear projection.
Eingabeschema
{'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)'}}}
cost_tracker
Record and retrieve AI API call costs by team. Persists to Cloudflare KV — survives cold starts and scale-out.
Eingabeschema
{'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'}}}
model_breakdown
Analyze costs broken down by model for a given team over a configurable time window.
Eingabeschema
{'type': 'object', 'properties': {'days': {'type': 'number', 'description': 'Lookback window in days (default: 30)'}, 'team': {'type': 'string', 'description': 'Team identifier'}}}
token_calculator
Calculate cost from token counts for any supported AI model. Stateless — no KV required.
Eingabeschema
{'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'}}}
Hinzugefügt
cost_forecast
17. September 2026 12:43
Hinzugefügt
model_breakdown
17. September 2026 12:43
Hinzugefügt
budget_alert
17. September 2026 12:43
Hinzugefügt
token_calculator
17. September 2026 12:43
Hinzugefügt
cost_tracker
17. September 2026 12:43