Token Enhancer — Claude Code MCP server: clean text, fewer tokens
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.
claude mcp add token-enhancer -- uvx xelektron-token-enhancerWhat Token Enhancer 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.
What it helps with
- 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 for the agent
- Pull up https://finance.yahoo.com/quote/AAPL/ with
fetch_cleanand list the key figures. - Read these three links at once with
fetch_clean_batchand compare what they say about the release. - Run my request through
refine_promptand show both versions so I can choose.
How to install Token Enhancer
Platform CLI
claude mcp add token-enhancer -- uvx xelektron-token-enhanceruvx runs the command named after the package; if the README names another one, use uvx --from xelektron-token-enhancer <command>
Platform CLI
codex mcp add token-enhancer -- uvx xelektron-token-enhanceruvx runs the command named after the package; if the README names another one, use uvx --from xelektron-token-enhancer <command>
Config file
{
"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>
Config file
{
"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>
Platform CLI
gemini mcp add token-enhancer uvx xelektron-token-enhanceruvx runs the command named after the package; if the README names another one, use uvx --from xelektron-token-enhancer <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Token Enhancer
How do I install Token Enhancer in Claude Code?
Run claude mcp add token-enhancer -- uvx xelektron-token-enhancer. The agent then picks up the server's tools on its own.
What does Token Enhancer do?
It downloads a web page, strips the HTML noise and returns plain text to the agent. Results are cached, so a repeat fetch comes back fast.
What do I need to run it?
Python 3.10+. No API key and no GPU. If SSL verification fails on Linux, set REQUESTS_CA_BUNDLE to your CA bundle path in the client config.