
Token Enhancer
io.github.xelektron由 GitHub 帳號 xelektron 發布v0.2.1更新於 Oct 24, 2026
Cuts AI web-fetching costs up to 99.9% by stripping page junk before it reaches your LLM.
概覽
讓助理以純文字方式抓取網頁,去除 HTML 雜訊並快取結果,藉此減少 token 用量。
- 可以做什麼
- Token Enhancer 以本機 MCP 伺服器方式執行,提供三個工具:fetch_clean 抓取指定網址並回傳去除 HTML、JSON 與指令碼雜訊後的乾淨文字;fetch_clean_batch 一次抓取多個網址;refine_prompt 可選擇性精簡提示詞中的冗餘措辭,並同時顯示兩個版本。它會快取抓取結果,讓重複請求更快速。README 舉例指出某財經頁面從 704,760 個 token 降至 2,625 個。
- 適用情境
- 適合助理經常閱讀網頁、而原始 HTML 佔用大量上下文或推高成本的場景。適用於只需可讀正文的文章、財經頁面、新聞網站或程式碼倉庫頁面抓取。
- 執行需求
- 本機需安裝 Python 3.10+;透過 PyPI 安裝 xelektron-token-enhancer 套件,並以本機 MCP 伺服器程序啟動。不需要 API 金鑰、LLM 或 GPU。抓取網頁需要網路存取。部分 Linux 主機可能需要透過 REQUESTS_CA_BUNDLE 環境變數指定 SSL CA 憑證路徑。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Token Enhancer,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
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
來源:README.md,提交 7291cfe
工具
0版本歷史
1- v0.2.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分