# wn01011/llm-token-tracker [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/wn01011/llm-token-tracker  
**GitHub Stars:** 5  
**npm Downloads (last month):** 925  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/wn01011-llm-token-tracker

## Description
Token usage tracker for OpenAI and Claude APIs with MCP support, real-time session tracking, and accurate pricing for 2025 models

## Tools
Capabilities this server exposes over MCP:

- **track_usage** — Track token usage for an AI API call
- **get_current_session** — Get current session usage with intuitive format (remaining, used, input/output tokens, cost)
- **get_usage** — Get usage summary
- **compare_costs** — Compare costs between models
- **clear_usage** — Clear usage data
- **get_exchange_rate** — Get current USD to KRW exchange rate with cache info

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "llm-token-tracker": {
    "command": "npx",
    "args": ["llm-token-tracker"]
  }
}
```

## Documentation

## What wn01011/llm-token-tracker MCP server does

The wn01011/llm-token-tracker MCP server exposes token accounting functions for applications using OpenAI, Anthropic, or Gemini models. It accepts input and output token counts, associates them with a provider, model, user, and session, and calculates an estimated cost using the pricing data included by the project. Results can be reported in USD or KRW.

The server is useful for monitoring an active conversation as well as collecting historical usage. The current-session view reports used and remaining tokens, input/output totals, cost, model-level breakdowns, and a progress indicator. A default session user ID of `current-session` and a 190,000-token budget are described for this view.

## How it works

MCP clients call tools rather than handling the tracker’s JavaScript API directly. `track_usage` records one API call with provider, model, input-token, output-token, and user information. `get_usage` returns a summary for a selected user or across users, while `get_current_session` presents the active session in a compact format. `compare_costs` evaluates costs across models, and `clear_usage` removes a user’s usage data.

The tracker can also be used as an npm library. Manual tracking starts with a tracking ID and ends when the application supplies the completed usage details. Alternatively, the library can wrap an OpenAI or Anthropic client so usage is recorded automatically and attached to the response. The project documents Gemini support and pricing, including automatic Gemini client wrapping in its release notes.

The wn01011/llm-token-tracker MCP server saves session data to `~/.llm-token-tracker/sessions.json`, allowing records to survive process restarts. Exchange-rate data for USD-to-KRW conversion is cached for 24 hours, with fallback behavior described by the project.

## Setup and configuration

Install the npm package with `npm install llm-token-tracker` when using the library. For Claude Desktop, add an MCP server entry that runs the package with `npx`, then restart or reload the client as appropriate. No environment variable is documented as required for the MCP process itself.

Library configuration accepts a `currency` value of `USD` or `KRW`; USD is the default. An optional `webhookUrl` can be supplied for usage notifications. Applications wrapping real API clients still need to configure those clients’ own credentials, such as an OpenAI API key, but those credentials are not listed as tracker server configuration.

## Tools and capabilities

- `get_current_session`: Reports current usage, remaining budget, token direction breakdown, cost, and a progress bar.
- `track_usage`: Records token usage for a provider, model, and user.
- `get_usage`: Shows usage for one user or all users.
- `compare_costs`: Compares estimated costs between models.
- `clear_usage`: Deletes usage data for a user.
- `get_exchange_rate`: Returns the current USD-to-KRW rate and cache information.

Pricing tables cover documented OpenAI, Anthropic, and Google Gemini models, including input and output rates. The listed prices are per 1,000 tokens, with separate handling noted for image and audio models where applicable.

## Limitations and notes

Cost results depend on the project’s embedded pricing table and the token counts supplied by the API client or caller. The material describes pricing as updated for 2025, so users should verify rates when provider pricing changes. The MCP documentation explicitly shows Claude Desktop configuration; compatibility with other MCP clients is not established by the provided material. Exchange-rate functionality depends on the documented external rate service and its cache or fallback behavior.

_Full upstream README: https://allmcps.com/mcp/wn01011-llm-token-tracker/readme_

