# Browserless (Playwright Cloud) MCP for AI Agents MCP

> Browserless (Playwright Cloud) connects your AI client to a remote, scalable browser cluster, allowing it to scrape and interact with complex websites. This MCP handles Single Page Applications (SPAs), bypassing anti-bot measures like Cloudflare or Data Dome. Instead of just fetching raw text, your agent runs full JavaScript lifecycles, letting you extract fully rendered HTML, high-fidelity PDFs, or specific elements even when the content loads dynamically.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** headless-browser, test-automation, web-scraping, chromium, browser-testing, cloud-execution

## Description

Modern websites are tricky. They don't hand over clean data through simple API calls; they load it using complex JavaScript and React frameworks, often protected by anti-bot measures. This MCP gives your AI agent a full browser sandbox—a legitimate remote Chromium instance—to tackle those sites head-on. You no longer have to worry about whether the content is loaded correctly or if basic fetching methods are blocked. Your agent can execute custom JS functions, simulating clicks on modals before extracting data, or waiting until specific selectors appear. It's like giving your AI a full set of hands and eyes for any browser page. When you connect this MCP via Vinkius, you gain the ability to treat every website as if it were running locally in a dedicated testing environment, guaranteeing accurate data capture whether you need raw HTML, a PDF printout, or just a screenshot.

## Tools

### get_html_content
Retrieves the fully rendered HTML structure of a web page, even if it relies on JavaScript to load content.

### send_custom_payload
Allows you to send arbitrary JSON data directly to any Browserless REST endpoint for advanced interactions.

### run_custom_function
Executes specific, custom JavaScript functions within the isolated environment of the remote browser instance.

### scrape_with_js
Injects and runs a script before scraping, letting you simulate actions like clicking buttons to reveal hidden data.

### get_pdf
Generates a high-quality PDF document from the currently loaded webpage content.

### scrape_with_proxy
Routes all scraping requests through a specified proxy server to mask your true origin IP address.

### scrape_elements
Extracts only the data contained within specific, user-defined CSS selectors from the page.

### get_screenshot
Takes a complete visual snapshot of the webpage, useful for auditing or documenting UI states.

### scrape_with_stealth
Applies advanced plugins to mimic human browsing patterns, bypassing common bot detection systems.

### scrape_with_wait
Pauses the scraping process until a specific element appears on the page, preventing premature data extraction.

## Prompt Examples

**Prompt:** 
```
Can you take a screenshot of this product listing page? I need to audit how it looks on mobile.
```

**Response:** 
```
**Screenshot Audit: Vinkius Landing Page**

*   **Device:** iPhone 14 Pro (Portrait)
*   **Dimensions:** 390px x 844px
*   **Status:** Rendered successfully. All elements visible.

[Image Attached - Full-Page Screenshot]

The screenshot confirms the mobile layout is clean and responsive. No content clipping detected.
```

**Prompt:** 
```
I need the full text of the article, but it only appears after I click the 'read more' button. Can you extract that content?
```

**Response:** 
```
**Article Content Extraction Complete**

The original short summary was successfully expanded by simulating a user click on the 'Read More' anchor tag. The extracted text is comprehensive and stable.

*   **Key Takeaway:** [First paragraph of full article]
*   **Section 2:** [Detailed points from the middle section]
*   **Conclusion:** [Final summary statement]

The data looks clean, ready for summarization.
```

**Prompt:** 
```
Can you scrape the name and price of all items listed on this page using a proxy from Germany?
```

**Response:** 
```
**Scraped Item List (German Proxy)**

| Product Name | Price | Status |
| :--- | :--- | :--- |
| Widget Alpha | €19.99 | Active |
| Gizmo Beta | €45.00 | Low Stock |
| Thing Gamma | €7.50 | Pre-order |

Extraction was performed successfully using a residential German endpoint, bypassing rate limits and ensuring clean data capture.
```

## Capabilities

### Render Full JavaScript DOM
The agent executes full JavaScript lifecycles on the target page, ensuring that complex Single Page Applications (SPAs) fully load their content before extraction.

### Extract Specific Visual Elements
You can instruct your AI to pinpoint and pull out data using explicit CSS selectors rather than scraping large chunks of text.

### Capture Page Screenshots and PDFs
The MCP spawns a temporary browser instance to capture high-resolution full-page screenshots or generate print-perfect PDF documents automatically.

### Bypass Anti-Bot Defenses
Requests run through stealth plugins and can be routed via proxies, helping your agent avoid detection by major website security systems like Cloudflare.

### Execute Custom Code Blocks
The MCP exposes the raw Chrome DevTools Protocol, letting you inject custom JavaScript code to manipulate or test the page state before extraction.

## Use Cases

### Collecting Quarterly Pricing Data from E-commerce Sites
A market analyst needs the price list for 50 different products, but each product page loads prices dynamically. They prompt their agent to use `get_html_content` and then `scrape_elements` repeatedly across a catalog index to build a complete spreadsheet.

### Testing New Web Features Before Launch
A QA team member tells the AI to run through a simulated user journey, forcing it to execute clicks and waits. The agent uses `get_screenshot` multiple times with `scrape_with_wait` to confirm that every step in the workflow renders correctly.

### Archiving Legal Documents from Government Sites
A compliance officer needs a permanent record of an online policy document. They instruct the agent to visit the URL and use `get_pdf` to generate a universally readable, print-perfect PDF copy.

### Retrieving Data from Private or Protected Dashboards
A data scientist needs metrics locked behind a login wall. They ask the agent to run through proxy routes using `scrape_with_proxy` and execute custom scripts with `run_custom_function` to pull raw, difficult-to-access numbers.

## Benefits

- Guaranteed full rendering: Use `get_html_content` to pull the entire DOM structure, even from sites that rely heavily on JavaScript hydration.
- Visual confirmation: Need proof? Run `get_screenshot` for a precise image capture of the page state at any moment.
- Advanced data targeting: Instead of dumping everything, use `scrape_elements` to grab only the specific piece of information you need from a large table or block of text.
- Circumvent security blocks: Use `scrape_with_stealth` or `scrape_with_proxy` when hitting sites that actively challenge automated access. This gets data where simple scrapers fail.
- Action-based scraping: If the data is hidden behind a modal, use `scrape_with_js` to programmatically click it open before extraction.

## How It Works

The bottom line is that you get reliable access to a fully rendered web page environment directly within your AI workflow, regardless of how complex or protected the target site is.

1. First, append the Browserless integration details to your AI client settings and provide your secured HTTP Token.
2. Next, prompt your agent with a request that requires full web rendering—for example, asking it to capture a screenshot or extract data from a dynamic page.
3. Your client sends the command to the remote browser cluster, which executes the JavaScript lifecycle, captures the requested artifact (e.g., HTML, PNG), and returns the resulting clean data to your agent.

## Frequently Asked Questions

**What is the difference between using Browserless (Playwright Cloud) and a simple API call?**
A simple API call only retrieves static data; it can't run JavaScript. This MCP runs a full browser, meaning you get access to content that loads dynamically—like personalized dashboard metrics or content hidden behind click actions.

**Can I use Browserless (Playwright Cloud) to scrape sites protected by anti-bot measures?**
Yes. The MCP includes tools like `scrape_with_stealth` and proxy support, which helps your agent emulate human behavior and bypass common detection systems from major security services.

**How do I get a reliable PDF document from a complex website?**
Simply ask the MCP to generate a PDF. It simulates printing the page perfectly, capturing all visible elements and ensuring the final document looks exactly like it would if you printed it directly in a browser.

**Is Browserless (Playwright Cloud) better for QA testing than traditional automation tools?**
For AI-driven workflows, yes. It allows your agent to run full user journeys—like clicking through a multi-step form and capturing screenshots of each step—making it easier to audit complex web flows.

**Does Browserless (Playwright Cloud) handle Single Page Applications (SPAs)?**
Absolutely. SPAs are built on JavaScript, which this MCP fully supports. It ensures that even if the content loads slowly or in chunks, your agent captures the final, complete version of the page.