Ai Cost Optimizer

io.github.lazymac2xPublished by GitHub account lazymac2xv1.0.0Updated Oct 25, 2026

Cloudflare Workers MCP server: ai-cost-optimizer

VerifiedStreamable HTTPWeb executableFinanceData & Analytics

Overview

AI-generated overview

A remote MCP server for tracking, calculating, budgeting and forecasting AI API spending by team and model.

What you can do
Record and retrieve AI API call costs by team, persisted in Cloudflare KV across cold starts and scale-out instances. Calculate cost from token counts for supported AI models without storing state. Set and check team budget limits, with a flag raised when a configurable spending threshold is reached. Analyze costs broken down by model for a team over a configurable time window. Forecast future AI spend from historical usage using a daily-average linear projection.
When to use it
Useful when an assistant should help track or report AI API spending across teams, estimate the cost of token counts, set budget thresholds, or project future spend from past usage.
Requirements
A remote MCP endpoint at the provider's hosted address, reached over streamable HTTP; no package, environment variables or headers are declared. Network access to the endpoint is needed.
Before you install
Cost records and budget limits are written to the provider's Cloudflare KV storage, so spending data is sent to and kept by a third party. Budget alerts only raise a flag; they do not stop spending. No authentication is declared, so anyone with the endpoint may be able to read or change team cost and budget data.

Installation

In SourceWeft

  1. Open Ai Cost Optimizer in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.lazymac2x%2Fai-cost-optimizer/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "ai-cost-optimizer": {
      "type": "http",
      "url": "https://api.lazy-mac.com/ai-cost-optimizer/mcp"
    }
  }
}

README

ai-cost-optimizer-api

Cloudflare Workers MCP server: ai-cost-optimizer. REST + MCP (JSON-RPC 2.0). Live: api.lazy-mac.com/ai-cost-optimizer

Source: README.md at commit 234f023

Tools

5

cost_tracker

Record and retrieve AI API call costs by team. Persists to Cloudflare KV — survives cold starts and scale-out.

ParametersteammodelactionrequiredmetadatainputTokensoutputTokens

token_calculator

Calculate cost from token counts for any supported AI model. Stateless — no KV required.

ParametersmodelrequiredinputTokensrequiredoutputTokensrequired

budget_alert

Set and check budget limits for teams. Raises a flag when a configurable spending threshold is reached.

ParametersteamactionrequiredthresholdbudgetLimit

model_breakdown

Analyze costs broken down by model for a given team over a configurable time window.

Parametersdaysteam

cost_forecast

Forecast future AI spend based on historical usage patterns using daily-average linear projection.

ParametersteamforecastDayshistoricalDays

Version history

1
  1. v1.0.0LatestSep 16, 2026

Score

90% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

    Declare a license in the repository or the registry entry.