A simple CLI project that combines Bright Data’s Browser API (MCP) with OpenAI to scrape hotel listings and generate a 3-day travel itinerary using AI (which is just the example used, but you can use it for any scraping task).
This is not a full-featured travel planner — it's a real-world, minimal example that shows:
- How to bypass bot detection on modern websites using Bright Data's MCP
- How to extract structured data with Playwright
- How to use OpenAI to generate meaningful summaries or plans from scraped content
I made this for a video to show how to use MCP with OpenAI and Playwright.
- ✅ Scrapes hotel listings from Booking.com
- ✅ Bypasses CAPTCHAs and bot detection with Bright Data's Browser API
- ✅ Uses OpenAI GPT-4 to turn scraped data into an itinerary
- ✅ CLI-based and easy to run
- ✅ Great for devs learning agent workflows, scraping, or real-time data use in AI apps
- Node.js v16+
- npm or yarn
- Bright Data account with Browser API (MCP) access
- OpenAI API key
git clone https://github.com/forrestknight/mcp-scraper.git
cd mcp-scraper
npm install
- Sign up for a Bright Data account if you don't have one
- Go to the Bright Data dashboard
- Click "Add Zone" and select "Browser"
- Configure the Browser API:
- Enable "CAPTCHA Solver"
- Note the WebSocket URL (it will look like
wss://brd-customer-...
)
- Find your authentication credentials in the "Access parameters" section
- Go to OpenAI's API keys page
- Create a new secret key if you don't have one
- Copy the API key
Create a .env
file in the project root with the following content:
# Bright Data MCP
PLAYWRIGHT_WS_ENDPOINT=wss://brd-customer-<YOUR_CUSTOMER_ID>-<RANDOM_STRING>:<PASSWORD>@brd.superproxy.io:9222
# OpenAI
OPENAI_API_KEY=your_openai_api_key_here
Replace the placeholders with your actual credentials.
Run the travel agent with:
./travelAgent.js <city> <checkin YYYY-MM-DD> <checkout YYYY-MM-DD>
Example:
./travelAgent.js "New York" "2025-06-15" "2025-06-20"
The MCP magic happens with just one line of code:
const browser = await chromium.connectOverCDP(process.env.PLAYWRIGHT_WS_ENDPOINT);
This single line connects to Bright Data's Browser API, which handles:
- Browser automation
- IP rotation
- CAPTCHA solving
- Headless browser management
Never commit your .env
file or share your API keys. The .gitignore
file is already set up to prevent accidental commits of sensitive information.
This project is licensed under the MIT License - see the LICENSE file for details.
- Bright Data for their powerful Browser API
- OpenAI for their amazing AI capabilities
- Playwright for reliable browser automation