# Agent Cost Analyzer

> Agent Cost Analyzer is an open-source MCP server for developer tools. Read-only analysis of AI coding agent costs, caching and sessions from local logs. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Web, Self-hosted, macOS, Windows, Linux
- **Repository:** https://github.com/raulkivi/agent-cost-analyzer/tree/HEAD/packages/cli
- **MCP Registry name:** io.github.raulkivi/agent-cost-analyzer
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-20

## About

The README says this package reads the session logs that GitHub Copilot Chat, Claude Code and the pi coding agent already write on your machine, then breaks each session down turn by turn to show where tokens and money go. It can run as a local web app opened in your browser, or as a read-only MCP server over stdio so an MCP client can answer spending questions in chat.

Nothing leaves your machine: the README states the app sends no data anywhere and makes no network calls of its own, apart from npm itself. A Learn mode with sample sessions is included for people who do not yet have logs to analyse.

It suits developers and team leads who use AI coding assistants and want to understand token usage, caching and session cost before changing how they work. The package is MIT licensed and has no dependencies, according to the README.

## Features

- **Turn-by-turn session breakdown:** Shows each session's turns so token and cost use can be traced step by step.
- **Local log reading:** Reads existing session logs from Copilot Chat, Claude Code and the pi agent on your machine.
- **Read-only MCP server:** Exposes the same analysis over stdio so an MCP client can answer spending questions.
- **Browser app on localhost:** Starts a web app bound to 127.0.0.1 and opens it in your browser.
- **Learn mode samples:** Includes sample sessions so the tool is usable before you have any data.
- **No network calls:** The README says the app sends no data and makes no network call of its own.

## Good for

- Finding which coding sessions drove the most token spend in a week
- Checking how much prompt caching is saving across agent sessions
- Comparing cost patterns between Copilot Chat, Claude Code and pi
- Asking an MCP-enabled chat client to summarise recent agent spending
- Exploring the tool with sample sessions before connecting real logs

## Install

### Claude Code (Terminal)

```sh
claude mcp add agent-cost-analyzer -- npx -y agent-cost-analyzer
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "agent-cost-analyzer": {
      "command": "npx",
      "args": [
        "-y",
        "agent-cost-analyzer"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "agent-cost-analyzer": {
      "command": "npx",
      "args": [
        "-y",
        "agent-cost-analyzer"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "agent-cost-analyzer": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "agent-cost-analyzer"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "agent-cost-analyzer": {
      "command": "npx",
      "args": [
        "-y",
        "agent-cost-analyzer"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "agent-cost-analyzer": {
      "command": "npx",
      "args": [
        "-y",
        "agent-cost-analyzer"
      ]
    }
  }
}
```

## FAQ

### Which agent logs does Agent Cost Analyzer read?

The README says it reads session logs from GitHub Copilot Chat, Claude Code and the pi coding agent.

### Does Agent Cost Analyzer send my data anywhere?

According to the README, the app sends no data anywhere and makes no network call of its own; npx itself contacts the npm registry.

### What Node.js version is required?

The README says Node.js 22.18 or newer is needed.

### Can Agent Cost Analyzer modify my files?

The MCP server is described as read-only, and the only place the app writes is its own settings folder.

### How do I add Agent Cost Analyzer to Claude Code?

Run this command in your terminal: claude mcp add agent-cost-analyzer -- npx -y agent-cost-analyzer

### What are the best alternatives to Agent Cost Analyzer?

The closest alternatives to Agent Cost Analyzer are TokenTrace, mcpwatch, Actvt, Widal.Code and AGASTHY.

## Where this comes from

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

## Alternatives

- [TokenTrace](https://ai-powered.com/mcp/tokentrace): TokenTrace is an open-source MCP server for developer tools.
- [mcpwatch](https://ai-powered.com/mcp/mcpwatch-2): mcpwatch is an open-source MCP server for developer tools.
- [Actvt](https://ai-powered.com/mcp/actvt): Actvt is a freemium MCP server for developer tools.
- [Widal.Code](https://ai-powered.com/mcp/widal-code): Widal.Code is a freemium MCP server for developer tools.
- [AGASTHY](https://ai-powered.com/mcp/agasthy): AGASTHY is an open-source MCP server for developer tools.
- [Okaneland MCP](https://ai-powered.com/mcp/okaneland-mcp): Okaneland MCP is an open-source MCP server for developer tools.
- [MCP Cost Tracker Router](https://ai-powered.com/mcp/mcp-cost-tracker-router): MCP Cost Tracker Router is an MCP server for developer tools.
- [AI Usage](https://ai-powered.com/mcp/ai-usage): AI Usage is an MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/agent-cost-analyzer
