# Token Enhancer

A local proxy that trims web pages to plain text before your agent reads them. A Yahoo Finance fetch drops from 704,760 tokens to 2,625.

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

## What it does

The server sits between your agent and the web. It downloads a page, throws out menus, scripts and ads, keeps the result in a cache, and hands back the text. The author's numbers: a Wikipedia article shrinks by 87.4%, Hacker News by 90.1%, a GitHub repository page by 95.9%. Three tools come with it: `fetch_clean` for one address, `fetch_clean_batch` for several, and an opt-in `refine_prompt` that tidies the wording of a prompt while showing you both versions.

The only prerequisite is Python 3.10+. No API key, no GPU, the server does the parsing itself. SSL checks can fail on Linux hosts; there you add `REQUESTS_CA_BUNDLE` pointing at your system certificate bundle in the MCP client config. On macOS and Windows leave that variable out, or the connection breaks.

You can also run it as a standalone proxy with `python3 proxy.py`, call endpoints such as `http://localhost:8080/fetch`, or wrap it as a LangChain tool. Sites that block bots are not handled yet: a Playwright fallback is on the roadmap.

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

## Install

### Claude Code (native platform)

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

### Codex

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

### Cursor

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

### GitHub Copilot

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

### Gemini CLI

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

## When to use it
- read a long article without paying for every tag around it
- grab several pages in one call with `fetch_clean_batch`
- strip filler wording from a prompt while keeping tickers and amounts
- revisit the same page and get the cached answer
- wire page cleanup into an agent in Cursor or Claude Desktop

## Example prompts
- Pull up https://finance.yahoo.com/quote/AAPL/ with `fetch_clean` and list the key figures.
- Read these three links at once with `fetch_clean_batch` and compare what they say about the release.
- Run my request through `refine_prompt` and show both versions so I can choose.

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