# agentic-ledger

A proxy that sits between your agent and the LLM, logs every call, prices it and flags runs that spin in circles. Useful when the bill makes no sense.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 7
- Author: ShekharBhardwaj
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ShekharBhardwaj/AgenticLedger
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/agentic-ledger

## What it does

Agentic Ledger is a transparent proxy in front of your LLM provider. It catches each request and response, tags it with an `action_id`, writes it down, and passes the upstream answer back untouched. Your agent has no idea it is there.

Records land in SQLite or Postgres, and a live dashboard plus an API sit on top. Start it in the background with `agenticledger start` — you get the dashboard URL and your terminal back. `agenticledger status` reports health, `agenticledger logs` shows activity, `agenticledger stop` shuts it down. A Docker route exists too, and it needs no Python on the host.

The proxy listens on `http://localhost:8000`. For Claude one command writes the agent config, with a backup and a merge. Anywhere else you change two things: point `base_url` at the proxy and send a session ID header so calls group into a single run. Keys, model and messages stay as they are. Postgres and OpenTelemetry come as separate extras, and the Docker image carries SQLite only — for Postgres install the package with `pip`.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add agentic-ledger -- uvx agentic-ledger
```
uvx runs the command named after the package; if the README names another one, use uvx --from agentic-ledger <command>

### Codex

**Platform CLI**
```bash
codex mcp add agentic-ledger -- uvx agentic-ledger
```
uvx runs the command named after the package; if the README names another one, use uvx --from agentic-ledger <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "agentic-ledger": {
            "command": "uvx",
            "args": [
                "agentic-ledger"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from agentic-ledger <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "agentic-ledger": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "agentic-ledger"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from agentic-ledger <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add agentic-ledger uvx agentic-ledger
```
uvx runs the command named after the package; if the README names another one, use uvx --from agentic-ledger <command>

## When to use it
- work out what a run actually cost in tokens and money
- reconstruct the steps an agent took and their order
- catch a run that loops and burns budget
- see calls to different providers in one place
- check your own numbers against the provider invoice

## Example prompts
- Start agentic-ledger and give me the dashboard URL
- What did run `run-1` cost, and which steps were in it?
- Any stuck loops in the recent runs?

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
