Lean Reader

io.github.AIMento由 GitHub 账号 AIMento 发布v0.1.0更新于 Oct 24, 2026

Token-minimized URL-to-clean-text reader for LLMs, with a token-savings receipt.

概览

AI 生成的概览

一个本地 MCP 服务器,抓取 URL 并返回经过 token 精简的干净正文,同时给出节省的 token 与估算费用回执。

可以做什么
抓取 URL 并把页面转换为适合 LLM 的干净精简文本,可通过 lean_read 工具指定 markdown 等格式。返回回执,包含处理前后 token 数、节省百分比、压缩倍数和估算节省费用。计数基于 o200k_base 分词器,并与原始页面 HTML 对比。
适用场景
适合助手需要阅读网页文章或文档页面,并希望减少 token 消耗而不是直接粘贴原始 HTML 的场景。对静态服务端渲染页面效果最好;客户端渲染的单页应用可能返回很少内容。
运行要求
通过 stdio 在本地运行,通常用 npx 从 lean-reader npm 包启动,因此需要 Node.js 以及访问目标 URL 的网络连接。未声明账号、API 密钥、环境变量或请求头。
安装前请注意
它会从你的机器抓取任意 URL,所指向的页面及其内容会进入本地进程和模型。当前版本仅处理静态 HTML,对 JavaScript 渲染页面可能返回不完整结果。token 与费用数字基于 o200k_base 分词器,其他模型会有差异。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Lean Reader,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Lean Reader

Turn any URL into token-minimized clean text for LLMs, with a token-savings receipt on every call. MCP server + library.

LLMs don't need your nav bar, your cookie banner, your <script> tags, or 200 KB of inlined SVG — but raw page HTML makes them pay for all of it. Lean Reader strips a page down to the article and tells you exactly how many tokens (and dollars) you just saved.

231,276 → 15,735 tokens (93% saved · 14.7× vs raw HTML · ~$0.54 on gpt-4o) · cleaned by lean reader

Use as an MCP server

Add to your client's MCP config (Claude Desktop/Code, Cursor, …):

json
{  "mcpServers": {    "lean-reader": { "command": "npx", "args": ["-y", "lean-reader"] }  }}

Then the lean_read(url, format?) tool returns clean text plus the receipt.

Use as a library

js
import { leanRead } from 'lean-reader/lib/core.js';
const r = await leanRead('https://example.com/article', { format: 'markdown' });console.log(r.content);   // token-minimized textconsole.log(r.receipt);   // { beforeTokens, afterTokens, savedPct, ratio, estCostSavedUsd, ... }

How much does it save?

Measured, not marketed — the open benchmark ships the corpus, the tokenizer, and every raw output, and flags the cases where Lean Reader loses:

  • ~29% fewer tokens than Mozilla Readability (the standard extractor) at the median, while keeping ~99% of the body text. Be honest about where that edge comes from: it's the minimize post-pass (link/image/footnote/whitespace strip), not smarter extraction — run both through minimize and they're roughly par. Lean actually runs Readability as one of its two extractors (see Honest limits), so it doesn't lose to it.
  • Versus raw page HTML the multiple is much larger (median ~8.7×, down to ~3.1× on already-clean blog prose, 100×+ on script-heavy docs) — but that's HTML nobody feeds an LLM, so read it as "don't dump raw pages," not as a competitive claim.
  • Versus Jina Reader (measured, anonymous tier): ~1.6× fewer tokens on a like-for-like body, ~4.3× if you count the nav and reference dumps Jina also returns. Firecrawl is not yet measured (needs an API key).

The receipt uses the o200k_base tokenizer (GPT-4o/4.1 class); the model and tokenizer are always shown, and counts are vs the raw page HTML so you can check the math.

Honest limits

  • Static HTML only (v1). Pages whose body is client-rendered (some SPAs, GitHub repo landing pages) return little — Lean Reader flags partial instead of emitting empty text. Jina/Firecrawl render JS and will beat us there.
  • Two extractors, body-max selection. Defuddle and Mozilla Readability each silently drop the body on different pages (Defuddle on some large Wikipedia articles, Readability on some docs/SPAs). Lean runs both and keeps whichever recovers more body, so neither's blind spot becomes a silent content drop. A ROUGE-L ground-truth pass on a 14-page hand-labeled sample is done: reference-body recall 0.99, equal to Readability on the same ground truth, so the word-count gap is noise removal, not body loss (see the bench repo).
  • Token counts are o200k_base; Claude/Gemini tokenize differently.

Open-core

The extraction + token-minimization core (lib/) and the MCP server (src/) are MIT. Hosted service, sharing UI, and metering are separate.

MIT © 2026

来源:README.md,提交 9e3aa7c

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分