# tokenmizer

Tokenmizer records session decisions, files, errors, and goals in a knowledge graph, then uses that record to restore context when a model’s window fills up.

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

## What it does

Tokenmizer acts as an OpenAI-compatible proxy. It turns session information into a knowledge graph and draws on that graph when the model runs out of context. The stored links preserve why a decision was made, including reasons for rejecting an earlier option.

The server also provides session views, a graph, and a resume block for continuing work. In Claude Code, the install command starts `uvx tokenmizer` and passes `TOKENMIZER_API_KEY`; the alternative command also sets `TOKENMIZER_URL`. You’ll need an API key before connecting, or the server cannot access the API.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `TOKENMIZER_URL`, `TOKENMIZER_API_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env TOKENMIZER_URL=<TOKENMIZER_URL> --env TOKENMIZER_API_KEY=<TOKENMIZER_API_KEY> --transport stdio tokenmizer -- uvx tokenmizer
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from tokenmizer <command>

### Codex

**Platform CLI**
```bash
codex mcp add tokenmizer --env TOKENMIZER_URL=<TOKENMIZER_URL> --env TOKENMIZER_API_KEY=<TOKENMIZER_API_KEY> -- uvx tokenmizer
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from tokenmizer <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "tokenmizer": {
            "command": "uvx",
            "args": [
                "tokenmizer"
            ],
            "env": {
                "TOKENMIZER_URL": "<TOKENMIZER_URL>",
                "TOKENMIZER_API_KEY": "<TOKENMIZER_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from tokenmizer <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "tokenmizer": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "tokenmizer"
            ],
            "env": {
                "TOKENMIZER_URL": "<TOKENMIZER_URL>",
                "TOKENMIZER_API_KEY": "<TOKENMIZER_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from tokenmizer <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e TOKENMIZER_URL=<TOKENMIZER_URL> -e TOKENMIZER_API_KEY=<TOKENMIZER_API_KEY> tokenmizer uvx tokenmizer
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from tokenmizer <command>

## When to use it
- keep decisions and their rationale from a long session
- restore context after the model window fills
- avoid revisiting an option that was rejected earlier
- inspect links between facts in a session graph

## Example prompts
- Continue the project using the context from my earlier session.
- Show why we chose PostgreSQL over MongoDB.
- Prepare a resume block from the current session.

## 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
