# Token Diet

> Token Diet is an MCP server. Count tokens exactly for any text and see if it fits a 128K, 200K or 1M context window. It runs as a hosted remote server, so there is nothing to install locally.

- **Kind:** MCP server
- **Website:** https://tokendiet.clawhard.com
- **MCP Registry name:** com.clawhard/tokendiet
- **Listing updated:** 2026-11-13

## About

Count tokens exactly for any text and see if it fits a 128K, 200K or 1M context window.

## Install

### Claude Code (Terminal)

```sh
claude mcp add --transport http tokendiet https://tokendiet.clawhard.com/mcp
```

### Claude Desktop (Settings → Connectors → Add custom connector)

```sh
https://tokendiet.clawhard.com/mcp
```

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

```json
{
  "mcpServers": {
    "tokendiet": {
      "url": "https://tokendiet.clawhard.com/mcp"
    }
  }
}
```

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

```json
{
  "servers": {
    "tokendiet": {
      "type": "http",
      "url": "https://tokendiet.clawhard.com/mcp"
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "tokendiet": {
      "serverUrl": "https://tokendiet.clawhard.com/mcp"
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "tokendiet": {
      "type": "http",
      "url": "https://tokendiet.clawhard.com/mcp"
    }
  }
}
```

## FAQ

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

Run this command in your terminal: claude mcp add --transport http tokendiet https://tokendiet.clawhard.com/mcp

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