NEXT_PUBLIC_ variable.Install the service
Clone the public repository, create a Python environment and install the typed FastAPI plus FastMCP service.
python -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'Configure the collector
Point the server at the existing Scraper Studio collector. Live collection and Self-Healing consume provider credits, so monitoring remains opt-in.
APP_ENV=production
BRIGHTDATA_API_TOKEN=your_server_side_token
BRIGHTDATA_COLLECTOR_ID=c_msxcshnz2bwrroekf3
OPERATOR_API_TOKEN=use_a_long_private_valueDefine the data contract
Edit examples/contract.json with required fields, types, row limits, null thresholds and business rules. Then start the API and MCP server.
uvicorn app.api:app --port 8000
python -m app.serverThe included contract is already grounded in the production Books to Scrape output and its 12-row baseline.
Connect your coding agent
Add the local MCP server to Codex, Claude Code or Cursor. All agent actions use the same policy engine as the console.
{
"mcpServers": {
"scrapesentry": {
"command": "python",
"args": ["-m", "app.server"],
"cwd": "/absolute/path/to/scrapesentry",
"env": { "APP_ENV": "production" }
}
}
}Consume protected output
Downstream systems read the safe-output endpoint. If a scrape is quarantined, this endpoint keeps serving the last verified snapshot with its age and warning.
curl -H "Authorization: Bearer $OPERATOR_API_TOKEN" http://127.0.0.1:8000/api/collectors/books-to-scrape/safe-output