Odel
PyreCrawl

PyreCrawl

Local
@sanggonboy1PythonMITUpdated 3 days ago

One tool for AI agents to scrape, crawl, extract, map, and search the web. Self-hosted, no API keys.

๐Ÿ”ฅ PyreCrawl โ€” Web Browsing Superpowers for Your AI Agent

License: MIT MCP Python 3.10+ PyPI

One command gives any AI agent the whole web. Scrape, extract, crawl, map, and search โ€” self-hosted, no API keys, no rate limits, no subscription.

PyreCrawl speaks MCP (Model Context Protocol), the standard tool interface for Claude, Cursor, VS Code, Codex, OpenCode, Hermes, and any MCP-compatible agent.

A smart auto-fallback ladder always picks the cheapest method that succeeds:

fast HTTP
    โ”‚  (403/503/Cloudflare challenge or empty body)
    โ–ผ
stealth browser (real Chromium + Cloudflare solver)
    โ”‚  (still blocked, or the page needs full JS rendering)
    โ–ผ
deep processing (LLM-ready markdown, citations, structured extraction)

โšก Tools exposed

ToolWhat it does
scrape(url, prefer="auto")Single URL โ†’ LLM-ready markdown
extract(url, schema)Scrape + structured extraction (JsonCss schema)
map_site(root, include_pattern=None, limit=200)Enumerate all internal URLs
crawl(root, max_pages=5, prefer="auto")Multi-page crawl with auto-fallback per page
search(query, limit=10)Web search via DuckDuckGo HTML (no API key)
health()Versions + import sanity check

prefer options: "auto" (default ladder) ยท "fast" (HTTP only) ยท "stealth" (CF bypass) ยท "llm" (deep processing).


๐Ÿš€ Install & Use (one-liner)

1. Install

# Using uv (recommended โ€” fast, isolated, no venv needed)
uv tool install pyrecrawl

# Or pipx (alternative)
pipx install pyrecrawl

# Or pip into a venv
pip install pyrecrawl

2. One-time browser engines

pyrecrawl setup

This installs Chromium + stealth browser engines (~2 min, one-time).

3. Register with your AI agent

# Auto-detect installed agents and write their MCP configs
pyrecrawl install

# Or target specific agents
pyrecrawl install claude-desktop cursor

# Dry-run to preview what would change
pyrecrawl install --dry-run

Supported agents: claude-desktop, claude-code, cursor, vscode, codex, opencode, hermes.

4. Start chatting

After installing + registering, restart your agent (or start a new session). Then ask:

"Scrape https://example.com and summarize it."

The tools appear as mcp_pyrecrawl_scrape, mcp_pyrecrawl_extract, mcp_pyrecrawl_map_site, mcp_pyrecrawl_crawl, mcp_pyrecrawl_search, mcp_pyrecrawl_health.


๐Ÿ“š Manual config (if pyrecrawl install doesn't match your setup)

Claude Desktop

Config file

  • Linux: ~/.config/Claude/claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %AppData%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "pyrecrawl": {
      "command": "uvx",
      "args": ["--from", "pyrecrawl", "pyrecrawl", "serve"]
    }
  }
}

Claude Code

Config file: project-scoped .mcp.json

{
  "mcpServers": {
    "pyrecrawl": {
      "command": "uvx",
      "args": ["--from", "pyrecrawl", "pyrecrawl", "serve"]
    }
  }
}

Cursor

Config file: ~/.cursor/mcp.json

{
  "mcpServers": {
    "pyrecrawl": {
      "command": "uvx",
      "args": ["--from", "pyrecrawl", "pyrecrawl", "serve"]
    }
  }
}

VS Code / Copilot

Config file: .vscode/mcp.json (project-scoped)

{
  "servers": {
    "pyrecrawl": {
      "command": "uvx",
      "args": ["--from", "pyrecrawl", "pyrecrawl", "serve"],
      "type": "stdio"
    }
  }
}

Codex CLI

Config file: ~/.codex/config.toml

[mcp_servers.pyrecrawl]
command = "uvx"
args = ["--from", "pyrecrawl", "pyrecrawl", "serve"]

OpenCode

Config file: ~/.config/opencode/opencode.json

{
  "mcp": {
    "pyrecrawl": {
      "type": "local",
      "command": ["uvx", "--from", "pyrecrawl", "pyrecrawl", "serve"],
      "enabled": true
    }
  }
}

Hermes

Config file

  • Linux/macOS: ~/.hermes/config.yaml
  • Windows: %LocalAppData%\hermes\config.yaml
mcp_servers:
  pyrecrawl:
    command: uvx
    args:
      - --from
      - pyrecrawl
      - pyrecrawl
      - serve
    enabled: true

Windows note: uvx must be on PATH. If not, use the full path to uvx.exe (e.g. C:\Users\<you>\AppData\Local\hermes\bin\uvx.exe).


๐Ÿง  How the ladder chooses

PyreCrawl runs each request through three tiers, stopping at the first one that returns a complete, LLM-ready result:

ConcernFast tierStealth tierDeep tier
Static HTML pageโœ… ~200msโ€”โ€”
Cloudflare-protectedโŒโœ… Turnstile solverโ€”
JS-heavy SPAโŒโœ… real Chromiumโ€”
Live DOM data (input .value, JS state)โŒโœ… js paramโ€”
LLM-ready markdown + citationsโ€”โ€”โœ… BM25, fit-markdown
Structured extraction (CSS schema)โ€”โ€”โœ…
Deep crawl (BFS/DFS/BestFirst)โ€”โ€”โœ… adaptive

The agent never has to pick. prefer="auto" does it every call.

Live DOM data with js and wait_for

Some sites keep the data you want in a DOM property (e.g. an <input>'s .value) that JS writes after an XHR โ€” it never appears in the serialized HTML. The scrape tool accepts two stealth-tier params for exactly this:

{
  "url": "https://temp-mail.org/id",
  "prefer": "stealth",
  "wait_for": "document.getElementById('mail').value.includes('@')",
  "js": "document.getElementById('mail').value"
}
  • wait_for โ€” a JS predicate expression polled until truthy (bounded by timeout). Use it instead of guessing a sleep for anything that arrives asynchronously.
  • js โ€” a JS expression evaluated once the page settles; the value comes back in meta.js_result. Errors are captured in meta.js_error (the page result is still returned, never a crash).

๐Ÿ“Š Compared to Firecrawl (hosted)

FirecrawlPyreCrawl
CostFree 1k/mo, then $16โ€“333/moFree, self-hosted
Local LLM supportโŒโœ… Ollama / any LLM
Cloudflare bypassโœ… (Fire-Engine, paid)โœ… (free, built-in)
Markdown + BM25โœ…โœ…
Self-hostโŒโœ…
Hosted search APIโœ… /searchโš ๏ธ DuckDuckGo HTML (no key)

๐Ÿ”ง Development

git clone https://github.com/SanggonBoy/PyreCrawl.git
cd PyreCrawl
uv venv --python 3.12 .venv
source .venv/Scripts/activate  # Windows; or .venv/bin/activate on macOS/Linux
uv pip install -e ".[dev]"
python -m playwright install chromium
scrapling install

Run tests

python scripts/selfcheck.py   # real-network smoke test
python scripts/probe_stdio.py # stdio JSON-RPC probe

๐Ÿ“ฆ Publish

Maintainers only:

git tag v0.2.1
git push origin v0.2.1

GitHub Actions builds + uploads to PyPI via trusted publishing.


๐Ÿ“œ Uninstall

# Remove from all agent configs
pyrecrawl uninstall

# Remove the package
uv tool uninstall pyrecrawl

๐Ÿ›ก๏ธ License

MIT โ€” see LICENSE.

๐Ÿ™ Credits

Built on the shoulders of Scrapling and Crawl4AI โ€” both MIT, both excellent.