Tracks token usage and API cost for OpenAI and Claude calls in real time, per session.
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add llm-token-tracker -- npx llm-token-tracker~/.codex/config.toml
[mcp_servers.llm-token-tracker]
command = "npx"
args = ["llm-token-tracker"]
# codex mcp add llm-token-tracker -- npx llm-token-tracker~/.cursor/mcp.json
{
"mcpServers": {
"llm-token-tracker": {
"command": "npx",
"args": [
"llm-token-tracker"
]
}
}
}.vscode/mcp.json
{
"servers": {
"llm-token-tracker": {
"type": "stdio",
"command": "npx",
"args": [
"llm-token-tracker"
]
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"llm-token-tracker": {
"command": "npx",
"args": [
"llm-token-tracker"
]
}
}
}claude_desktop_config.json
{
"mcpServers": {
"llm-token-tracker": {
"command": "npx",
"args": [
"llm-token-tracker"
]
}
}
}.trae/mcp.json
{
"mcpServers": {
"llm-token-tracker": {
"command": "npx",
"args": [
"llm-token-tracker"
]
}
}
}