Skip to main content
ClaudeWave
tylerscomic-lab avatar
tylerscomic-lab

claude-cost-audit-mcp

Ver en GitHub

Exact Claude API cost + prompt-cache economics calculator MCP server, plus a tiktoken-misuse scanner

MCP ServersRegistry oficial0 estrellas0 forksJavaScriptMITActualizado today
Install in Claude Code / Claude Desktop
Method: Manual
Claude Code CLI
git clone https://github.com/tylerscomic-lab/claude-cost-audit-mcp
claude_desktop_config.json (Claude Desktop)
{
  "mcpServers": {
    "claude-cost-audit-mcp": {
      "command": "node",
      "args": ["/path/to/claude-cost-audit-mcp/dist/index.js"]
    }
  }
}
1. Run the command above in your terminal (Claude Code), or paste the JSON config into claude_desktop_config.json (Claude Desktop).
2. Replace any <placeholder> values with your API keys or paths.
3. Restart Claude. The MCP server and its tools appear automatically.
💡 Clone https://github.com/tylerscomic-lab/claude-cost-audit-mcp and follow its README for install instructions.
Casos de uso

Resumen de MCP Servers

# claude-cost-audit-mcp

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Live on MCPize](https://img.shields.io/badge/Live%20on-MCPize-6d28d9)](https://mcpize.com/mcp/claude-cost-audit-mcp)

An MCP server for exact Claude API cost calculation — correct prompt-cache economics (write 1.25x at 5-minute
TTL / 2x at 1-hour TTL, read 0.1x), cache break-even analysis, and a scanner for the single most common
Claude-cost mistake: estimating tokens with OpenAI's `tiktoken`.

## The mistake this catches

Per Anthropic's own documentation: *"Do not use tiktoken. It's OpenAI's tokenizer. It undercounts Claude tokens by
~15-20% on typical text, and by much more on code or non-English input."* Any cost estimate or context-budget
check built on `tiktoken` for a Claude model is silently wrong — this scans source for that exact pattern
(foreign tokenizer + Claude/Anthropic usage in the same file) and points to the fix
(`messages.count_tokens`).

## Cache economics people get wrong

Caching doesn't pay off starting from the second request the way most people assume. The real break-even is
**2 reuses at 5-minute TTL, but 3 reuses at 1-hour TTL** — because the 1-hour write costs more (2x vs 1.25x).
`check_cache_breakeven` computes this from Anthropic's real multipliers instead of a guessed rule of thumb, and
flags prefixes below the model's own minimum-cacheable-token threshold (which is **not** monotonic across model
generations — 512 tokens on the newest models, 4096 on some older ones).

## Tools

### `calculate_message_cost`
Exact $ cost from token counts, using Anthropic's real current per-model pricing (including Claude Sonnet 5's
time-limited introductory rate, resolved automatically from the date you pass).

### `check_cache_breakeven`
Given expected request volume reusing the same prefix, tells you whether caching saves money and at which TTL.

### `audit_tokenizer_usage`
Scans source for `tiktoken`/`gpt-tokenizer`/etc. alongside Claude API usage.

## Use it

**Hosted (recommended):** [MCPize](https://mcpize.com/mcp/claude-cost-audit-mcp) — free tier, $7/mo Pro.

**Self-host:**
```bash
npm install
node server.js
```

## Part of a small suite

[mcp-schema-audit-mcp](https://github.com/tylerscomic-lab/mcp-schema-audit-mcp),
[cron-schedule-audit-mcp](https://github.com/tylerscomic-lab/cron-schedule-audit-mcp),
[regex-safety-audit-mcp](https://github.com/tylerscomic-lab/regex-safety-audit-mcp).

## License

MIT
ai-agentsanthropicclaudellm-costmcpmcp-servermodel-context-protocol

Lo que la gente pregunta sobre claude-cost-audit-mcp

¿Qué es tylerscomic-lab/claude-cost-audit-mcp?

+

tylerscomic-lab/claude-cost-audit-mcp es mcp servers para el ecosistema de Claude AI. Exact Claude API cost + prompt-cache economics calculator MCP server, plus a tiktoken-misuse scanner Tiene 0 estrellas en GitHub y se actualizó por última vez today.

¿Cómo se instala claude-cost-audit-mcp?

+

Puedes instalar claude-cost-audit-mcp clonando el repositorio (https://github.com/tylerscomic-lab/claude-cost-audit-mcp) o siguiendo las instrucciones del README en GitHub. ClaudeWave también te ofrece bloques de instalación rápida en esta misma página.

¿Es seguro usar tylerscomic-lab/claude-cost-audit-mcp?

+

tylerscomic-lab/claude-cost-audit-mcp aún no ha sido auditado por nuestro agente de seguridad. Revisa el repositorio original en GitHub antes de usarlo en producción.

¿Quién mantiene tylerscomic-lab/claude-cost-audit-mcp?

+

tylerscomic-lab/claude-cost-audit-mcp es mantenido por tylerscomic-lab. La última actividad registrada en GitHub es de today, con 0 issues abiertos.

¿Hay alternativas a claude-cost-audit-mcp?

+

Sí. En ClaudeWave puedes explorar mcp servers similares en /categories/mcp, ordenados por popularidad o actividad reciente.

Despliega claude-cost-audit-mcp en tu cloud

Lleva este repo a producción en minutos. Cada plataforma genera su propio entorno con variables de entorno editables.

¿Mantienes este repo? Añade un badge a tu README

Pega el badge en tu README de GitHub para mostrar que está auditado por ClaudeWave. Cada badge enlaza de vuelta a esta página y muestra el Trust Score actual.

Featured on ClaudeWave: tylerscomic-lab/claude-cost-audit-mcp
[![Featured on ClaudeWave](https://claudewave.com/api/badge/tylerscomic-lab-claude-cost-audit-mcp)](https://claudewave.com/repo/tylerscomic-lab-claude-cost-audit-mcp)
<a href="https://claudewave.com/repo/tylerscomic-lab-claude-cost-audit-mcp"><img src="https://claudewave.com/api/badge/tylerscomic-lab-claude-cost-audit-mcp" alt="Featured on ClaudeWave: tylerscomic-lab/claude-cost-audit-mcp" width="320" height="64" /></a>

Más MCP Servers

Alternativas a claude-cost-audit-mcp