MCP 配方

MCP Recipes

在安装 FourA MCP server 后,您可以在任何兼容 MCP 的客户端(Claude Desktop、Claude Code、Cursor、Windsurf、VS Code)中运行以下五个可直接复制的 prompt。

每个配方都编排了一个或多个 foura_singlefoura_proxyfoura_browser,用于执行常见的抓取任务。有两种使用方法:

  1. 调用内置 prompt(每个 MCP 客户端都会将服务端提供的 prompt 呈现为斜杠命令或 /prompts 面板)。选择 prompt,填写参数并运行。MCP server 会返回模板化的工作流,LLM 将使用正确的工具执行它。
  2. 复制下方文本到您自己的对话中。效果相同,但较难发现。

MCP server 将这些作为原生 prompt 提供:scrape_product_pageextract_articlemonitor_pricingcheck_endpoint_healthbulk_fetch_urls

关于大页面的说明 (v0.2.0+): 默认情况下,无论大小如何,response body 都会在 structuredContent 中内联返回,这适用于包括 Claude Desktop 在内的所有 MCP 客户端。如果您使用的客户端支持 MCP resources/read,并且您希望在大页面上节省 token,请在工具调用中传递 offload_large: true。大于等于 50 KB 的 response 将作为 resource_link 返回,您的客户端可按需获取。下方内置的 prompt 均假定使用默认设置(内联)。

1. 抓取商品页面

适用于电商商品详情页,包括单页面应用(SPA)网站以及设有反爬挑战的页面。

内置:scrape_product_page(url)

手动 prompt:

Fetch the product page at <URL> using foura_browser — most product pages are single-page apps and need JavaScript to render.

From the response body extract:
- product title
- price (with currency)
- primary product image URL (absolute, not relative)
- availability / stock status
- product SKU or ID if visible

Return as JSON: {"title": "...", "price": 0, "currency": "USD", "image_url": "...", "in_stock": true, "sku": "..."}

适用场景:价格比较 Agent、到货通知器、竞争对手分析电子表格。

2. 提取文章

适用于新闻文章、博客文章、技术文档,以及任何您希望获取不含导航、广告和页脚噪音的纯净阅读文本的场景。

内置:extract_article(url)

手动 prompt:

Fetch <URL> using foura_single with unblocker:true. Most news and blog sites are server-rendered, so HTTP is fastest (200ms-2s).

If foura_single returns a 403, captcha page, or empty content, retry the same URL with foura_proxy (maxTries:3) — it routes through a rotating proxy pool.

From the response, extract:
- headline (the main H1, not the page title bar)
- author byline (may be inside .author, [rel=author], itemprop)
- publication date (look for <time>, .published, or JSON-LD)
- main article body (strip navigation, ads, related-content, footer, comments)
- canonical URL (rel=canonical or og:url)

Return as JSON: {"title": "...", "author": "...", "date_published": "ISO8601", "body": "...", "canonical_url": "..."}

适用场景:研究摘要生成器、单站 RSS、每日新闻摘要。

3. 监控价格

适用于价格页面和商品报价,并可选择与目标价格进行对比。

内置:monitor_pricing(url, target_price?)

手动 prompt:

Use foura_proxy with maxTries:5 and unblocker:true to fetch <URL>. Pricing pages often have aggressive bot detection, so go through the proxy pool from the start.

Extract the current price (look for visible $/€/£ amounts, JSON-LD Offer schema, [itemprop=price]).

If a target price is provided, compare: report whether current is below/at/above target and the absolute difference.

Return as JSON: {"url": "...", "current_price": 0.00, "currency": "USD", "target_price": 0, "difference": 0, "status": "below|at|above"}

适用场景:省钱提醒 Agent、差旅票价监控器、B2B 竞争对手价格跟踪器。

4. 检查端点健康状况

适用于运行时间探测和 API 端点验证。

内置:check_endpoint_health(url, expected_text?)

手动 prompt:

Use foura_single with GET on <URL>, timeout_ms:5000, and validate.status.accept:[200]. If an expected substring is provided, also set validate.data.accept:["<EXPECTED>"] so the request only counts as success when the body contains it.

Report:
- reachable (true if any response came back, false on connection error/timeout)
- status_code (HTTP code from target)
- total_time_ms (from the total_time field)
- validation_passed (true if status + body validation conditions were met)

Return as JSON: {"url": "...", "reachable": true, "status_code": 200, "total_time_ms": 0, "validation_passed": true}

适用场景:外部运行时间监控器、部署冒烟测试、第三方 API 监控哨兵。

5. 并行获取 URL 列表

适用于需要获取多个 URL 的元数据而无需内联其 body 的批量任务。

内置:bulk_fetch_urls(urls)

手动 prompt:

Parse the following comma-separated URLs and fetch each one concurrently using foura_single (unblocker:true).

URLs: <COMMA_SEPARATED>

For any URL that returns 403, captcha page, or empty body — retry that single URL with foura_proxy (maxTries:3).

Return a JSON array, one entry per URL in input order:
[{"url": "...", "status": 200, "success": true, "body_size_bytes": 0, "via": "single|proxy", "error": null}, ...]

Do NOT inline full response bodies in the output — only metadata. If you need body content, call foura_single individually after this report.

适用场景:站点地图可达性扫描、死链审计、“这 50 个商品 URL 中哪些仍然存在”的检查。

6. 跨多次调用锁定 proxy IP(跨工具)

当您需要连续调用看起来来自同一个客户端时(例如,抓取多步结账流程,或在渲染页面后获取其 JS 资源),请选择一个可用的 proxy 并复用其 ID。

手动 prompt:

First, call foura_proxy with maxTries:5 and a quick probe URL (httpbin.org/ip is fine) to find a working proxy. Capture the returned `proxy` ID (looks like "4DZ3VE").

Then for every follow-up call:
- HTTP request: foura_single with the SAME `proxy` value — same exit IP, you preserve any IP-based session.
- Rendered page: foura_browser with the SAME `proxy` value — the browser exits through the same pool IP.

If a specific proxy ID starts failing mid-workflow, call foura_proxy again with ignoreProxies:["<failed_id>"] to get a fresh one.

适用场景:抓取会话状态与 IP 绑定的页面、在渲染后获取 CSS/JS 子资源、对网站在特定国家/地区的行为进行 A/B 测试,或任何需要可预测出口的多次调用流程。

7. WAF 挑战链(第一梯队:Vercel / Cloudflare / Akamai)

针对处于第一梯队 WAF 挑战(Vercel Security Checkpoint、Cloudflare 'Just a moment'、Akamai Bot Manager)保护下的网站的经典模式。直接对这些目标调用 foura_browser 通常只会捕获挑战页面,而不是通过挑战后的内容,因为快照在挑战的延迟重新加载完成之前就触发了。请先通过 foura_proxy 解决(它通过尝试多个出口 IP 直到通过来清除挑战),然后将返回的 proxy ID 链入 foura_browser

手动 prompt:

Step 1 — find an exit IP that clears the challenge:
  foura_proxy({
    maxTries: 30,               // tier-1 WAFs typically need this range
    request: { method: "GET", url: "<TARGET_URL>", unblocker: true }
  })
On success the response carries `proxy: "<BASE36_ID>"`. Capture it.

Step 2 — render the post-challenge page through the same IP:
  foura_browser({
    url: "<TARGET_URL>",
    proxy: "<BASE36_ID>"        // reuse the cleared exit
  })

If foura_proxy still fails after 30 attempts with the same block,
the gate is likely a country / ASN allowlist (country-licensed
bookmakers, government sites). Rotation will never help — pivot
strategy (different data source, partner agreement, etc.).

应当使用此配方的触发条件:

  • foura_single 返回状态码 429,且 header 为 x-vercel-mitigated: challengecf-mitigated: challenge
  • Body 标题匹配 Vercel Security Checkpoint / Just a moment / Attention Required / We're verifying your browser
  • foura_browser 直接捕获了微小的挑战 HTML,而不是真实内容

适用场景:托管在 Vercel/Netlify 并处于 Vercel WAF 保护下的 SPA(如 iqair.com 和许多 React 渲染的营销网站)、处于攻击模式期间受 Cloudflare 保护的商店、受 Akamai 保护的高流量零售网站。

适用于所有七种配方的提示

  • 从 foura_single 开始。 它是最快的工具(200ms 到 2s),适用于大多数公开网站。遇到 403/captcha 时升级到 foura_proxy,在缺少 JavaScript 内容时升级到 foura_browser。
  • unblocker:true 成本极低。 在传输层添加真实的浏览器 header,使那些通过 User-Agent 或 accept-encoding 嗅探进行拦截的网站允许您的 request 通过。
  • 验证规则可减少重试。 设置 validate.data.fail:["captcha", "blocked"],以便将明显被拦截的 response 视为失败并触发重试/proxy 升级,而不是将其解析为成功。
  • 大 body 默认内联 (v0.2.0+)。 在任何工具调用中传递 offload_large: true,以切换到 resource_link + resources/read,从而在大页面上节省 token(仅在支持 resources/read 的客户端中有效,Claude Desktop 目前不支持)。

想要这里没有的配方?

请发送电子邮件至 support@foura.ai 并说明您的使用场景。MCP server 发布新 prompt 的节奏与 REST API 版本发布保持一致。

更新于: 2026年7月1日