CrawlForge
首页Playground应用场景集成价格文档博客
如何在 Cursor 规则中使用 CrawlForge
Tutorials
返回博客
教程

如何在 Cursor 规则中使用 CrawlForge

C
CrawlForge Team
工程团队
2026年4月20日
阅读时长 7 分钟

本页内容

当你明确教会 Cursor 如何使用你的工具时,它会变得有用得多。一个 .cursorrules 文件会告诉 Cursor 在哪种任务下挑选哪个 CrawlForge 工具、如何优化 credit 用量,以及 scraping 时该遵循哪些模式。

本指南为你提供面向生产可用的 CrawlForge Cursor 规则,并附上每条规则背后的考量,方便你把它们调整到自己的工作流中。

目录

  • 什么是 Cursor 规则?
  • 前置条件
  • 步骤 1:把 CrawlForge 配置为 MCP server
  • 步骤 2:创建你的 .cursorrules 文件
  • 步骤 3:网页研究规则
  • 步骤 4:数据提取规则
  • 步骤 5:credits 优化规则
  • 步骤 6:进阶工作流规则
  • 完整的 .cursorrules 模板
  • credits 成本参考
  • 下一步

什么是 Cursor 规则?

Cursor 规则是项目级的指令,用来告诉 Cursor AI 助手该如何行事。它们位于项目根目录下的 .cursorrules 文件中(或作为单独文件放在 .cursor/rules/ 里)。Cursor 处理任何请求时,会把这些规则作为系统级上下文读取。

没有规则时,Cursor 仍会使用 CrawlForge 工具,但会做出次优选择——比如在 fetch_url(1 credit)就足够的情况下使用 deep_research(10 credits)。规则通过把你的工具选择逻辑直接编码进去来解决这一点。

前置条件

  • 已安装 Cursor(v0.45+)
  • 已安装 CrawlForge MCP server:npm install -g crawlforge-mcp-server
  • 一个 CrawlForge API key(免费套餐:1,000 credits)

步骤 1:把 CrawlForge 配置为 MCP server

把 CrawlForge 加入你的 Cursor MCP 设置。打开 Cursor Settings > MCP Servers 并添加:

Json
{
  "mcpServers": {
    "crawlforge": {
      "command": "crawlforge-mcp-server",
      "env": {
        "CRAWLFORGE_API_KEY": "cf_live_your_key_here"
      }
    }
  }
}

重启 Cursor。你应当能在可用的 MCP tools 列表中看到 CrawlForge,且全部 26 个工具均可访问。

步骤 2:创建你的 .cursorrules 文件

在你的项目根目录创建 .cursorrules:

Typescript
// File: .cursorrules
// This file teaches Cursor how to use CrawlForge tools effectively.

// === CrawlForge MCP Tool Selection ===
// Always use the cheapest CrawlForge tool that accomplishes the task.
// Credit costs: fetch_url(1), extract_text(1), extract_links(1),
// extract_metadata(1), scrape_structured(2), extract_content(2),
// map_site(2), process_document(2), localization(2),
// track_changes(3), analyze_content(3),
// summarize_content(4), crawl_deep(4),
// search_web(5), batch_scrape(5),
// scrape_with_actions(5), stealth_mode(5), deep_research(10)

现在我们来逐一充实每一类规则。

步骤 3:网页研究规则

这些规则教会 Cursor 何时进行网页搜索、何时直接获取一个已知 URL:

Markdown
## Web Research with CrawlForge

When I ask you to research a topic or find information online:

1. If I provide a specific URL, use `fetch_url` (1 credit) or `extract_content` (2 credits) -- NEVER use `search_web` for known URLs.
2. If I ask a general question requiring web search, use `search_web` (5 credits) with a focused query.
3. Only use `deep_research` (10 credits) when I explicitly ask for comprehensive multi-source research or when the topic requires cross-referencing multiple sources.
4. After fetching content, use `summarize_content` (2 credits) only if the content exceeds 2,000 words and I need a summary. Do not summarize short pages.

### URL-Known Pattern (1-2 credits)
- "Fetch the Stripe API docs" -> extract_content("https://docs.stripe.com/api")
- "What does this page say?" -> fetch_url(provided_url)

### Search Pattern (5 credits)
- "Find the best TypeScript testing frameworks" -> search_web("best TypeScript testing frameworks 2026")
- "What are competitors charging?" -> search_web("web scraping API pricing comparison")

### Deep Research Pattern (10 credits)
- "Do a comprehensive analysis of MCP adoption" -> deep_research("MCP protocol adoption trends")

步骤 4:数据提取规则

根据用户所需选择正确提取工具的规则:

Markdown
## Data Extraction with CrawlForge

When I ask you to extract data from websites:

1. For plain text content: use `extract_text` (1 credit)
2. For links/navigation: use `extract_links` (1 credit)
3. For page title, description, OG tags: use `extract_metadata` (1 credit)
4. For article content with readability: use `extract_content` (2 credits)
5. For specific elements via CSS selectors: use `scrape_structured` (2 credits)
6. For JavaScript-rendered pages or interactions: use `scrape_with_actions` (5 credits)
7. For anti-bot protected sites: try `fetch_url` first, then `stealth_mode` (5 credits) only if blocked

### Batch Operations
When I need data from 3+ URLs, always use `batch_scrape` (5 credits) instead of calling individual tools in a loop. batch_scrape handles concurrency and is more credit-efficient for bulk operations.

### CSS Selector Examples
When using scrape_structured, provide precise selectors:
- Product prices: `scrape_structured(url, {selectors: {price: ".price", name: "h1.product-title"}})`
- Article lists: `scrape_structured(url, {selectors: {titles: "article h2", links: "article a[href]"}})`

步骤 5:credits 优化规则

这些规则可避免 Cursor 不必要地消耗 credits:

Markdown
## Credit Optimization Rules

1. NEVER call the same URL twice in one conversation. Cache the result and reference it.
2. Prefer 1-credit tools over 5-credit tools. The decision tree:
   - Do I know the URL? -> fetch_url (1cr) NOT search_web (5cr)
   - Do I need clean text? -> extract_text (1cr) NOT extract_content (2cr)
   - Can I parse HTML locally? -> fetch_url (1cr) then parse the response
3. Before using scrape_with_actions, try fetch_url first. Many "JavaScript-rendered" pages actually serve content in the initial HTML.
4. Combine operations: fetch_url + local parsing is always cheaper than multiple specialized tool calls.
5. When asked about current credit balance, remind the user to check their dashboard at crawlforge.dev/dashboard.

步骤 6:进阶工作流规则

面向复杂的多步骤 scraping 流程的规则:

Markdown
## Multi-Step Workflows

### Competitive Analysis Workflow
When asked to analyze competitors:
1. search_web to find competitor URLs (5 credits)
2. batch_scrape their pricing/feature pages (5 credits)
3. Present structured comparison table -- do NOT use deep_research unless explicitly asked

### Documentation Indexing Workflow
When asked to index documentation:
1. map_site to discover all doc pages (3 credits)
2. batch_scrape the discovered URLs (5 credits)
3. Store extracted content locally for RAG

### Content Monitoring Workflow
When asked to track website changes:
1. extract_content to capture current state (2 credits)
2. Store baseline locally
3. On subsequent checks, extract_content again and diff against baseline

### Site Audit Workflow
When asked to audit a website:
1. map_site for structure (3 credits)
2. extract_metadata on key pages for SEO data (1 credit each)
3. analyze_content on main pages for quality assessment (3 credits each)

完整的 .cursorrules 模板

下面是完整的、可直接复制粘贴的模板,它整合了上面所有规则:

Markdown
# CrawlForge MCP Integration Rules

## Tool Selection Priority (cheapest first)
Always select the lowest-cost CrawlForge tool that accomplishes the task:
- 1 credit: fetch_url, extract_text, extract_links, extract_metadata
- 2 credits: scrape_structured, extract_content, map_site, process_document, localization
- 3 credits: track_changes, analyze_content
- 4 credits: summarize_content, crawl_deep
- 5 credits: search_web, batch_scrape, scrape_with_actions, stealth_mode
- 10 credits: deep_research (use ONLY when explicitly requested)

## Core Rules
1. Known URL -> fetch_url (1cr). NEVER search_web for a known URL.
2. 3+ URLs -> batch_scrape (5cr). NEVER loop individual calls.
3. Try fetch_url before scrape_with_actions. Most pages work without JS rendering.
4. Cache all results. Never fetch the same URL twice per conversation.
5. Only use deep_research when user explicitly asks for multi-source research.

## Output Formatting
- Present scraped data in markdown tables when comparing items
- Include source URLs as references
- Flag any pages that returned errors or empty content

credits 成本参考

Credits工具典型用例
1fetch_url, extract_text, extract_links, extract_metadata快速获取页面、发现链接
2scrape_structured, extract_content, map_site, process_document, localization提取特定数据、映射站点、处理文档
3track_changes, analyze_content跟踪变化、分析内容
4summarize_content, crawl_deep摘要、多页爬取
5search_web, batch_scrape, scrape_with_actions, stealth_mode网页搜索、批量操作、浏览器自动化
10deep_research详尽的多源分析

下一步

  • CrawlForge 快速上手 -- 60 秒安装 CrawlForge
  • 构建一个研究助手 -- 用 Claude 完成的完整项目教程
  • 26 个工具参考 -- 完整的工具文档
  • GitHub 上的 awesome-cursorrules -- 社区维护的 Cursor 规则合集

开始更聪明地 scraping。 免费注册即可获得 1,000 个 credits,安装 CrawlForge,把这些规则放进你的 .cursorrules 文件。你的 Cursor AI 每次都会选对工具。

亲自试一试——无需注册

在 Playground 中运行 CrawlForge 的 27 个抓取与提取工具中的任意一个,然后免费开始,获取 1,000 credits。

1,000 免费 credits • 每月补充 • 无需信用卡

标签

cursorcursor-rulesmcpintegrationtutorialai-codingweb-scraping

关于作者

C

CrawlForge Team

工程团队

我们正在打造功能最全面的 Web 抓取 MCP server。我们开发的工具帮助开发者为 AI 应用提取、分析和转换 Web 数据。

及时获取最新洞察

将教程、产品更新与 Web 抓取技巧直接发送到你的收件箱。

拒绝垃圾邮件,随时可取消订阅。

付诸实践

在任意 URL 上测试 CrawlForge 的工具——免费,无需注册。

本页内容

相关文章

如何在 Cline(VS Code)中使用 CrawlForge
Tutorials

如何在 Cline(VS Code)中使用 CrawlForge

为 VS Code 中的 Cline 添加网页抓取能力。配置 CrawlForge MCP、获取实时数据,让你的 Cline AI 编程助手访问整个网络。

C
CrawlForge Team
|
4月11日
|
7 分钟
如何在 LangGraph 智能体中使用 CrawlForge
Tutorials

如何在 LangGraph 智能体中使用 CrawlForge

使用 LangGraph 和 CrawlForge 构建有状态的网页爬取智能体。本篇 TypeScript 指南涵盖图节点、状态管理以及条件化的爬取流程。

C
CrawlForge Team
|
4月24日
|
8 分钟
如何将 CrawlForge 与 Dify 工作流结合使用
Tutorials

如何将 CrawlForge 与 Dify 工作流结合使用

在 Dify 中将 CrawlForge 添加为自定义工具,让你的 LLM 应用工作流具备 web scraping 能力。附带工作流示例的无代码与 API 集成指南。

C
CrawlForge Team
|
4月22日
|
7 分钟

页脚

CrawlForge

面向 AI Agent 的企业级网页抓取。27 个专业 MCP 工具,专为构建智能系统的现代开发者而设计。

产品

  • 功能
  • Playground
  • 价格
  • 应用场景
  • 集成
  • 替代方案
  • 更新日志

资源

  • 快速上手
  • API 参考
  • 模板
  • 指南
  • 博客
  • 术语表
  • 常见问题
  • 网站地图

开发者

  • MCP 协议
  • Claude Desktop
  • Cursor IDE
  • LangChain
  • LlamaIndex

公司

  • 关于我们
  • 联系我们
  • 隐私政策
  • 服务条款
  • 可接受使用政策
  • Cookie

保持更新

获取新工具和新功能的最新动态。

基于 Next.js 和 MCP 协议构建

© 2025-2026 CrawlForge。保留所有权利。