Token Enhancer logo

Token Enhancer

Cleans fetched web content and exposes URL, batch-fetch, and optional prompt-refinement tools over MCP.

Install Token Enhancer

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "token-enhancer": {
      "command": "uvx",
      "args": [
        "xelektron-token-enhancer"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Claude Code command
claude mcp add --transport stdio token-enhancer -- uvx xelektron-token-enhancer

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

We couldn’t confirm it starts correctly

We hit an unexpected error while testing this listing automatically.

uvx xelektron-token-enhancer

Rate limit exceeded, please try again later - you have reached the maximum number of concurrent E2B sandboxes (20). If you need more, please visit 'https://e2b.dev/docs/billing'

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

The token-enhancer MCP server fetches web pages locally, removes HTML, JSON, and plain-text noise, and returns cleaner content to an AI agent. It exposes `fetch_clean`, `fetch_clean_batch`, and optional `refine_prompt` tools, with caching for repeated fetches. Use it when raw web pages consume excessive context or token budgets, especially for finance, documentation, news, and repository pages. It requires Python 3.10 or newer and does not require API keys or a GPU.

Use cases

  • Fetch clean text from finance pages before analysis
  • Batch-fetch several web sources for comparison
  • Reduce HTML noise before adding pages to an agent context
  • Review an optional shortened prompt before sending it

Key features

  • Cleans HTML, JSON, and plain-text web responses
  • Provides single-URL and batch-fetch MCP tools
  • Caches fetched results
  • Offers opt-in prompt refinement
  • Runs as an MCP server or HTTP proxy
  • Works without API keys or a GPU

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

24/24 checks healthy over the last 82d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 18d ago via OSV.dev · xelektron-token-enhancer (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars68Stargazers on the source repository.
Last commit8mo agoMost recent push to the default branch.
Install checkInconclusiveWe hit an unexpected error running the automated check.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How Token Enhancer works

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:

Terminal
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.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Token Enhancer

token-enhancer is an MCP server that connects AI agents to web URLs through a local cleaning proxy. Its main tools are `fetch_clean` for one URL, `fetch_clean_batch` for multiple URLs, and optional `refine_prompt` for comparing an original prompt with a less verbose version.

Install it with `pip install xelektron-token-enhancer`. MCP clients can then start it with `python3 -m mcp_server`; source users can clone the repository, run its installer, and activate the Python environment.

Yes, token-enhancer works with Cursor through a `.cursor/mcp.json` entry that runs `python3 -m mcp_server`. After the server connects, Cursor can discover the documented fetch and prompt-refinement tools.

No, token-enhancer does not require an API key or GPU. It requires Python 3.10 or newer; Linux users may also need the documented `REQUESTS_CA_BUNDLE` setting if SSL verification fails.

Run `python3 proxy.py` and send JSON requests to `http://localhost:8080/fetch`. The proxy also provides batch-fetch, prompt-refinement, and session-statistics endpoints.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewToken Enhancer AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/token-enhancer?style=directory)](https://allmcps.com/mcp/token-enhancer)
HTML Embed
<a href="https://allmcps.com/mcp/token-enhancer"><img src="https://allmcps.com/api/badge/token-enhancer?style=directory" alt="Token Enhancer on AllMCPs" /></a>