mcp-fetch-ux
Fetches web pages with JavaScript rendering, pierces Shadow DOM, and enables interactive actions like clicking and form filling using a real Chrome browser.
README
mcp-fetch-ux
MCP server that fetches web pages using a real browser. Renders JavaScript, pierces Shadow DOM, returns clean text. Can interact with pages — click buttons, fill forms, download files.
Built because Claude Code's WebFetch hangs indefinitely on slow sites with no timeout, and existing fetch tools can't see inside Shadow DOM.
How it works
- Patchright launches real Google Chrome (headed under
xvfb) and navigates to the URL - Dismisses cookie/consent overlays automatically
- Waits for JS to render (polls until page content stabilizes)
- Ctrl+A, Ctrl+C — uses the clipboard API to capture all visible text, including content inside Shadow DOM
- Discovers available actions (buttons, links, inputs) and returns them as hints
- Optionally runs actions (click, fill, wait) — if a click triggers a download, returns the file content
No LLM in the loop. No API costs. 30-second timeout.
Quick start
git clone https://github.com/bxxd/mcp-fetch-ux.git
cd mcp-fetch-ux
make install # install deps + real Chrome + 'fetch' CLI to ~/.local/bin/ (run server under xvfb)
# Basic fetch
fetch https://www.roche.com/solutions/pipeline
# Click a button to download CSV
fetch https://roche.com/solutions/pipeline --click "button:has-text('Download current view as CSV')"
# Save to file
fetch https://roche.com/solutions/pipeline --click "button:has-text('Download current view as CSV')" -o pipeline.csv
# More content (default 50K chars via MCP, unlimited via CLI)
fetch https://en.wikipedia.org/wiki/Likelihood_ratio --max 100000
Start the MCP server:
make server # start on port 5006
MCP configuration
{
"mcpServers": {
"fetch-ux": {
"type": "sse",
"url": "http://127.0.0.1:5006/sse"
}
}
}
Tool
fetch
| Parameter | Type | Default | Description |
|---|---|---|---|
url |
string | required | URL to fetch |
actions |
array | none | Actions to perform before capturing (click, fill, wait, select, scroll) |
max_length |
int | 5000 | Max characters to return |
start_index |
int | 0 | Resume from this index (pagination) |
raw |
bool | false | Return raw HTML instead of text |
Two-step interaction
First call returns page content + available actions:
Contents of https://www.roche.com/solutions/pipeline:
Title: Roche | Product Development Pipeline
RG7716
faricimab
Vabysmo
macular edema secondary to branch retinal vein occlusion (BRVO)
...
---
Available actions on this page:
- click: "button:has-text('Download current view as CSV')"
- click: "button:has-text('Phase')"
- fill: "search" (search)
Second call with actions gets the data:
{
"url": "https://www.roche.com/solutions/pipeline",
"actions": [{"action": "click", "selector": "button:has-text('Download current view as CSV')"}]
}
Returns the full CSV (51K chars, 131 pipeline entries with descriptions).
Why not just httpx/curl?
They don't render JavaScript. Roche's pipeline page returns an empty shell — the drug data loads via JS into Shadow DOM web components. curl gets nothing. This tool gets what a human sees.
Why not innerText or Readability?
page.innerText('body') and document.getSelection() don't cross Shadow DOM boundaries. Readability can't see JS-rendered content. The clipboard API captures exactly what a user gets when they Ctrl+A, Ctrl+C in Chrome — the only reliable way to get all visible text from modern web pages.
Why not crawl4ai?
Tested crawl4ai (50K+ stars) on the same Roche pipeline page. It returns 7,220 chars with zero drug names — can't see inside Shadow DOM. This tool returns 11,224 chars with all 131 drugs.
Browser engine
One engine, no fallback: real Google Chrome (channel="chrome") via Patchright, in a single persistent context — a warm, shared cookie jar. No UA spoof, no Sec-Ch-Ua override, no AutomationControlled flag, no init-script masks: real Chrome + Patchright present a coherent fingerprint, and layering manual masks on top only creates detectable inconsistencies. This beats Cloudflare/Datadome-class walls; it does not beat Google's reCAPTCHA-Enterprise SERP (that scores the whole environment).
Requires Chrome (patchright install chrome) and a display — run headed under xvfb.
| Variable | Default | Effect |
|---|---|---|
FETCH_UX_HEADLESS |
0 |
1 → headless (more detectable; headed-under-xvfb is stealthier) |
FETCH_UX_COOKIE_TTL |
86400 |
seconds before the shared cookie jar is thrown away and rebuilt |
If a DRM render node (/dev/dri/renderD128) is present — e.g. a GPU passed into the container — Chrome drives WebGL through it via ANGLE/EGL, so the renderer reports the real GPU instead of WebGL: false. No-op without a GPU.
Performance
Chrome launches once at server startup and stays alive in one persistent context (shared cookie jar); each fetch opens and closes a page, not a context.
| Phase | Time |
|---|---|
| Navigation | ~1-2s |
| JS render + stabilization | ~1-3s |
| Total per fetch | ~3-5s |
Concurrency limited to 3 simultaneous fetches.
Dependencies
- Playwright — browser automation
- Starlette + Uvicorn — HTTP/SSE server
- MCP SDK — Model Context Protocol
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。