# token-enhancer [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/xelektron/token-enhancer  
**GitHub Stars:** 68  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/token-enhancer

## Description
Cuts AI web-fetching costs up to 99.9% by stripping page junk before it reaches your LLM.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "token-enhancer": {
    "command": "uvx",
    "args": ["xelektron-token-enhancer"]
  }
}
```

## Documentation

## What the token-enhancer MCP server does

The token-enhancer MCP server places a local cleaning layer between an AI agent and the web. It retrieves a URL, removes page clutter, and returns text that is more suitable for an agent context window. Supported input formats include HTML, JSON, and plain text.

The project also includes an optional prompt-refinement layer. This can remove filler and hedging while preserving details such as stock tickers, dates, monetary values, negations, and references to the conversation. The refined and original prompt are both shown, so the caller can choose which version to use.

Reported reductions vary by page. The README gives examples ranging from 86% to 99% smaller output, including a Yahoo Finance page reduced from 704,760 tokens to 2,625 and a GitHub repository page reduced from 171,234 to 6,976.

## How it works

The token-enhancer MCP server runs as a local Python process. An MCP-compatible client starts the `mcp_server` module and discovers the available tools. The server fetches requested URLs, processes their contents, caches results, and sends cleaned text back through MCP.

Three MCP tools are provided:

- `fetch_clean` retrieves one URL and returns cleaned content.
- `fetch_clean_batch` retrieves multiple URLs in one operation.
- `refine_prompt` optionally produces a less verbose version of a prompt while displaying both versions.

The same cleaning service can also run as a standalone HTTP proxy on port 8080. Its `/fetch` and `/fetch/batch` endpoints handle content retrieval, `/refine` handles optional prompt cleanup, and `/stats` exposes session statistics. A LangChain example calls the `/fetch` endpoint and adds the result as an agent tool.

## Setup and configuration

Install the package with:

```bash
pip install xelektron-token-enhancer
```

For Claude Desktop, configure the `token-enhancer` MCP entry with `python3 -m mcp_server` as its command. Cursor uses the same command in `.cursor/mcp.json`. The repository also documents MCP use with OpenClaw, although that client is not included in every client integration list.

Python 3.10 or newer is required. No API key or GPU is required.

To run the HTTP mode from a source checkout, activate the project environment and start `python3 proxy.py`. Requests can then be sent to `http://localhost:8080/fetch` with a JSON body containing a `url` field.

## Tools and capabilities

The token-enhancer MCP server is suited to agents that need web content without full-page navigation, advertisements, scripts, or other markup noise. Batch fetching supports workflows that compare or collect several URLs. Result caching can make repeated requests faster.

The repository includes offline tests for the prompt-refinement layer and live tests that also exercise web fetching. Live tests require internet access. The package is licensed under MIT.

## Limitations and notes

Browser automation for bot-blocked sites is listed as planned work rather than an available feature. Authenticated session handling, output or history compression, a command-line interface, and a dashboard are also listed on the roadmap. The documented fetch path therefore applies to publicly accessible URLs that the underlying request process can retrieve.

Prompt refinement is opt-in, and its output is not intended to replace the original automatically: the tool returns both versions so the caller can decide. The HTTP proxy must be started separately when using the LangChain example or direct API integration.

_Full upstream README: https://allmcps.com/mcp/token-enhancer/readme_

