
Token Enhancer
io.github.xelektronPublished by GitHub account xelektronv0.2.1Updated Oct 24, 2026
Cuts AI web-fetching costs up to 99.9% by stripping page junk before it reaches your LLM.
Overview
Lets an assistant fetch web pages as clean text, stripping HTML noise and caching results to cut token usage.
- What you can do
- Token Enhancer runs locally as an MCP server and exposes three tools: fetch_clean retrieves a URL and returns cleaned text with HTML, JSON and script noise removed; fetch_clean_batch does the same for several URLs at once; refine_prompt optionally trims filler words from a prompt while showing both versions. It caches fetched results so repeat requests are fast. The README reports reductions such as 704,760 tokens to 2,625 tokens for a Yahoo Finance page.
- When to use it
- Useful when an assistant regularly reads web pages and raw HTML is eating the context window or driving up cost. It fits agents that fetch articles, finance pages, news sites or repository pages and only need the readable text.
- Requirements
- Python 3.10+ installed locally; the package is installed from PyPI as xelektron-token-enhancer and started as a local MCP server process. No API keys, LLM or GPU are needed. Internet access is required for fetching pages. On some Linux hosts an SSL CA bundle path may need to be set via the REQUESTS_CA_BUNDLE environment variable.
Installation
In SourceWeft
- Open Token Enhancer in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
Token Enhancer
A local proxy that strips web pages down to clean text before they enter your AI agent's context window.
One fetch of Yahoo Finance: 704,760 tokens → 2,625 tokens. 99.6% reduction.
No API key. No LLM. No GPU. Just Python.
The Problem
AI agents waste most of their token budget loading raw HTML pages into context. A single Yahoo Finance page is 704K tokens of navigation bars, ads, scripts, and junk. Your agent pays for all of it before any reasoning happens.
The Solution
Token Enhancer sits between your agent and the web. It fetches the page, strips the noise, caches the result, and returns only clean data.
Install
Quick Start (from source)
Usage
As a standalone proxy
Then in another terminal:
As an MCP Server (Claude Desktop, Cursor, OpenClaw)
This is the plug and play option. Your AI agent discovers the tools automatically and uses them on its own.
Claude Desktop: Add to your config file
Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
On Linux hosts where SSL verification fails, the
envblock above overrides the default CA bundle. Remove it on macOS/Windows.
Cursor: Add to .cursor/mcp.json in your project:
Once connected, your agent gets three tools:
fetch_clean fetches any URL and returns clean text (86 to 99% smaller)
fetch_clean_batch fetches multiple URLs at once
refine_prompt optional prompt cleanup, shows both versions so you decide
As a LangChain Tool
Add fetch_clean to your agent's tool list. Start python3 proxy.py first.
Features
Data Proxy (Layer 2) Fetches any URL, strips HTML/JSON noise, returns clean text. Caches results so repeat fetches are instant. Handles HTML, JSON, and plain text.
Prompt Refiner (Layer 1, opt in) Strips filler words and hedging while protecting tickers, dates, money values, negations, and conversation references. You see both versions and choose.
MCP Server Plug into Claude Desktop, Cursor, OpenClaw, or any MCP client. Agent discovers the tools and uses them automatically.
API Endpoints (proxy mode)
Run Tests
Roadmap
- Layer 1: Prompt refiner
- Layer 2: Data proxy with caching
- MCP server integration
- LangChain tool example
- Browser fallback (Playwright) for bot blocked sites
- Authenticated session management
- Layer 3: Output/history compression
- CLI tool
- Dashboard UI
Requirements
Python 3.10+. No API keys. No GPU.
License
MIT
Source: README.md at commit 7291cfe
Tools
0Version history
1- v0.2.1LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts