scraper-health-mcp

scraper-health-mcp

Enables autonomous self-healing scraper fleet management for Bright Data Scraper Studio, with health checking, anomaly detection, and automated AI-driven scraper repair and approval.

Category
Visit Server

README

Scraper-Health-MCP

Autonomous Self-Healing Scraper Fleet Manager for Bright Data Scraper Studio

The first agent that closes Bright Data's self-healing loop end-to-end without a human in the middle โ€” turning the resume_automation_job endpoint the official demo couldn't find into a one-command "deploy and forget" scraper fleet.

Built for WeMakeDevs Into the Scrape-Verse hackathon (Aug 17โ€“23, 2026).

๐ŸŽฏ The Problem

Web scrapers break silently. When a target site renames a CSS class, moves a field, or redesigns a layout, traditional scrapers return empty/garbage rows with no alarm. The failure is discovered only when a human notices the data is wrong โ€” by which point downstream systems have been consuming bad data for hours or days.

โœ… The Solution

Scraper-Health-MCP is an autonomous AI agent that wraps Bright Data's Scraper Studio self-healing API into a fully automated loop:

  1. Monitor โ€” Runs scrapers on schedule and health-checks every result
  2. Detect โ€” Catches breakage via schema validation, null-field detection, and row-count anomaly detection (Sentinel-style statistical baselines)
  3. Heal โ€” Triggers Bright Data's AI self-healing (refactor_template)
  4. Auto-Approve โ€” Programmatically accepts the AI's proposed extraction diff via resume_automation_job (the step Bright Data's own demo couldn't do)
  5. Verify โ€” Re-scrapes and confirms health is restored
  6. Escalate โ€” If healing fails, regenerates the scraper from scratch

๐Ÿ”‘ The Technical Unlock

Bright Data's official self-healing demo repo (anil-bd/scraper-studio-self-healing-demo) explicitly states the public API "does not document an endpoint to approve programmatically" and exits with code 3 (awaiting approval) when the heal hits pending_answer, requiring manual UI approval.

The current docs DO expose POST /resume_automation_job with {message: true, auto_save: true} to accept the diff automatically. This means a fully autonomous, hands-off self-healing loop is now buildable โ€” and almost no competitor will have found this.

๐Ÿค– MCP Server

The agent exposes 5 MCP tools callable from Claude Code, Cursor, or any MCP-compatible AI agent:

Tool Description
create_scraper Create a new scraper from URL + description via Bright Data AI Flow
run_collector Trigger a collector and return results
health_check Run collector + check output health (schema, nulls, row-count anomaly)
self_heal Full autonomous loop: detect โ†’ heal โ†’ auto-approve โ†’ re-scrape โ†’ verify
verify Verify a healed collector has restored health

๐Ÿ—๏ธ Architecture

Register collector (ID + schema + required fields)
        โ”‚
        โ–ผ
  Schedule / trigger run  โ”€โ”€โ–บ  POST /dca/trigger
        โ”‚
        โ–ผ
  Health-check result  โ”€โ”€โ–บ  GET /dca/dataset  (schema drift? nulls? row-count anomaly?)
        โ”‚
   โ”œโ”€โ”€ healthy โ”€โ–บ log success, schedule next run
   โ””โ”€โ”€ broken  โ”€โ–บ TRIGGER SELF-HEAL
                    โ”‚
                    โ–ผ
          POST /refactor_template  (targeted heal prompt from the failed field)
                    โ”‚
                    โ–ผ
          Poll /refactor_template/progress
                    โ”‚
                    โ”œโ”€โ”€ status:"pending_answer" โ”€โ–บ POST /resume_automation_job
                    โ”‚                              {message:true, auto_save:true}   โ† the unlock
                    โ””โ”€โ”€ done/failed
                    โ”‚
                    โ–ผ
          Re-scrape + verify against baseline schema
                    โ”‚
                    โ”œโ”€โ”€ passes โ”€โ–บ log heal event, resume schedule
                    โ””โ”€โ”€ fails  โ”€โ–บ escalate: regenerate scraper from scratch (Workflow 1)
                                  + alert/notification

๐Ÿ› ๏ธ Tech Stack

Layer Tech
Scraper infra Bright Data Scraper Studio (CLI + AI Flow API)
Backend Python 3.12 + FastAPI
Agent interface MCP server (5 tools)
Anomaly detection In-package stats (mean/std row-count + schema validator)
Dashboard Jinja2 templates + dark-themed HTML/CSS/JS
Deploy Vercel serverless (free tier)
Repo github.com/0xConsole/scraper-health-mcp

๐Ÿš€ Setup

# Clone
git clone https://github.com/0xConsole/scraper-health-mcp.git
cd scraper-health-mcp

# Install
pip install -r requirements.txt

# Run (mock mode โ€” no API key needed)
python -m uvicorn app.main:app --reload

# Run (live mode โ€” with Bright Data API key)
export BRIGHTDATA_API_KEY="your-key-here"
python -m uvicorn app.main:app --reload

Open http://localhost:8000 to see the dashboard.

๐Ÿ“ก API Endpoints

Method Path Description
GET / Dashboard
GET /api/health Health check
GET /api/status Full orchestrator status
GET /api/tools List MCP tools
GET /api/mcp/manifest MCP server manifest
POST /api/create_scraper Create scraper (MCP tool 1)
POST /api/run_collector Run collector (MCP tool 2)
POST /api/health_check Health check (MCP tool 3)
POST /api/self_heal Self-heal loop (MCP tool 4)
POST /api/verify Verify heal (MCP tool 5)
POST /api/demo Full demo (break + heal cycle)
POST /api/trigger_breakage Simulate breakage + trigger heal

๐ŸŽช Demo

  1. Click "Run Full Demo" on the dashboard
  2. The agent health-checks all registered collectors
  3. Simulates a site change (breakage) on the first collector
  4. Detects the breakage via health check (null fields, row count anomaly)
  5. Triggers AI self-healing (refactor_template)
  6. Polls until the AI proposes a diff (pending_answer)
  7. Auto-approves the diff via resume_automation_job โ† the unlock
  8. Re-scrapes and verifies health is restored
  9. Logs the entire heal event in the timeline

๐Ÿ“Š What's Real vs Mocked

Component Status
MCP server (5 tools) โœ… Real โ€” fully functional
Health checker (schema, nulls, anomaly) โœ… Real โ€” Sentinel-style stats
Heal orchestrator (full loop) โœ… Real โ€” all states wired
Auto-approve (resume_automation_job) โœ… Real โ€” calls actual endpoint when API key set
Bright Data API calls ๐Ÿ”ง Mock mode (no key) / Real (with key)
Demo collectors โœ… 3 seeded (HN, e-commerce, docs)
Dashboard + heal timeline โœ… Real โ€” live data from orchestrator

๐Ÿ“ License

Apache 2.0

๐Ÿ”— Links

  • Live demo: https://scraper-health-mcp.vercel.app
  • GitHub: https://github.com/0xConsole/scraper-health-mcp
  • Hackathon: WeMakeDevs Into the Scrape-Verse (Aug 17โ€“23, 2026)
  • Bright Data Scraper Studio: https://brightdata.com/scraper-studio

Built by Sentinel Dev ยท Team: Xayaan Ibrahim (Individual)

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured