
Web To Markdown Mcp
io.github.sidney由 GitHub 账号 sidney 发布v0.6.0更新于 Oct 24, 2026
MCP server fetches URL through a real Chromium browser, returns main content as clean Markdown
概览
抓取指定网址并以干净的 Markdown 返回页面正文,对依赖 JavaScript 或带机器人防护的页面会回退到真实 Chromium 浏览器渲染。
- 可以做什么
- 只提供一个工具 fetch_url_as_markdown,输入网址后返回文章正文的 Markdown。它先尝试带 markdown 内容协商的普通 HTTP 请求,其次从静态 HTML 中提取正文,最后才用 patchright 驱动无头 Chromium 渲染页面再提取。参数可控制导航等待条件、超时、轮询预算以及是否显示浏览器窗口。失败时返回以 "ERROR:" 开头的字符串。
- 适用场景
- 适合让助手把网页当作文本来阅读,而不是拿到原始 HTML,尤其是 JavaScript 渲染的文章或被普通 HTTP 客户端拦截的站点。它是只读抓取工具,不是交互式浏览器,因此不适合点击、填表或登录。
- 运行要求
- 本地进程;需要 Python 3.10+,并通过 patchright 一次性下载约 300 MB 的 Chromium。以 stdio 运行,未声明环境变量或凭据。有头模式(headless=false)需要图形显示环境;数据中心 IP 仍可能被拦截。
安装
在 SourceWeft 中
- 打开 控制台中的 Web To Markdown Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
web-to-markdown-mcp
An MCP server that fetches a URL and returns the main content as clean Markdown. Uses plain HTTP when possible and real Chromium when needed.
Why
Most MCP web-fetch tools either:
- use plain HTTP, which fails on JS-required pages and gets blocked by Cloudflare bot detection on many sites; or
- use a real browser but return raw HTML or accessibility-tree snapshots, which are noisy and token-heavy when you just want to read the article.
This server uses a three-tier strategy, using the fastest approach that works for each URL:
-
Native markdown fast-path. Every request first tries a plain HTTP GET with an
Accept: text/markdownheader. Servers that support content negotiation — such as Cloudflare-hosted sites with Markdown for Agents enabled — respond withContent-Type: text/markdown, and the body is returned immediately with no browser overhead. -
Plain HTTP + extraction. If the server returns HTML, trafilatura extracts the article body as clean Markdown directly from the static response. Heuristics detect JS shells — pages that return only a "JavaScript required" stub in the static HTML — and fall through to tier 3 for those.
-
Headless browser. When tiers 1 and 2 yield nothing usable, patchright (a Playwright fork with anti-detection patches) drives real Chromium and trafilatura extracts the rendered content. A single headless browser instance is kept alive across calls — it launches lazily on the first browser-tier fetch and stays running for the session, so subsequent fetches pay only navigation time rather than Chromium startup cost (~2–5 s).
For sites that block even headless patchright (aggressive bot detection), pass headless=False. This uses a visible Chromium window — slower and visually intrusive, but clears most remaining challenges. A headed browser is launched and closed for each fetch that needs it; it is not kept persistent since headed fetches are an infrequent escape hatch rather than the common case.
After browser navigation, the server polls the DOM and runs trafilatura, returning as soon as two consecutive polls produce the same extraction. This means it returns within a few hundred milliseconds for typical pages — rather than waiting for analytics, ads, and other late-loading resources to finish — and gives slow SPAs and bot-challenge clearance time to settle without timing out prematurely.
For a typical article, expect roughly 80% fewer tokens than the raw HTML and roughly 90% fewer than a full accessibility-tree snapshot.
Installation
Requires Python 3.10+ and a one-time Chromium download (~300 MB).
MCP client configuration
Claude Desktop
Edit your config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Restart Claude Desktop.
LM Studio
Edit ~/.lmstudio/mcp.json (Developer tab → Edit mcp.json) — same JSON block as above. Then enable Allow calling servers from mcp.json in the Developer tab's Server Settings. The server appears in the Integrations tab of any new chat.
Cursor / Windsurf / VS Code
Same JSON block, in each client's MCP config location.
Claude Code
Usage
The server exposes a single tool:
fetch_url_as_markdown
Returns Markdown as a string, or a string beginning with "ERROR:" on expected failures (timeout, no extractable content, navigation error).
Example call (from any MCP client's tool-use UI):
wait_until choice:
"domcontentloaded"(default) — returns when the DOM is built; content-stabilization polling handles the rest"load"— waits for all subresources (images, scripts, stylesheets); rarely needed since polling runs after this"networkidle"— waits for network to quiet; sometimes hangs on pages with persistent background connections"commit"— returns as soon as the response starts; rarely useful
When to bump poll_budget_ms: the 5-second default is fine for typical pages but may return a partial extraction on slow SPAs that render content over many seconds, and may time out before a bot-detection challenge clears in headed mode. For headed-mode fetches of bot-protected sites, 10000-30000 is a reasonable budget.
Limitations
- First browser-tier fetch per session. The headless browser launches lazily on the first fetch that needs it (~2–5 s). Subsequent browser-tier fetches in the same session reuse the running instance and pay only navigation time.
- Bot detection on hard sites. patchright headless clears default Cloudflare configurations on many sites, but pages running aggressive Bot Fight Mode, Turnstile interactive challenges, or commercial bot-management products (PerimeterX, DataDome, Kasada) — and Cloudflare's own marketing site — still detect headless Chromium. Pass
headless=Falseto use a visible browser window, which clears most of these. The cost is a Chromium window flashing on screen for a couple of seconds per fetch. - Headed-mode bot challenges need a generous polling budget. When using
headless=Falseon bot-protected sites, the challenge can take 5-15 seconds to clear. Setpoll_budget_msto 10000-15000 for these cases — the 5000 default may return prematurely while the challenge is still resolving. - Headed mode requires a display.
headless=Falsefails on servers without a graphical environment (cloud VMs, containers, CI). Use a virtual display like Xvfb if you need headed mode in those environments. - Datacenter IPs. Cloudflare's harder challenges still block requests from datacenter IPs (Oracle Cloud, AWS, etc.) regardless of browser fingerprint or headed/headless mode. Best results come from running this on a residential connection.
- Slow SPA rendering. For pages that progressively render content over many seconds, bump
poll_budget_ms. The default returns the most-recent extraction at budget expiry, which on a still-rendering SPA may be partial. - Auth-walled content. This server uses a clean browser context with no cookies or stored auth. Logged-in pages won't work.
Comparison with related tools
@playwright/mcp(Microsoft) — general-purpose interactive browser automation: navigate, click, fill forms, run JS, take accessibility snapshots. Use it when you need to interact with a page. Use this server when you need to read a page.mcp-server-fetchand similar HTTP-based servers — also try plain HTTP first, so for static sites the behaviour is similar. The difference is JS-rendered pages and bot-protected sites: those tools don't have a browser fallback, so they fail where this server succeeds.- LM Studio Hub plugins like
vadimfedenko/visit-website-reworkedandnpacker/web-tools— same idea inside LM Studio's plugin system. This server runs in any MCP client.
Roadmap
- Persistent headless browser instance to amortize cold start
-
Accept: text/markdownfast path for Cloudflare's Markdown for Agents - Optional
selectorparameter to scope extraction - Optional viewport, user-agent, and locale overrides
- Optional persistent browser context for sticky cookies / WAF trust
-
channel="chrome"option to use installed Google Chrome instead of bundled Chromium (further stealth for the hardest sites)
Contributing
Issues and PRs welcome. For substantive changes, please open an issue first to discuss the approach.
License
MIT — see LICENSE.
来源:README.md,提交 5afb953
工具
0版本历史
1- v0.6.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分