NetLens
io.github.pzalutski-pixel由 GitHub 账号 pzalutski-pixel 发布v0.2.3更新于 Oct 25, 2026
Read any web page as clean, ad-stripped Markdown past robots.txt and bot blocks, plus web search.
概览
NetLens 是一个本地 MCP 服务器,可将网页抓取为去除广告的整洁 Markdown,并提供返回真实链接的网页搜索。
- 可以做什么
- 搜索网页并返回真实结果链接(标题、网址、摘要),可按调用或默认选择搜索引擎,并报告被跳过的引擎。抓取任意网址并以整洁 Markdown 返回整页内容,支持 article、full、raw、outline 模式,或只取某个标题下的章节。可用字符上限截断输出,或在只需正文时去掉链接网址。识别客户端渲染的页面并如实提示,而不是把空结果当作成功。
- 适用场景
- 当助手自带的网页工具返回空页面、只给摘要而非全文,或输出夹杂广告和导航时适用。适合有选择地阅读长文章,以及先搜索再阅读的流程。
- 运行要求
- 通过 npx(netlens-mcp)或 uvx 以 stdio 在本地运行;需要 Python 3.10+ 和系统 curl,缺失时回退到 urllib。需要访问目标网站和搜索引擎的网络。可选环境变量:NETLENS_SEARCH_ENGINE 和 NETLENS_SEARXNG_URL(指向 SearXNG 实例),以及超时、缓存、大小和 User-Agent 设置。未声明认证。
安装
在 SourceWeft 中
- 打开 控制台中的 NetLens,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
NetLens
[npm] [PyPI] [CI] [License: Apache 2.0] [Python 3.10+]
An MCP server for unobstructed web reading. It fetches any URL directly with
browser-like headers — past robots.txt and naive bot blocks — and returns the
full page as clean, ad-stripped Markdown, not a summary. Plus web search that
returns real links. Zero dependencies: pure Python standard library.
Built for AI Agents
AI agents constantly hit pages their built-in tools can't read. NetLens fixes the three usual reasons a fetch comes back empty or useless:
It does not try to defeat JavaScript/Cloudflare challenge pages or CAPTCHAs — that's out of scope by design. When a page is a hard block, the HTTP status is surfaced honestly rather than faked.
Installation
npm (via npx):
PyPI (via uvx):
Add either to your MCP client config (e.g. .mcp.json for Claude Code), then
restart the session so the tools load.
Tools
web_search
Search the web and return real result links (title, URL, snippet), parsed locally —
links, not summaries. Follow up with web_fetch to read a result.
The result reports which engine answered and what happened to any that were skipped, so falling through to a different backend is visible rather than silent:
Outcomes are observations, not conclusions — HTTP 202 is what the server sent;
whether that is throttling, changed markup or genuinely no matches cannot be
determined from the response. With SearXNG configured, direct answers,
infoboxes and suggestions appear alongside the results.
A search fetches a single result page (~10 results), returned in full by default so nothing at position 9/10 is dropped. There's no deep pagination — if the answer isn't in the first page, refine the query.
web_fetch
Fetch any page and return its full content as clean Markdown.
Reading part of a long page
A large article can be tens of thousands of characters when you want one part of
it. mode="outline" returns its shape, and section returns just that piece —
on a large encyclopedia article that is 153,000 characters full, 1,000 as an
outline, and 7,400 for the section actually wanted.
On link-heavy pages the URLs themselves are a large share of the output — around 40%
of a big encyclopedia article — so links="none" roughly halves it when you only need
the prose. Links pointing back into the same page are always rendered as plain text.
If a page turns out to be a client-rendered shell, web_fetch says so rather than
returning an empty result as a success:
(note: Only 10 characters of readable text were found in 6,856 characters of HTML. This page appears to be rendered client-side by JavaScript…)
Workflow: web_search to find pages, then web_fetch to read them.
Search engines
Search is a pluggable, selectable registry. In auto mode NetLens tries engines in
order and returns the first with results, so a rate-limit/challenge page on one
falls through to the next.
Pick per call with the engine argument, or set a default with
NETLENS_SEARCH_ENGINE.
Configuration
Self-hosted SearXNG
Point NETLENS_SEARXNG_URL at an instance with the JSON API enabled (search.formats
must include json in its settings.yml). It is then tried first in auto mode,
which removes the HTML scraping — and the rate limiting that comes with it — from the
common path.
Because it is tried first, it must fail fast when the box is off: the connect timeout is bounded separately so an unreachable instance is skipped in a few seconds rather than stalling every search, and the skip is reported in the result.
How it works
- Direct fetch. Requests go straight to the target site via the system
curl(better TLS/HTTP-2/compression, so it looks like a real browser), falling back tourllib. No third-party proxy or reader is involved. - Local conversion. HTML → Markdown happens in-process with a hand-rolled
html.parserconverter — headings, lists, links (relative URLs resolved), code blocks, and GFM tables with colspan/rowspan. - Content selection, not deletion. NetLens picks the page's main content region
— the HTML5 landmark (
<main>/<article>/[role=main]) when one exists, otherwise the subtree holding the most prose relative to its link density — and converts only that. Because it selects a winner rather than deleting anything that matches a name pattern, extraction cannot silently return an empty page. Nothing inspects CSS class or id names to decide what is content. - Pruning by measurement. Within that region, blocks that are overwhelmingly
link anchors (navboxes, tag clouds, "more from this site" grids) are dropped
based on their link density. Non-rendering elements (
<script>,<style>, …), explicitly hidden elements, and third-party ad-network slots (identified by vendor names likeadsbygoogle, which cannot collide with real prose) are removed outright. - Response charset is honored (from
Content-Typeor<meta>), so non-UTF-8 pages don't come back garbled.
Usage from the CLI
The server is also a plain script — handy for testing before a client loads it:
python -m netlens_mcp runs the stdio MCP server; python -m netlens_mcp.server <cmd> runs the CLI.
Development
Requirements
- Python 3.10+ (and the system
curl, which ships with modern Windows/macOS/Linux; falls back tourllibif absent)
License
来源:README.md,提交 0cac036
工具
0版本历史
1- v0.2.3最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分