Skip to main content
Glama
NikkeTryHard

fast-webfetch-mcp

by NikkeTryHard

fast-webfetch-mcp

一个网页抓取 MCP 服务器,使用您自己机器上运行的真实浏览器渲染页面,然后将干净的 Markdown 交给模型,而不是为 2MB 的 JavaScript 支付 token 账单。

这里的抓取完全免费:无需 API 密钥,没有按页计费。而且当某个网站声称阻止您时,通常只是一个无头检测脚本,真实的 Chromium 可以直接绕过。

工作原理

两个小程序,一个任务:

MCP client (agent)
   │  JSON-RPC over stdio
   ▼
src/index.ts          Bun + MCP SDK — tool schemas, budgets, rendering
   │  spawns per request
   ▼
crawl4ai_worker.py    Python + Crawl4AI — headless Chromium, markdown extraction
   │
   ▼
The actual internet

TypeScript 服务器负责策略:超时、并发许可、输出截断、可选的 Gemini 驱动的摘要。Python 工作进程负责机制:浏览器生命周期、渲染、重试。两者互不干涉,它们之间的契约是 stdout 上的一个 JSON 文档。

Related MCP server: crawler-mcp

安装

要求:Bun、Python 3.12+,以及首次下载浏览器时所需的与 GPU 无关的耐心。

git clone <this repo> ~/.local/share/mcp/fast-webfetch-mcp   # or anywhere
cd ~/.local/share/mcp/fast-webfetch-mcp
bun install
uv venv .venv --python 3.12 && uv pip install --python .venv/bin/python crawl4ai

验证浏览器端是否正常工作:

FAST_WEBFETCH_SMOKE_URL=https://example.com bun run src/index.ts

您应该会看到示例域名的 Markdown。如果看到关于 Playwright 浏览器的堆栈跟踪,请从 venv 运行 crawl4ai-setup 并重试——它会为您安装正确的 Chromium 构建。

接入您的代理

{
  "mcpServers": {
    "fast-webfetch": {
      "type": "stdio",
      "command": "/usr/bin/mullvad-exclude",
      "args": ["/home/you/.bun/bin/bun", "run", "/path/to/fast-webfetch-mcp/src/index.ts"],
      "env": { "PATH": "/home/you/.bun/bin:/usr/bin:/bin" }
    }
  }
}

mullvad-exclude 包装器是可选的;它只是让抓取流量绕过 VPN,以便网站看到您的真实 IP。普通的 "command": "bun" 也能同样工作。

工具

fast_fetch — 一个 URL 到 Markdown

参数

类型

默认值

说明

url

string

必填

prompt

string

如果设置,则返回基于事实的答案,而不是完整页面

max_length

number

40,000

中间截断保留开头和结尾

full_content

boolean

false

将上限提高到 100,000 字符

timeout_ms

number

25,000

硬性上限,包括浏览器渲染

options

object

每次调用的渲染选项,见下文

fast_fetch_raw — 一个 URL 到原始 HTML

参数与上面相同,但不包括 prompt。当 Markdown 丢失了您需要的内容时使用:表格、data- 属性、meta 标签、精确的标记。

options 对象

所有三个工具都接受一个可选的 options 对象,用于需要比简单加载并抓取更多功能的网站:

{
  "url": "https://example.com/feed",
  "options": { "full_page": true, "wait_seconds": 1.5, "drop_overlays": true }
}

类型

效果

full_page

boolean

在提取前滚动整个页面——捕获懒加载和无限滚动内容。较慢;在无限信息流上会一直滚动直到超时

wait_seconds

number

捕获前的稳定延迟,例如对延迟水合页面使用 1.5

iframes

boolean

将 iframe 内容纳入结果

drop_overlays

boolean

在提取前移除 Cookie 横幅和弹窗

拼写错误的键会被静默丢弃,而不是传递——选项负载在 Python 端会变成 CrawlerRunConfig 标志。

fast_fetch_multiple — 一次批量抓取最多 15 个 URL

参数

类型

默认值

说明

urls

string[]

必填

1–15 个绝对 http(s) URL

max_length

number

40,000

每个 URL

full_content

boolean

false

每个 URL

timeout_ms

number

25,000

整个批次共享

options

object

相同的选项,应用于每个 URL

每个 URL 都会作为独立部分返回,并带有元数据头(urlstatuselapsed_mstruncated)。一个慢速网站不会饿死其他网站——它只会收到逐项超时错误,而同一批次的其他网站则成功。

配置

全部可选,全部通过环境变量。

服务器旋钮

变量

默认值

用途

FAST_WEBFETCH_MAX_LENGTH

40000

默认每页字符上限

FAST_WEBFETCH_HARD_MAX_LENGTH

100000

full_content 的上限

FAST_WEBFETCH_TIMEOUT_MS

25000

默认抓取超时

FAST_WEBFETCH_MULTIPLE_CONCURRENCY

12

并行浏览器槽位(最大 32)

FAST_WEBFETCH_DISABLE_SUMMARY

未设置

1 完全移除 prompt 支持

FAST_WEBFETCH_PYTHON

<repo>/.venv/bin/python

工作进程解释器

FAST_WEBFETCH_WORKER

<repo>/crawl4ai_worker.py

工作进程路径

GEMINI_API_KEY / GEMINI_API_KEY_FILE

仅用于 prompt 摘要功能

浏览器旋钮

变量

默认值

用途

CRAWL4AI_STEALTH

开启(1

反检测补丁:webdriver 标志、插件、WebGL 供应商、Chrome API。设置为 0 可禁用

CRAWL4AI_PROXY_URL

关闭

出口代理

CRAWL4AI_WAIT_UNTIL

domcontentloaded

Playwright 等待策略

CRAWL4AI_SCAN_FULL_PAGE

关闭

提取前滚动——也可通过 options.full_page 按调用使用

CRAWL4AI_DELAY_SECONDS

0

HTML 捕获前的稳定时间——也可通过 options.wait_seconds 按调用使用

值得了解的行为

JS 密集型网站在默认等待策略下通常返回空壳。当返回 200 但没有内容时,工作进程会在同一超时预算内使用 networkidle 重试一次——最坏情况是等待一次,而不是两次。与此同时,连接失败和 HTTP 错误保持单次尝试:重试一个死主机只是更慢地失败。

fast_fetchfast_fetch_multiple 共享同一个 12 个浏览器槽位的池,因此大批量不会饿死并发的单个抓取。超出池的需求会排队;请求的槽位多于现有数量的批次会获得空闲的槽位。

最后,max_length 的存在是因为您的代理的上下文窗口是一个预算,而不是一个垃圾填埋场。

出问题时,您会得到一个日志路径

失败被分为两类:互联网不稳定(超时、慢速网站、逐项批次截止错误)和工具实际损坏(工作进程无法启动、工作进程崩溃、stdout 溢出、无法解析的输出)。只有第二类会写入日志——第一类只会得到一个诚实的错误标签。

工具端失败以以下内容结束:

log: /path/to/fast-webfetch-mcp/logs/2026-08-22T09-02-06-780Z-fast_fetch.json

其中包含:工具、精确参数、工作进程输入以及完整的失败记录(阶段、退出代码、信号、stderr 尾部)——足以逐字重放请求:

FAST_WEBFETCH_INPUT='{"url":"https://example.com","max_length":40000}' \
  .venv/bin/python crawl4ai_worker.py

使用 FAST_WEBFETCH_LOGS_DIR 重定向。

保持在 30 秒以内

代理框架往往会在 30 秒左右终止 MCP 调用,因此此服务器将 28 秒视为硬性上限。每个工具都会在此之前响应:如果抓取成功则返回完成的结果,否则返回结构化的逐项错误,说明哪个阶段消耗了时间。预算耗尽的批次仍会返回已完成的项目。

故障排除

症状

可能的原因和修复

Crawl4AI worker missing

仓库已移动;检查 FAST_WEBFETCH_WORKER 指向 crawl4ai_worker.py

Crawl4AI python missing

.venv 缺失或解释器错误;设置 FAST_WEBFETCH_PYTHON

某个网站上的所有请求都超时

网站确实很慢或具有敌意;尝试 CRAWL4AI_STEALTH=1

某些项目出现 Batch deadline exceeded

预期情况:共享 25 秒预算,掉队者会收到逐项错误

SPA 上的空 Markdown

应通过重试自愈;如果没有,提高 CRAWL4AI_DELAY_SECONDS

开发

bun install
bun test            # 18 tests, no network needed
bun run typecheck   # tsc --noEmit, strict + noUncheckedIndexedAccess

Python 工作进程可以直接驱动,这是在没有 MCP 层的情况下调试抓取行为的最快方式:

FAST_WEBFETCH_INPUT='{"url":"https://example.com","max_length":500}' \
  .venv/bin/python crawl4ai_worker.py

另请参阅

许可证

MIT。

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    MCP server that lets Claude Code fetch web content using real Chrome browsers. Renders JavaScript-heavy pages, handles bot mitigation, and runs up to 14 parallel browsers locally with zero API keys. Makes outbound HTTP requests only to URLs the user explicitly asks Claude to fetch.
    2
    14
    91
    MIT
  • F
    license
    A
    quality
    C
    maintenance
    Web-crawler MCP server that fetches web pages with static parsing or headless browser fallback, enabling Claude to fetch, extract links, crawl sites, and select content via CSS selectors.
    4
  • A
    license
    A
    quality
    C
    maintenance
    An MCP server that enables AI assistants to fetch web content in multiple formats (HTML, JSON, text, Markdown) with intelligent content extraction, chunk management, and browser automation support.
    5
    52
    15
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    An open-source web retrieval MCP server that fetches, crawls, and searches the web, returning clean markdown for AI agents. It integrates with Claude MCP, LangChain, and other frameworks for agentic web access.
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • Zenrows MCP server — Fetch, Extract, Batch, and Browser Sessions for AI coding assistants

  • Firecrawl MCP — wraps the Firecrawl API (firecrawl.dev) for web

  • SEO MCP server: crawl your site, find AI-visibility gaps, and ship the fix from your coding agent.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/NikkeTryHard/fast-webfetch-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server