What is llm-cost-watch?
llm-cost-watch is a self-hosted Model Context Protocol server for tracking language-model spending and latency. It records calls from Python code and exposes analysis tools that can be queried from Claude Desktop, Claude Code, or Antigravity. It is aimed at teams building LLM-powered features who want to investigate which workflows drive costs, where calls slow down, and whether smaller models could handle selected tasks.
llm-cost-watch Features:
Call Logging: A Python watch_llm decorator records calls with a feature name, task type, and model, giving the server dimensions for workflow-level analysis.
Cost by Feature: The cost_by_feature tool surfaces which features or workflows account for the largest share of spend over a selected timeframe, defaulting to seven days.
Latency Outliers: slow_calls reports high-latency calls and p50, p95, and p99 latency figures, with configurable result limits and a minimum-latency threshold.
Bottleneck Analysis: For slow calls, the server can identify issues such as oversized prompt payloads, recursive tool loops, and reasoning stalls.
Routing Suggestions: routing_suggestions examines short structured prompts on costly models and estimates dollar savings from moving them to Claude 3.5 Haiku or GPT-4o-mini.
MCP Access: The server makes its cost and latency analysis available to Claude Desktop, Claude Code, and Antigravity through MCP.
llm-cost-watch Benefits:
Fewer Dashboard Switches: Investigate spend changes by asking an assistant in the same environment where you work, rather than switching among web dashboards.
Focused Cost Reviews: See which workflow is responsible for a large share of spend, helping teams focus cost reviews on the areas with the biggest contribution.
Targeted Debugging: Use latency percentiles and bottleneck clues to focus debugging on slow calls instead of treating every request as equally problematic.
Informed Model Choices: Compare alternatives with estimated dollar savings before deciding whether a task can move off a more expensive model.
Code-Level Analysis: Keep analysis close to the application with Python call logging and a self-hosted server, using data recorded from your own workflows.
Use Cases:
Weekly Spend Review: Ask which feature or workflow contributed most to a rise in LLM spending over the past week, then use the result to guide a cost review.
Slow Call Investigation: Find latency outliers in a production workflow and examine whether prompt size, repeated tool calls, or reasoning stalls may be contributing.
Classifier Model Review: Check whether a short classification task running on a costly model could use Claude 3.5 Haiku or GPT-4o-mini instead.
RAG Pipeline Analysis: Review the spend and latency associated with a knowledge-base RAG workflow to identify whether it is a major cost or performance concern.
Assistant-Based Checks: Use Claude Desktop, Claude Code, or Antigravity to query cost and latency information while investigating LLM-powered application features.

