beast-scraper-mcp
by playxgaming
README.md
<p align="center"><img src="assets/hero-banner.png" alt="BeastScraper — The web. Structured. v0.3.0 by Sarvesh Sehra" width="100%"></p>
# BeastScraper
**A self-hosted web extraction and research toolkit by Sarvesh Sehra.** Turn webpages, product listings, academic papers and YouTube sources into structured data, Markdown and searchable local knowledge through one FastAPI application or a native MCP server.
[](pyproject.toml)
[](beast_scraper/main.py)
[](beast_scraper/engines/web_engine.py)
[](https://render.com/deploy?repo=https://github.com/playxgaming/BeastScraper)
[](https://github.com/playxgaming/BeastScraper/actions/workflows/ci.yml)
[](LICENSE)
[**Showcase & API playground ↗**](https://playxgaming.github.io/BeastScraper/) · [API reference](docs/API_REFERENCE.md) · [Publish & deploy guide](docs/DEPLOYMENT.md) · [License](LICENSE)
> **Source-available, personal-use licensed.** Free for local personal, non-commercial use under [LICENSE](LICENSE). Copyright (c) 2026 Sarvesh Sehra. This project is not licensed as unrestricted open source.
## What is built
| Capability | Implementation | API surface |
| --- | --- | --- |
| **HTTP-first extraction** | Pooled `curl_cffi` / `httpx`; automatic browser fallback for detected JavaScript-dependent pages; Markdown, text, HTML and structured JSON; scoped extraction, links and images | `GET/POST /scrape`, `POST /scrape/batch` |
| **Interactive browser scraping** | Lazy Chromium with bounded concurrent contexts; block images, fonts and media when not taking a screenshot; click, fill, scroll, wait, wait-for-selector and key-press actions; optional base64 PNG screenshots | `POST /scrape` with `actions` or `engine: "playwright"` |
| **Site discovery & crawling** | Sitemap and robots.txt discovery, sitemap-assisted BFS, depth/page limits, domain filtering, include/exclude patterns and bounded concurrency | `GET /sitemap`, `POST /crawl` |
| **Product research & history** | Schema.org JSON-LD including `@graph` and `AggregateOffer`, OpenGraph/microdata fallbacks, cross-store research, SQLite snapshots, history statistics and target-price flags; refresh on request | `/products/extract`, `/products/research`, `/products/history`, `/products/tracked`, `/products/refresh` |
| **Academic paper discovery** | Five providers: OpenAlex, arXiv, Semantic Scholar, Crossref and Europe PMC; OpenAlex citation/reference graphs; resolve DOI/arXiv/PDF URLs; `pymupdf4llm` PDF-to-Markdown, optional page chunks and BibTeX | `/papers/search`, `/papers/citations`, `GET/POST /papers/parse` |
| **YouTube collection** | Video/playlist metadata and search, chapter-aware captions/transcripts, top comments and channel Atom RSS feeds | `/youtube/info`, `/youtube/search`, `/youtube/transcript`, `/youtube/comments`, `/youtube/channel` |
| **Multi-source deep research** | Concurrent web, paper and video gathering; source excerpts and optional transcripts; linked Markdown briefing and optional source indexing | `POST /research/deep` |
| **Public-source intelligence** | GitHub repository lookup/search, Hacker News feeds/search, Wikipedia summaries and Open Library book search | `/intel/github`, `/intel/hackernews`, `/intel/wiki`, `/intel/books` |
| **Search & local knowledge** | Optional local SearXNG with `ddgs` fallback; two-tier memory LRU + SQLite TTL response cache on selected REST routes; SQLite FTS5 keyword retrieval | `/search`, `/knowledge/*` |
| **Operations & integrations** | Configured proxy pools/geo-routing, per-domain web rate limiting, bounded in-process async jobs with SQLite results and best-effort completion webhooks, metrics, API-key auth and configurable CORS | `/jobs`, `/jobs/{job_id}`, `/admin/*`, `/health` |
| **Studio & MCP tools** | Browser Studio plus local stdio `MCPServer` tools for scraping, crawling, products, papers, YouTube, research, GitHub/HN and knowledge search | `/`, `/docs`, `beast-scraper-mcp` |
The research synthesizer is **extractive**: it assembles source excerpts and metadata without an LLM. Price targets are flags evaluated on snapshots; there is no built-in scheduled watcher or price-drop notification service. FTS5 is keyword search, not vector search. The [roadmap](docs/ROADMAP.md) contains future ideas, not shipped features.
## Architecture
```mermaid
flowchart TD
Studio[Built-in Studio / HTTP clients] --> API[FastAPI REST API]
Pages[GitHub Pages showcase + tester] -->|HTTPS + CORS + optional X-API-Key| API
AI[Local AI assistant] -->|stdio| MCP[Native MCPServer]
API --> REST[REST: auth, selected-route cache, jobs]
REST --> Engines[Shared engines]
MCP --> Engines
Engines --> Web[HTTP: curl_cffi / httpx]
Web -->|JS fallback or explicit request| Browser[Bounded Playwright + actions]
Web --> Extract[Trafilatura / BeautifulSoup / Markdown]
Browser --> Extract
Engines --> Crawl[Sitemap discovery + BFS crawl]
Crawl --> Web
Engines --> Products[Product research + price snapshots]
Products --> Web
Engines --> Papers[5 paper providers + citations + PDF Markdown]
Engines --> YouTube[Metadata + transcripts + comments + Atom]
Engines --> Intel[Deep research + GitHub / HN / Wiki / Books]
Intel --> Web
Intel --> Papers
Intel --> YouTube
Engines --> Search[SearXNG or ddgs]
Engines --> DB[(SQLite: FTS5 knowledge + price history)]
REST --> Cache[Memory LRU + SQLite TTL cache]
REST --> Jobs[Async tasks + SQLite job records + webhooks]
```

MCP calls engines directly and runs separately over stdio. It is not an HTTP endpoint on Render. The REST response cache and job API do not wrap MCP calls.
## How it compares
A capability/scope comparison, **not a performance benchmark or a claim of feature parity**. Commercial entries refer to their documented hosted products; features and plans can change.
| Dimension | BeastScraper v0.3.0 | Firecrawl Cloud | ScrapingBee HTML API |
| --- | --- | --- | --- |
| Web extraction | Local HTTP/browser pipeline; Markdown, HTML, text, JSON | Hosted scrape/crawl and structured outputs | Hosted HTML/structured extraction |
| JavaScript & interactions | Your bounded Playwright pool and browser actions | Managed browser capabilities | Managed JS rendering and scenarios |
| Site crawling | Sitemap-assisted BFS with explicit bounds | Documented sitemap-aware crawl | Caller can orchestrate page requests |
| Proxy infrastructure | Bring your own pool/provider; geo-routing when configured | Managed hosted infrastructure | Managed proxy options |
| MCP integration | Native local stdio server | Documented MCP integration | Documented remote MCP |
| Project-specific workflows | SQLite price history, five-source paper search, citations, PDF Markdown, transcripts and FTS5 in this codebase | Domain-workflow parity not evaluated | Domain-workflow parity not evaluated |
| Deployment responsibility | You operate compute, storage and upstream access | Provider operates hosted API | Provider operates hosted API |
| License / usage | Restricted personal-use source license; hosting/proxies can cost money | Provider's service terms | Provider's service terms |
Sources: [Firecrawl repository and Cloud/Local scope](https://github.com/firecrawl/firecrawl), [Firecrawl crawl](https://www.firecrawl.dev/crawl), [ScrapingBee HTML API](https://www.scrapingbee.com/documentation/), [ScrapingBee remote MCP](https://www.scrapingbee.com/documentation/remote-mcp/). Compared on 2026-11-28; no throughput, success-rate or cost benchmarks have been run for this repository.
## Quickstart
### Local Python
Python **3.11+** is required; CI covers 3.11–3.13. From a checkout:
```bash
python -m venv .venv
source .venv/bin/activate
python -m pip install -e ".[dev]"
python -m playwright install chromium
cp .env.example .env
beast-scraper
```
On **Windows PowerShell**, use `.\.venv\Scripts\Activate.ps1` and `Copy-Item .env.example .env` in place of `source` and `cp`. On a Linux host without browser libraries, use `python -m playwright install --with-deps chromium`.
Open [Studio](http://127.0.0.1:8000/), [interactive OpenAPI docs](http://127.0.0.1:8000/docs) or [health](http://127.0.0.1:8000/health). The sample environment leaves `API_KEY` empty for local use. Set it before exposing a service; authenticated requests should use `X-API-Key`.
### Docker + optional local search
```bash
cp .env.example .env
docker compose up --build -d
```
Compose starts the API at `http://localhost:8000` and SearXNG at `http://localhost:8888`; it mounts `./data` for SQLite storage. The standalone Render Blueprint deploys the API only and uses `ddgs` unless you configure a reachable `SEARXNG_URL`.
### curl
These are **Bash/POSIX-shell** examples. Replace host/key for Render; omit the header for unauthenticated local use. PowerShell equivalents are in the [deployment guide](docs/DEPLOYMENT.md).
```bash
curl https://YOUR-SERVICE.onrender.com/health
curl -X POST https://YOUR-SERVICE.onrender.com/scrape \
-H 'Content-Type: application/json' -H 'X-API-Key: YOUR_API_KEY' \
-d '{"url":"https://example.com","format":"markdown"}'
curl -G https://YOUR-SERVICE.onrender.com/products/research \
-H 'X-API-Key: YOUR_API_KEY' \
--data-urlencode 'query=Sony WH-1000XM5' --data 'scrape_top=2' --data 'track=false'
curl -G https://YOUR-SERVICE.onrender.com/papers/search \
-H 'X-API-Key: YOUR_API_KEY' \
--data-urlencode 'query=retrieval augmented generation' --data 'limit=5'
curl -X POST https://YOUR-SERVICE.onrender.com/research/deep \
-H 'Content-Type: application/json' -H 'X-API-Key: YOUR_API_KEY' \
-d '{"topic":"retrieval augmented generation","web_results":3,"scrape_top":1,"paper_limit":2,"youtube_limit":0,"auto_index":false}'
```
Interactive browser actions are available on **POST** `/scrape`:
```json
{
"url": "https://YOUR-AUTHORIZED-TARGET.example/search",
"engine": "playwright",
"format": "markdown",
"actions": [
{"type": "fill", "selector": "input[name=q]", "value": "research"},
{"type": "press", "selector": "input[name=q]", "value": "Enter"},
{"type": "wait_for", "selector": "main"}
]
}
```
Selectors must match your target. This is an illustrative request shape, not a preconfigured integration.
### Python client
```python
import os
import httpx
base = os.getenv("BEAST_API_URL", "http://127.0.0.1:8000")
key = os.getenv("BEAST_API_KEY", "")
headers = {"X-API-Key": key} if key else {}
with httpx.Client(base_url=base, headers=headers, timeout=120) as client:
response = client.post("/scrape", json={
"url": "https://example.com", "format": "markdown", "auto_index": True,
})
response.raise_for_status()
print(response.json()["content"])
```
### Native MCP
After installing the package and Chromium, launch `beast-scraper-mcp`. In a client supporting `mcpServers` stdio configuration, use your virtualenv's **absolute executable path**:
```json
{
"mcpServers": {
"beastscraper": {
"command": "/ABSOLUTE/PATH/TO/BeastScraper/.venv/bin/beast-scraper-mcp",
"env": {
"KNOWLEDGE_DB_PATH": "/ABSOLUTE/PATH/TO/BeastScraper/data/knowledge.db",
"PRICES_DB_PATH": "/ABSOLUTE/PATH/TO/BeastScraper/data/prices.db"
}
}
}
}
```
On Windows, point to `.venv/Scripts/beast-scraper-mcp.exe` using an absolute path (forward slashes work in JSON). Ask the assistant to use `scrape_url`, `crawl_site`, `research_product`, `search_papers`, `paper_citations`, `deep_research` or `knowledge_search`. Client formats vary; the local stdio process does not require the REST API to run.
## Studio

The existing Studio groups scraping, price research, deep research/intel, crawling, search, papers, YouTube, knowledge and operations. The screenshot shows local empty-database telemetry, not a production benchmark. [Asset sources and regeneration](assets/README.md).
## Deploy to Render
[](https://render.com/deploy?repo=https://github.com/playxgaming/BeastScraper)
1. Open [Render Dashboard](https://dashboard.render.com/), select **New → Blueprint**, and connect `playxgaming/BeastScraper` on `main`.
2. Use repository-root **`render.yaml`**. It builds the root Dockerfile, binds `0.0.0.0` with Render's dynamic `$PORT`, checks `/health`, and generates `API_KEY`.
3. After deployment, copy the service's actual **Public URL**. Test `/health`, then enter that URL and your key in the [Pages playground](https://playxgaming.github.io/BeastScraper/).
4. Set `CORS_ORIGINS=https://playxgaming.github.io` to restrict browser access to the showcase origin. Origins have no repository path. CORS does not replace authentication.
The default Blueprint uses a free instance with **ephemeral SQLite storage**. Data can disappear on restarts, redeploys or spin-down; free instances cannot attach disks. For durable knowledge, jobs, history and cache, select a paid instance and mount a disk at **`/app/data`**, keeping one API instance. Browser/PDF workloads may need more memory than a free service provides. See [Render free-instance limits](https://render.com/docs/free), [persistent disks](https://render.com/docs/disks), and the exact [publish steps](docs/DEPLOYMENT.md), including a disk-enabled YAML example.
Public owner hosting is an author-authorized showcase. Other users must follow the license, including its public multi-tenant hosting restrictions.
## GitHub Pages showcase
`docs-site/` is a buildless HTML/CSS/JavaScript site. `.github/workflows/pages.yml` uploads **only `docs-site/`** using the official Pages actions. Enable **Settings → Pages → Source: GitHub Actions**, then run the workflow or push a change to `docs-site/` on `main`.
The playground uses direct browser `fetch` for the five requested endpoints. It saves only the service origin; the optional key stays in memory and curl exports redact it. Keys authorize backend admin operations too: do not publish your owner key or offer it as a public demo key. The landing page is public; the backend remains keyed.
Preview with `python -m http.server 8080` from the root; visit `http://localhost:8080/docs-site/`.
## Configuration & operating limits
| Setting | Default / use |
| --- | --- |
| `API_KEY` | Empty locally; generated on Render. Protects most API routes, including admin. `/health`, `/` and `/docs` remain public. |
| `CORS_ORIGINS` | `*` or comma-separated browser origins. |
| `MAX_BROWSER_CONTEXTS` | 4 locally; 1 in the Blueprint. Limits browser contexts, not total API concurrency. |
| `MAX_CRAWL_PAGES` | REST crawl hard cap of 25 by default. |
| `CACHE_DB_PATH`, `KNOWLEDGE_DB_PATH`, `JOBS_DB_PATH`, `PRICES_DB_PATH` | Files under `data/`; Docker's work directory makes this `/app/data`. |
| `SEARXNG_URL` | Optional reachable SearXNG origin; empty uses `ddgs`. |
| `PROXIES`, `PROXY_TEMPLATE`, `PROXY_FILE` | Your proxy configuration; no subscription is bundled. |
| `GITHUB_TOKEN` | Optional for GitHub API access/rate limits. |
| `ALLOW_PRIVATE_URLS` | `false`. Keep disabled on hosted deployments. |
Full configuration: [.env.example](.env.example) and [Settings](beast_scraper/config.py). Optional Crawl4AI/Scrapling adapters are declared in the `pro` extra; they are not in the default deployment or test guarantee.
External providers can throttle, change APIs, block cloud IPs or omit metadata. Paper discovery does not grant paywalled PDF access; transcripts require available captions. Jobs run in this API process, not a distributed or restart-resumable queue. Webhooks are best-effort. Current URL checks are not a complete network isolation boundary for arbitrary untrusted public users; keep the API keyed and use appropriate network controls if broadening access. Respect target permissions, terms and usage limits.
## Development
```bash
python -m pip install -e ".[dev]"
python -m pytest -v
```
The suite tests parsers, cache, FTS5, URL validation and REST/auth flows with mocked network calls. CI covers Python 3.11, 3.12 and 3.13. These checks do not certify live upstream reliability or browser throughput.
```text
beast_scraper/ FastAPI, schemas, client, native MCP server
engines/ Web, search, products, papers, YouTube, intel
core/ Cache, FTS5, jobs, proxies, metrics, rate limits
static/ Built-in Studio
assets/ Hero, architecture and actual Studio preview
docs-site/ GitHub Pages landing page + API tester
docs/ API reference, deployment guide, future roadmap
tests/ Offline core and mocked API tests
render.yaml Render Blueprint
Dockerfile Python + Chromium; dynamic PORT
```
## Authorship & license
**Copyright (c) 2026 Sarvesh Sehra. All Rights Reserved.**
Free permission is limited to local personal, non-commercial use under the full [BeastScraper Source-Available Personal Use License](LICENSE). Copying, forking, repackaging, claiming authorship or submitting the software in hackathons, competitions, bounties, coursework or evaluations is prohibited without prior written permission. Commercial redistribution, paid or public multi-tenant API/SaaS hosting, public redistribution of modified versions and re-licensing are prohibited without written permission. Preserve copyright and permission notices. The software is provided without warranty; the full license controls.