MCP 实战配方
安装 FourA MCP server 后,可在任何兼容 MCP 的客户端(Claude Desktop、Claude Code、Cursor、Windsurf、VS Code)中直接运行的 9 个即贴即用提示词。
每个配方使用 foura_auto(智能默认项)或一个/多个底层 foura_single、foura_proxy、foura_browser 来完成常见的抓取任务。两种使用方式:
- 调用内置提示词,每个 MCP 客户端都会将服务端提供的提示词显示为斜杠命令或
/prompts面板。选择提示词,填写参数,运行。MCP 服务端返回模板化工作流;LLM 使用对应工具执行。 - 复制下方文本到你自己的对话中。效果相同,但不够直观。
MCP 服务端原生提供以下提示词:smart_fetch、scrape_product_page、extract_article、monitor_pricing、check_endpoint_health、bulk_fetch_urls。
关于大页面的说明(v0.2.0+): 默认情况下,无论大小,response body 均在
structuredContent中内联返回,这适用于包括 Claude Desktop 在内的所有 MCP 客户端。如果你使用的客户端支持 MCPresources/read并且希望在大页面上节省 token,请在工具调用中传入offload_large: true。大于等于 50 KB 的响应将作为resource_link返回,供客户端按需获取。下方的内置提示词采用默认设置(内联)。
开源于 GitHub;发布于 npm,包名为 @fouradata/mcp。
智能获取(自动):从这里开始
最简单的配方:将 URL 传给 foura_auto,让其在可用的 request 方法中进行有界重试。只要你需要内容且无需自行选择首选工具,均可使用该方法。
内置:smart_fetch(url, must_contain?, extract?)
手动提示词:
Fetch <URL> using foura_auto.
Pass validate.data.accept:["<a string the real page must contain>"] so only the real page counts as success. Auto makes bounded attempts and returns an error if none satisfies the validation.
For a plain follow-up, call foura_single with session.proxy as proxy, session.cookies serialized as a Cookie header, and session.userAgent as a User-Agent header. For JavaScript, pass the session values to the matching foura_browser fields.
Return the content, or extract the requested fields as JSON.
适用场景:首次尝试且希望由 FourA 决定请求方案,尤其在通过内容验证即可区分真实页面与拦截页面时。
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)
手动提示词:
Fetch <URL> using foura_single with unblocker:true. Use plain HTTP first when the article is present in the server-rendered response.
If foura_single returns a 403, a verification 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 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. 检查 endpoint 健康状态
用于正常运行时间探测和 API endpoint 验证。
内置: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 (the total_time field is in seconds: multiply by 1000)
- 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 的元数据且无需内联其正文的批处理任务。
内置:bulk_fetch_urls(urls)
手动提示词:
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, a verification 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 选择的 JavaScript 页面。
手动提示词:
First call foura_proxy for the actual target:
{
"maxTries": 5,
"exitCountries": ["FR", "GB"],
"request": { "method": "GET", "url": "<TARGET_URL>" }
}
Treat exitCountries as a strict allowlist. On success, verify that exitCountry is FR or GB and capture the returned proxy ID.
If the page then needs JavaScript, call foura_browser with the returned proxy ID in foura_browser.proxy. Do not start a new proxy selection, because that may choose a different exit.
If foura_proxy returns no_eligible_proxy, preserve the requested country scope and retry later. Change or widen the list only after the user explicitly changes the requirement. Never retry silently without exitCountries.
适用场景:区域内容、授权市场、特定地域定价,或任何需要已验证的目标可见国家并随后复用所选出口的工作流。国家级定向包含在 Startup 及更高版本计划中;在其他计划中,foura_proxy 会返回 plan_limit_feature,重试无法解决此问题。
7. 受保护页面:优先使用 proxy,需要 JavaScript 时使用浏览器
当直接 request 返回拒绝页面时,使用带有内容验证的有界 proxy 尝试。如果验证的 response 成功,但所需内容仍需要 JavaScript,请在浏览器中复用该确切的 proxy ID。出现可见的防护服务商并不保证任何方法都能成功。
手动提示词:
Step 1 - call foura_proxy for <TARGET_URL>. Put a string unique to the real page in request.validate.data.accept. If the user supplied an allowed country list, pass it as exitCountries; do not guess country codes.
Step 2 - if the response passes validation and JavaScript is still required, call foura_browser with the returned proxy ID in the proxy field.
Do not call foura_proxy again after a successful selection, because the new call may choose a different exit. If the bounded attempt fails, report the failure honestly instead of claiming support for the target's protection vendor.
适用场景:受保护的目标站点中,HTTP 可以选择可用的出口,但最终内容需要 JavaScript 渲染。
8. 在静态页面被拦截:更改所呈现的浏览器特征
当静态目标返回拦截或质询页面,且问题不在于 JavaScript 时,请使用此方案。请求默认呈现最新的 Google Chrome;某些目标站点可能会接受其他浏览器或平台。
手动提示词:
Step 1 - call foura_single for <TARGET_URL> with request validation: put a string unique to the real page in validate.data.accept.
Step 2 - if the response is a refusal page, or defense comes back with solved false, call foura_single again with a different presented browser, for example {"browser": "Firefox"} or {"browser": "Chrome", "os": "Android"}. Keep the same validation.
If the tool answers that the combination does not exist, pick one from the list it returns. Do not retry the same impossible combination, and do not assume another browser was used instead: the request was refused, not substituted.
Step 3 - if changing the presented browser does not help, escalate to foura_proxy for a different exit, and to foura_browser only when the content genuinely needs JavaScript.
适用场景:目标网站采用服务端渲染,且根据识别到的客户端特征而非出口 IP 进行过滤。更改模拟的浏览器指纹无需额外成本,值得在轮换 proxy 之前尝试。
通用建议
- 不确定使用哪种工具?请使用 foura_auto。 它会自动选择方法并处理升级策略。仅在需要显式控制时才选用特定工具。
- 普通 HTTP 请求足够时,从
foura_single开始。 当直接请求被阻止时升级到foura_proxy,当所需内容依赖 JavaScript 时升级到foura_browser。 - 类浏览器请求 header 默认启用(
unblocker)。 请保留内容验证,以避免拦截页面被判定为成功;当目标拒绝默认设置时,使用browser、os或version更改模拟的浏览器。 - 验证规则可减少不必要的重试。 设置
validate.data.fail:["captcha", "blocked"],使明显被拦截的响应判定为失败并触发重试或 proxy 升级,而不是被解析为成功。 - 国家/地区限制是严格的。
no_eligible_proxy结果并不意味着可以在不带exitCountries的情况下重试;请保留该要求,或在更改前征得用户同意。 - 大型响应体默认内联返回(v0.2.0+)。 在支持相应功能的客户端上,传入
offload_large: true可切换为resource_link+resources/read。
需要未在此列出的方案?
请将具体用例发送邮件至 support@foura.ai。MCP 服务端发布新 prompt 的频率与 REST API 保持一致。