# Token Lens

> Token Lens is an MCP server. Count and cut tokens in prompts, chats and agents for any model. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **MCP Registry name:** io.github.duttkunal101-lab/token-lens
- **Listing updated:** 2026-11-13

## About

Count and cut tokens in prompts, chats and agents for any model. Runs locally, collects no data.

## Install

### Claude Code (Terminal)

```sh
claude mcp add token-lens -- npx -y @kunal_dutt/token-lens
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "token-lens": {
      "command": "npx",
      "args": [
        "-y",
        "@kunal_dutt/token-lens"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "token-lens": {
      "command": "npx",
      "args": [
        "-y",
        "@kunal_dutt/token-lens"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "token-lens": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@kunal_dutt/token-lens"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "token-lens": {
      "command": "npx",
      "args": [
        "-y",
        "@kunal_dutt/token-lens"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "token-lens": {
      "command": "npx",
      "args": [
        "-y",
        "@kunal_dutt/token-lens"
      ]
    }
  }
}
```

## FAQ

### How do I add Token Lens to Claude Code?

Run this command in your terminal: claude mcp add token-lens -- npx -y @kunal_dutt/token-lens

## Where this comes from

- Description: from the official MCP Registry entry.
- Install steps: from the official MCP Registry entry.

---
Source: https://ai-powered.com/mcp/token-lens
