Token Enhancer

v0.2.1Developer Toolsstable

A local proxy that strips web pages down to clean text before they enter your AI agent's context window. 704K tokens → 2.6K tokens. No LLM required.

mcp-server
Share:
64
Stars
0
Downloads
0
Weekly
0/5

What is Token Enhancer?

Token Enhancer is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to local proxy that strips web pages down to clean text before they enter your ai agent's context window. 704k tokens → 2.6k tokens. no llm required.

A local proxy that strips web pages down to clean text before they enter your AI agent's context window. 704K tokens → 2.6K tokens. No LLM required.

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A local proxy that strips web pages down to clean text befor

Use Cases

Strip web pages to clean text, reducing token consumption from 704K to 2.6K.
Compress content before AI processing without requiring an LLM.
Optimize context window usage for AI agents automatically.
xelektron

Maintainer

LicenseMIT
Languagepython
Versionv0.2.1
UpdatedMay 5, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

PIP

pip install xelektron-token-enhancer

Manual Installation

pip install xelektron-token-enhancer

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Token Enhancer

Token Enhancer is a local MCP server and proxy that fetches web pages and strips them down to clean, readable text before they enter an AI agent's context window — reducing a typical page from hundreds of thousands of tokens to just a few thousand. It exposes three tools (fetch_clean, fetch_clean_batch, and refine_prompt) that any MCP-compatible client can call in place of a raw browser fetch. Developers building web-research agents or RAG pipelines use it to dramatically cut API costs and avoid context-length limits without needing an LLM to do the cleaning.

Prerequisites

  • Python 3.10 or higher installed
  • pip package manager
  • An MCP-compatible client such as Claude Desktop or Cursor
  • Internet access to fetch URLs at runtime — no API keys required
1

Install the package

Install Token Enhancer from PyPI. This installs the mcp_server module and the optional standalone proxy.

pip install xelektron-token-enhancer
2

Verify installation

Confirm the module is importable and check which Python binary is being used.

python3 -m mcp_server --help
3

Configure Claude Desktop

Add the Token Enhancer MCP server to your Claude Desktop configuration. On macOS/Windows no extra environment variables are needed.

{
  "mcpServers": {
    "token-enhancer": {
      "command": "python3",
      "args": ["-m", "mcp_server"]
    }
  }
}
4

Restart Claude Desktop

Quit and reopen Claude Desktop to load the new server. The fetch_clean, fetch_clean_batch, and refine_prompt tools will appear in the tools panel.

5

Test the standalone proxy (optional)

You can also run Token Enhancer as a plain HTTP proxy on port 8080 and call it with curl or any HTTP client, independently of Claude Desktop.

python3 proxy.py
# In another terminal:
curl -s http://localhost:8080/fetch \
  -H 'Content-Type: application/json' \
  -d '{"url": "https://example.com"}'

Token Enhancer Examples

Client configuration

Claude Desktop configuration for Token Enhancer. Linux users with SSL issues can add the REQUESTS_CA_BUNDLE environment variable.

{
  "mcpServers": {
    "token-enhancer": {
      "command": "python3",
      "args": ["-m", "mcp_server"],
      "env": {}
    }
  }
}

Prompts to try

Example prompts that use the fetch_clean and fetch_clean_batch tools to retrieve web content with minimal token usage.

- "Fetch https://news.ycombinator.com and summarise the top 5 stories"
- "Clean and read the content at https://docs.python.org/3/library/asyncio.html"
- "Fetch these three URLs and compare their content: [url1, url2, url3]"
- "Use fetch_clean_batch to retrieve the latest posts from https://blog.example.com and https://another-blog.com"
- "Refine and clean the following raw text before I paste it into our analysis"

Troubleshooting Token Enhancer

SSL certificate verification errors on Linux

Add REQUESTS_CA_BUNDLE to the env block in your MCP config: set it to '/etc/ssl/certs/ca-certificates.crt' (Debian/Ubuntu) or '/etc/pki/tls/certs/ca-bundle.crt' (RHEL/Fedora).

python3 -m mcp_server fails with ModuleNotFoundError

Ensure you installed into the same Python environment that your MCP client will use. If using a virtualenv, activate it first or provide the full path to the Python binary in the 'command' field.

Fetched content is still very large despite cleaning

Some sites serve heavily JavaScript-rendered pages where the HTML itself is minimal but embeds large inline scripts. Try the refine_prompt tool to do a secondary pass, or use fetch_clean_batch to process only specific subsections of a page.

Frequently Asked Questions about Token Enhancer

What is Token Enhancer?

Token Enhancer is a Model Context Protocol (MCP) server that local proxy that strips web pages down to clean text before they enter your ai agent's context window. 704k tokens → 2.6k tokens. no llm required. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Token Enhancer?

Install via pip with: pip install xelektron-token-enhancer. Then configure your AI client to connect to this MCP server.

Which AI clients work with Token Enhancer?

Token Enhancer works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Token Enhancer free to use?

Yes, Token Enhancer is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "token-enhancer": { "command": "pip", "args": ["install", "xelektron-token-enhancer"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Token Enhancer?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides