# Tokmeter — AI Agent Usage & Cost

> Tokmeter — AI Agent Usage & Cost is a free MCP server for developer tools. Track token use and cost across 24 AI coding agents from local session files. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Free
- **Platforms:** CLI, macOS, Web, Self-hosted
- **Repository:** https://github.com/sriinnu/tokmeter
- **MCP Registry name:** io.github.sriinnu/tokmeter
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools), [analytics and data](https://ai-powered.com/categories/analytics-and-data)
- **Listing updated:** 2026-11-23

## About

Tokmeter reads the session logs that coding agents already write to disk and totals tokens and cost by project, model, provider and day. It covers 24 agents and editors including Claude Code, Codex, Gemini CLI, Cursor and Cline, and an unsupported agent can register a path.

Nothing leaves your machine: no API keys, telemetry or account. Pricing comes from public catalogues, and an append-only daily ledger keeps history after agents rotate their logs. Surfaces include a CLI, terminal UI, web dashboard, Claude Code statusline and macOS menubar app.

The MCP server has 22 read-only tools for usage queries, comparisons, forecasts and export, with cleanup previews only. It needs Node.js 22 or later.

## Features

- **Cross-agent ledger:** One total across 24 agents.
- **Local only:** No account or telemetry.
- **Daily history:** Ledger survives log rotation.
- **Menubar app:** Shows today's cost on macOS.
- **MCP queries:** 22 read-only tools.
- **Statusline:** Claude Code statusline.

## Good for

- See which project burns the most tokens
- Compare models by cost
- Forecast spending
- Let an agent check its own spend

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add tokmeter -- npx -y @sriinnu/tokmeter-mcp
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "tokmeter": {
      "command": "npx",
      "args": [
        "-y",
        "@sriinnu/tokmeter-mcp"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "tokmeter": {
      "command": "npx",
      "args": [
        "-y",
        "@sriinnu/tokmeter-mcp"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "tokmeter": {
      "command": "npx",
      "args": [
        "-y",
        "@sriinnu/tokmeter-mcp"
      ]
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "tokmeter": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@sriinnu/tokmeter-mcp"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add tokmeter -- npx -y @sriinnu/tokmeter-mcp
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.tokmeter]
command = "npx"
args = ["-y", "@sriinnu/tokmeter-mcp"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "tokmeter": {
      "command": "npx",
      "args": [
        "-y",
        "@sriinnu/tokmeter-mcp"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user tokmeter npx -- -y @sriinnu/tokmeter-mcp

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "tokmeter": {
      "command": "npx",
      "args": [
        "-y",
        "@sriinnu/tokmeter-mcp"
      ]
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "tokmeter": {
      "command": "npx",
      "args": [
        "-y",
        "@sriinnu/tokmeter-mcp"
      ]
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "tokmeter": {
      "command": "npx",
      "args": [
        "-y",
        "@sriinnu/tokmeter-mcp"
      ]
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "tokmeter": {
      "command": "npx",
      "args": [
        "-y",
        "@sriinnu/tokmeter-mcp"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "tokmeter": {
      "command": "npx",
      "args": [
        "-y",
        "@sriinnu/tokmeter-mcp"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "tokmeter": {
      "command": "npx",
      "args": [
        "-y",
        "@sriinnu/tokmeter-mcp"
      ]
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "tokmeter": {
      "command": "npx",
      "args": [
        "-y",
        "@sriinnu/tokmeter-mcp"
      ]
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "tokmeter": {
      "command": "npx",
      "args": [
        "-y",
        "@sriinnu/tokmeter-mcp"
      ]
    }
  }
}
```

## FAQ

### Does data leave my machine?

No.

### Are the MCP tools read-only?

Yes, all 22.

### What do I need?

Node.js 22 or newer.

### Is there a menubar app?

Yes, for macOS 14 on Apple silicon.

### Is Tokmeter — AI Agent Usage & Cost free?

Yes. Tokmeter — AI Agent Usage & Cost is free to use.

### How do I add Tokmeter — AI Agent Usage & Cost to Claude Code?

Run this command in your terminal: claude mcp add tokmeter -- npx -y @sriinnu/tokmeter-mcp

### What are the best alternatives to Tokmeter — AI Agent Usage & Cost?

The closest alternatives to Tokmeter — AI Agent Usage & Cost are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/tokmeter-ai-agent-usage-and-cost
