🔥 PyreCrawl — Self-Hosted Firecrawl Alternative as an MCP Server
A self-hosted Firecrawl alternative combining two best-in-class open-source scrapers behind a single Model Context Protocol (MCP) server:
- Scrapling — fast HTTP (curl_cffi) + stealth browser with Cloudflare Turnstile bypass, adaptive element tracking, and XHR capture
- Crawl4AI — LLM-first crawler: BM25 fit-markdown, citations, structured extraction, deep crawl (BFS/DFS/BestFirst)
A smart auto-fallback ladder tries the cheapest engine that succeeds:
fast HTTP (Scrapling)
│ (403/503/Cloudflare challenge or empty body)
▼
stealth browser (Scrapling StealthyFetcher + CF solver)
│ (still blocked or page needs full JS rendering)
▼
full LLM processing (Crawl4AI AsyncWebCrawler + BM25)
⚡ Tools exposed
| Tool | What 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" (full Crawl4AI).
🚀 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 Playwright Chromium + Scrapling 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)
| Agent | Config file | Entry |
|---|---|---|
| Claude Desktop | ~/.config/Claude/claude_desktop_config.json (Linux) / ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) / %AppData%\Claude\claude_desktop_config.json (Windows) |
{"mcpServers":{"pyrecrawl":{"command":"uvx","args":["--from","pyrecrawl","pyrecrawl","serve"]}}} |
| Claude Code | project-scoped .mcp.json |
same JSON as Claude Desktop |
| Cursor | ~/.cursor/mcp.json |
same JSON |
| VS Code / Copilot | .vscode/mcp.json (project) |
{"servers":{"pyrecrawl":{"command":"uvx","args":["--from","pyrecrawl","pyrecrawl","serve"],"type":"stdio"}}} |
| Codex CLI | ~/.codex/config.toml |
[mcp_servers.pyrecrawl]\ncommand = "uvx"\nargs = ["--from", "pyrecrawl", "pyrecrawl", "serve"] |
| OpenCode | ~/.config/opencode/opencode.json |
{"mcp":{"pyrecrawl":{"type":"local","command":["uvx","--from","pyrecrawl","pyrecrawl","serve"],"enabled":true}}} |
| Hermes | ~/.hermes/config.yaml or %LocalAppData%\hermes\config.yaml |
mcp_servers:\n pyrecrawl:\n command: uvx\n args:\n - --from\n - pyrecrawl\n - pyrecrawl\n - serve\n enabled: true |
Windows note:
uvxmust be on PATH. If not, use the full path touvx.exe(e.g.C:\Users\<you>\AppData\Local\hermes\bin\uvx.exe).
🧠 Why two engines?
| Concern | Scrapling | Crawl4AI |
|---|---|---|
| Static HTML page | ✅ curl_cffi, ~200ms | ✅ browser overhead, ~3s |
| Cloudflare-protected | ✅ Turnstile solver | ⚠️ requires stealth setup |
| JS-heavy SPA | ✅ Chromium real browser | ✅ same |
| LLM-ready markdown | ⚠️ basic | ✅ BM25 + citations + fit |
| Structured extraction (CSS schema) | ❌ | ✅ JsonCss strategy |
| Deep crawl (BFS/DFS/BestFirst) | ✅ Spider + AutoThrottle | ✅ BFS/DFS/BestFirst + adaptive |
| Adaptive element tracking | ✅ parser relocates moved elements | ❌ |
PyreCrawl = Scrapling for fetch & bypass + Crawl4AI for processing & extraction.
📊 Compared to Firecrawl (hosted)
| Firecrawl | PyreCrawl | |
|---|---|---|
| Cost | Free 1k/mo, then $16–333/mo | Free, self-hosted |
| Local LLM support | ❌ | ✅ Ollama / any LLM |
| Cloudflare bypass | ✅ (Fire-Engine, paid) | ✅ (free, Scrapling) |
| 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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyrecrawl-0.2.1.tar.gz.
File metadata
- Download URL: pyrecrawl-0.2.1.tar.gz
- Upload date:
- Size: 19.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94616f84bdf070b4259ddaa052797ccd659e539580fa2bc5246a3e69795e21a5
|
|
| MD5 |
fea819cf22a8233850ccba1141d17e68
|
|
| BLAKE2b-256 |
8ede739bd0b2f319a3a3cf8b0d17fff38a8a6348a063e5c1351bcc36279e1193
|
File details
Details for the file pyrecrawl-0.2.1-py3-none-any.whl.
File metadata
- Download URL: pyrecrawl-0.2.1-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34ed32ac2e987b7accf8b284cc817788332363639e62a0a66430abfc01ad3435
|
|
| MD5 |
fd023eddf9daaaa81173ee3141af7367
|
|
| BLAKE2b-256 |
50d8c3ec541edb3bf960da983b4b677eabc5a38b360f0b83ba730b861696c956
|