A local-first MCP server that answers, from real data on your machine: How many tokens have I used, from which client, model and session — and what did it cost?
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add ai-usage -- npx -y ai-usage-mcp~/.codex/config.toml
[mcp_servers.ai-usage]
command = "npx"
args = ["-y", "ai-usage-mcp"]
# codex mcp add ai-usage -- npx -y ai-usage-mcp~/.cursor/mcp.json
{
"mcpServers": {
"ai-usage": {
"command": "npx",
"args": [
"-y",
"ai-usage-mcp"
]
}
}
}.vscode/mcp.json
{
"servers": {
"ai-usage": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"ai-usage-mcp"
]
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"ai-usage": {
"command": "npx",
"args": [
"-y",
"ai-usage-mcp"
]
}
}
}claude_desktop_config.json
{
"mcpServers": {
"ai-usage": {
"command": "npx",
"args": [
"-y",
"ai-usage-mcp"
]
}
}
}.trae/mcp.json
{
"mcpServers": {
"ai-usage": {
"command": "npx",
"args": [
"-y",
"ai-usage-mcp"
]
}
}
}