وصفات MCP

نماذج MCP

تسعة مطالبات جاهزة للنسخ يمكنك تشغيلها داخل أي عميل متوافق مع MCP (مثل Claude Desktop و Claude Code و Cursor و Windsurf و VS Code) بعد تثبيت خادم FourA MCP.

يستخدم كل نموذج foura_auto (الخيار الافتراضي الذكي) أو أداة واحدة أو أكثر من الأدوات منخفضة المستوى foura_single و foura_proxy و foura_browser لمهمة كشط شائعة. طريقتان للاستخدام:

  1. استدعاء المطالبة المضمنة، يتيح كل عميل MCP المطالبات المقدمة من الخادم كأمر شرطة مائلة أو لوحة /prompts. اختر المطالبة، واملأ المعاملات، وشغلها. يُرجع خادم MCP سير العمل النموذجي؛ وينفذه LLM باستخدام الأدوات المناسبة.
  2. نسخ النص أدناه في المحادثة الخاصة بك. نفس النتيجة، ولكن باكتشاف أقل سهولة.

يوفر خادم MCP هذه المطالبات كمطالبات أصلية: smart_fetch، scrape_product_page، extract_article، monitor_pricing، check_endpoint_health، bulk_fetch_urls.

ملاحظة حول الصفحات الكبيرة (الإصدار 0.2.0 فما فوق): بشكل افتراضي، ترجع نصوص الاستجابة مضمنة داخل structuredContent بغض النظر عن الحجم، ويعمل هذا في كل عميل MCP بما في ذلك Claude Desktop. إذا كنت تستخدم عميلا يدعم MCP resources/read وتريد توفير رموز الـ token في الصفحات الكبيرة، مرر offload_large: true في استدعاء الأداة. ترجع الاستجابات التي تبلغ 50 كيلوبايت أو أكثر كـ resource_link يجلبه عميلك عند الطلب. تفترض المطالبات المضمنة أدناه السلوك الافتراضي (المضمن).

مفتوح المصدر على GitHub؛ ومتاح على npm باسم @fouradata/mcp.

الجلب الذكي (تلقائي): ابدأ من هنا

أبسط نموذج: مرر رابط URL إلى foura_auto ودعه يقوم بمحاولات محدودة عبر طرق الطلب المتاحة. استخدمه كلما أردت الحصول على المحتوى دون الحاجة لاختيار الأداة الأولى بنفسك.

مضمن: 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)

المطالبة اليدوية:

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": "..."}

حالات الاستخدام المناسبة: وكيل مقارنة الأسعار، أو أداة تنبيه بتوفر المنتجات في المخزون، أو جدول بيانات للتحليل التنافسي.

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?)

الموجه اليدوي (Manual 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"}

حالات الاستخدام المناسبة: وكيل تنبيهات التوفير، مراقب أسعار السفر، وأداة تتبع أسعار المنافسين في قطاع B2B.

4. التحقق من صحة الـ endpoint

لفحوصات وقت التشغيل (uptime probes) والتحقق من صحة API endpoint.

مدمج: check_endpoint_health(url, expected_text?)

الموجه اليدوي (manual 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}

متى يكون هذا هو الحل المناسب: مراقبة وقت التشغيل الخارجية، واختبار فحص النشر (deploy smoke test)، ومراقبة API لأطراف خارجية.

5. جلب قائمة من عناوين URL بالتوازي

للمهام المجمعة (batch jobs) عندما تحتاج إلى بيانات وصفية لعدة عناوين URL دون تضمين نصوص الاستجابة الخاصة بها.

مدمج: bulk_fetch_urls(urls)

الموجه اليدوي (Manual 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, 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.

حالات الاستخدام المناسبة: فحص إمكانية الوصول إلى خريطة الموقع (sitemap reachability)، وتدقيق الروابط المعطلة (link-rot audit)، والتحقق من نوع "أي من عناوين URL الخمسين لهذه المنتجات لا يزال موجودًا".

6. اختيار وإعادة استخدام نقطة خروج محددة بدولة

استخدم هذا الخيار عندما يجب أن يرى الهدف الـ request قادمًا من دولة ضمن مجموعة دول محددة، بما في ذلك صفحات JavaScript التي تتطلب تحديد الـ proxy قبل بدء الـ rendering في المتصفح.

الموجه اليدوي (Manual prompt):

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

استخدم محاولة proxy محددة بنطاق زمني مع التحقق من المحتوى عندما يُرجع الـ request المباشر صفحة حجب. إذا نجح الـ 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. محظور في صفحة ثابتة: قم بتغيير المتصفح الذي تقدمه

استخدم هذا عندما يُرجع هدف ثابت صفحة حظر أو اختبار أمني (challenge page) ولا تكون مشكلة JavaScript هي السبب. يقدم الـ request أحدث إصدار من Google Chrome افتراضيا؛ وتقبل بعض الأهداف متصفحا أو نظام تشغيل مختلفا.

الموجه اليدوي (Manual prompt):

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.

الحالات التي يناسبها هذا الحل: هدف يتم تصييره على الخادم ويقوم بالتصفية بناءً على العميل الذي يراه بدلاً من عنوان الخروج. تغيير المتصفح المعروض لا يكلف شيئاً إضافياً ويستحق التجربة قبل تدوير الـ proxy.

نصائح تنطبق على جميع الأدوات

  • غير متأكد من الأداة المناسبة؟ استخدم foura_auto. تختار هذه الأداة الطريقة المناسبة وتتولى التصعيد نيابة عنك. الجأ إلى أداة محددة فقط عندما تريد تحكماً صريحاً.
  • ابدأ بـ foura_single عندما يكون HTTP العادي كافياً. صعد إلى foura_proxy عندما يتم حظر الـ request المباشر، وإلى foura_browser عندما يتطلب المحتوى المطلوب تشغيل JavaScript.
  • ترويسات الـ request الشبيهة بالمتصفح مفعلة افتراضياً (unblocker). احتفظ بالتحقق من صحة المحتوى حتى لا تُعتبر صفحة الرفض نجاحاً، وقم بتغيير المتصفح المعروض عبر browser أو os أو version عندما يرفض الهدف الإعداد الافتراضي.
  • قواعد التحقق توفر محاولات إعادة الإرسال. اضبط validate.data.fail:["captcha", "blocked"] بحيث يُحتسب الـ response المحظور بوضوح كفشل ويطلق إعادة المحاولة أو تصعيد الـ proxy، بدلاً من تحليله على أنه نجاح.
  • نطاق الدولة صارم. نتيجة no_eligible_proxy لا تعني الإذن بإعادة المحاولة بدون exitCountries. حافظ على المتطلب أو اسأل المستخدم قبل تغييره.
  • الأجسام الكبيرة تكون مضمنة افتراضياً (v0.2.0+). مرر offload_large: true للتبديل إلى resource_link + resources/read على العملاء الذين يدعمون هذه الإمكانيات.

هل تريد وصفة غير موجودة هنا؟

أرسل بريداً إلكترونياً إلى support@foura.ai مع توضيح حالة الاستخدام. يوفر خادم MCP موجهات جديدة بنفس وتيرة إصدارات REST API.

آخر تحديث: 27 سبتمبر 2026