agentleFS
wrm3wrm3/ai_project_template/.cursor/rules/web_tools/web_tools.mdc

ai_project_template / web_tools

Cursor rule1 starsChanged 13 months agoMITView on GitHub

Comprehensive web interaction tools for search, scraping, browser automation, and screenshots. Use these rules when user requests involve: - Web search queries - Website scraping or content extraction - Browser automation workflows - Screenshot capture of web pages - Multi-page data collection - Website monitoring The fstrent_mcp_browser_use MCP server provides: Search: web_search, web_search_advanced Scraping: web_scrape, web_scrape_batch, web_extract_links, web_extract_text, web_extract_metadata Browser: browser_navigate, browser_click, browser_type, browser_extract, browser_execute_js, browser_wait, browser_screenshot Screenshots: screenshot_webpage, screenshot_element, screenshot_fullpage Use Static Scraping (web_scrape) when: - Simple HTML pages…

The file

We split this web_tools.mdc into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use these rules when user requests involve:

    line 9
  2. Very specific:

    Ensure fstrent_mcp_browser_use is in .mcp.json:

    line 124
  3. Distinctive:

    Remember: Always scrape ethically and legally.

    line 150

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
web_tools.mdc
# Web Tools - Cursor Rules

## Overview

Comprehensive web interaction tools for search, scraping, browser automation, and screenshots.

## When to Apply

Use these rules when user requests involve:
- Web search queries
- Website scraping or content extraction
- Browser automation workflows
- Screenshot capture of web pages
- Multi-page data collection
- Website monitoring

## MCP Tools Available

The `fstrent_mcp_browser_use` MCP server provides:

**Search:** `web_search`, `web_search_advanced`
**Scraping:** `web_scrape`, `web_scrape_batch`, `web_extract_links`, `web_extract_text`, `web_extract_metadata`
**Browser:** `browser_navigate`, `browser_click`, `browser_type`, `browser_extract`, `browser_execute_js`, `browser_wait`, `browser_screenshot`
**Screenshots:** `screenshot_webpage`, `screenshot_element`, `screenshot_fullpage`

## Tool Selection

**Use Static Scraping (`web_scrape`) when:**
- Simple HTML pages
- Fast extraction needed
- No JavaScript required

**Use Browser Automation (`browser_*`) when:**
- JavaScript-heavy sites
- SPAs (Single Page Applications)
- Requires interaction
- Dynamic content loading

**Use Concurrent Scraping (`web_scrape_batch`) when:**
- Multiple URLs (5+)
- Batch data collection
- Parallel processing needed

## Core Workflows

### Web Search
```
1. User provides search query
2. Use web_search(query)
3. Get structured results
4. Optionally scrape top results for details
5. Present findings
```

### Single Page Scraping
```
1. Validate URL
2. Choose method (static vs browser)
3. Extract content (text, links, metadata)
4. Clean and structure
5. Return result
```

### Multi-Page Scraping
```
1. Validate all URLs
2. Use web_scrape_batch:
   - max_concurrent: 5
   - timeout: 30
   - retry_max: 3
3. Process results
4. Handle failures
```

### Browser Automation
```
1. browser_navigate to URL
2. browser_wait for load
3. Interact (click, type, scroll)
4. Extract content
5. Capture screenshot if needed
```

## Ethical Guidelines

**Always:**
- ✅ Check robots.txt
- ✅ Respect rate limits (min 0.5s delay)
- ✅ Use appropriate user agent
- ✅ Cache results
- ✅ Be a good web citizen

**Never:**
- ❌ Scrape private/gated content
- ❌ Overwhelm servers
- ❌ Ignore robots.txt
- ❌ Scrape PII without permission

## Error Handling

**Network Errors:** Retry with exponential backoff (1s, 2s, 4s)
**HTTP 404:** Report not found
**HTTP 429:** Rate limited, slow down
**HTTP 500:** Server error, retry after delay
**Empty Content:** Try browser automation if static failed

## Configuration

```yaml
# Scraping
max_concurrent: 5
timeout: 30
retry_max: 3
rate_limit: 1.0

# Browser
headless: true
viewport: 1920x1080
timeout: 30000
```

## MCP Server Configuration

Ensure `fstrent_mcp_browser_use` is in `.mcp.json`:
```json
{
  "mcpServers": {
    "fstrent_mcp_browser_use": {
      "command": "uv",
      "args": [
        "--directory",
        "C:\\.ai\\mcps\\fstrent_mcp_browser_use",
        "run",
        "fstrent_mcp_browser_use"
      ]
    }
  }
}
```

## Reference

For detailed information, see Claude Code Skill:
- `.claude/skills/web-tools/SKILL.md`
- `.claude/skills/web-tools/rules.md`
- `.claude/skills/web-tools/reference/scraping_guide.md`

---

**Remember:** Always scrape ethically and legally. Respect website ToS, robots.txt, and rate limits.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.