← Back to Blog

OpenClaw Browser Relay: Automate Any Website with AI

Ronak KadhiRonak Kadhi
March 23, 202610 min read
Blog cover for OpenClaw Browser Relay: Automate Any Website with AI

Browser Relay lets OpenClaw control a real web browser. Instead of just fetching HTML, the agent can click buttons, fill forms, navigate between pages, take screenshots, and interact with JavaScript-heavy web apps — exactly like a human would.

It's the difference between reading a restaurant's menu (HTTP request) and actually sitting down to order (browser automation). Here's how to set it up and what it's actually good for.

What Is Browser Relay?

Browser Relay is an MCP server that connects OpenClaw to a headless Chrome instance via the Chrome DevTools Protocol (CDP). When enabled, OpenClaw gets access to browser tools:

  • Navigate to any URL

  • Click elements by selector or coordinates

  • Type into input fields and forms

  • Screenshot the current page (for visual analysis)

  • Execute JavaScript in the page context

  • Wait for elements to load or animations to finish

  • Extract structured data from rendered pages

The browser runs locally on your machine (or in a Docker container). OpenClaw sends commands through the relay, observes results via screenshots, and decides what to do next.

How It Works Under the Hood

The architecture is straightforward:

OpenClaw → MCP Protocol → Browser Relay Server → CDP → Headless Chrome
  1. OpenClaw decides it needs to interact with a website

  2. It sends a tool call to the browser relay MCP server

  3. The relay translates the command into CDP (Chrome DevTools Protocol) instructions

  4. Chrome executes the action and returns the result

  5. OpenClaw takes a screenshot to see what happened

  6. Based on the screenshot, it decides the next action

This screenshot-observe-act loop is what makes browser relay powerful. The agent doesn't need to parse HTML or guess at page structure — it literally looks at the page and reacts.

Get Your Free Marketing Audit

AI agents analyze your site for SEO, CRO, and content issues — full report in 2 minutes.

Audit My Site Free →

Setting Up Browser Relay

Prerequisites

  • OpenClaw installed (npm install -g @anthropic/openclaw)

  • Chrome or Chromium installed on your system

  • Node.js 18+

Step 1: Install the Browser Relay MCP Server

npm install -g @anthropic/openclaw-browser-relay

Step 2: Configure OpenClaw to Use It

Add the browser relay to your MCP server config. Edit ~/.openclaw/config.json:

{
  "mcpServers": {
    "browser": {
      "command": "openclaw-browser-relay",
      "args": ["--headless"],
      "env": {
        "CHROME_PATH": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
      }
    }
  }
}

On Linux, the Chrome path is typically /usr/bin/google-chrome or /usr/bin/chromium-browser.

Step 3: Verify the Setup

openclaw "open https://example.com in the browser and tell me what you see"

If configured correctly, OpenClaw will launch a headless Chrome instance, navigate to example.com, take a screenshot, and describe the page.

Real-World Use Cases

Web Scraping Dynamic Sites

Traditional scraping tools choke on JavaScript-rendered content. Browser relay handles it naturally:

openclaw "go to the competitor's pricing page at https://example.com/pricing, \
wait for the page to fully load, then extract all plan names, prices, \
and feature lists into a CSV file"

The agent navigates, waits for JS to render, scrolls to load lazy content, and extracts structured data.

Form Filling and Submission

openclaw "log into our staging environment at https://staging.app.com \
with the test credentials in .env, navigate to the settings page, \
and update the company name to 'Acme Corp'"

Browser relay handles multi-step form interactions — login flows, dropdown menus, date pickers, file uploads.

Visual Regression Testing

openclaw "open our app at localhost:3000, take screenshots of every page \
in the navigation, and compare them to the reference screenshots in \
./test/visual-baseline/. Report any differences."

The agent navigates through the app, captures screenshots, and uses its vision capabilities to spot visual regressions.

Monitoring and Alerts

openclaw "check if the status page at https://status.example.com shows \
any incidents. If there are active incidents, extract the details and \
save them to incidents.json"

Combine with a cron job for ongoing monitoring of any website, even ones without an API.

Data Entry Automation

openclaw "read the spreadsheet in data/contacts.csv and enter each \
contact into the CRM at https://crm.example.com/contacts/new — \
fill in name, email, company, and phone for each row"

For legacy systems without APIs, browser relay is often the only automation option.

Configuration Options

The browser relay server accepts several flags:

openclaw-browser-relay \
  --headless           # Run without visible browser window (default)
  --no-headless        # Show the browser window (useful for debugging)
  --viewport 1920x1080 # Set browser viewport size
  --timeout 30000      # Max wait time per action in milliseconds
  --proxy http://proxy:8080  # Route traffic through a proxy
  --user-data-dir /tmp/chrome-profile  # Persistent browser profile

For debugging, --no-headless is invaluable. You can watch exactly what the agent is doing in real time.

Security Considerations

Browser relay gives OpenClaw access to a real browser. Keep these risks in mind:

Credential exposure: If you log into sites through the agent, your credentials pass through the relay. Use environment variables, never hardcode passwords in prompts.

Cookie access: The browser session has access to cookies. Don't use your personal browser profile — use a fresh --user-data-dir or run in headless mode.

Network access: The browser can reach any URL your machine can. In sensitive environments, use --proxy to restrict outbound connections or run inside a Docker container with network limits.

JavaScript execution: The agent can run arbitrary JS in page contexts. This is powerful but means a compromised page could theoretically influence agent behavior. Stick to trusted URLs.

# Safer setup: isolated Docker container
docker run -d --name openclaw-browser \
  --network=restricted \
  -p 9222:9222 \
  browserless/chrome

Then point the relay at the Docker container's CDP endpoint instead of a local Chrome install.

Limitations

Speed: Browser automation is inherently slower than direct API calls. Each action requires rendering, screenshotting, and analysis. Budget 2-5 seconds per interaction.

CAPTCHAs: Browser relay can't reliably solve CAPTCHAs. If a site presents one, the agent will get stuck. Use authenticated sessions or API access when available.

Heavy SPAs: Some single-page apps with complex state management can confuse the agent. If the app heavily relies on client-side routing or websockets, interactions may be flaky.

Cost: Each screenshot sent to the model consumes vision tokens. A task with 20 browser interactions might cost $0.50-1.00 in additional token costs just for the screenshots.

No file downloads: The headless browser can't easily download files to your local filesystem. For file downloads, use direct HTTP requests instead.

Browser Relay vs Computer Use

OpenClaw has two ways to interact with GUIs:

| Feature | Browser Relay | Computer Use | | --------- | -------------- | ------------- | | Scope | Web browser only | Full desktop | | Speed | Faster (direct CDP) | Slower (screenshot-based) | | Precision | Pixel-perfect (CSS selectors) | Coordinate-based (can miss) | | Setup | MCP server config | Built into OpenClaw | | Best for | Web automation | Desktop apps, cross-app workflows |

Use browser relay for web tasks. Use computer use when you need to interact with native desktop applications or coordinate between multiple apps.

For teams running browser automation at scale across multiple agents, RunAgents manages browser relay configurations per-agent and provides execution logs so you can see exactly what each agent did in the browser.

Frequently Asked Questions

Does browser relay work with Firefox or Safari?

No. It uses Chrome DevTools Protocol, which is Chrome/Chromium-specific. Any Chromium-based browser works (Chrome, Edge, Brave), but Firefox and Safari are not supported.

Can I use browser relay with a remote browser?

Yes. Point the relay at any CDP endpoint. Services like Browserless.io or a self-hosted Chrome container work well. Set the CHROME_CDP_URL environment variable to the remote endpoint instead of launching a local Chrome instance.

How does OpenClaw decide what to click on a page?

OpenClaw takes a screenshot and uses its vision model to understand the page layout. It identifies buttons, links, and form fields visually, then generates the appropriate click coordinates or CSS selectors. This is why models with strong vision capabilities (like GPT-4o or Claude Sonnet) work best with browser relay.

Is browser relay the same as the OpenClaw Chrome Extension?

No. Browser relay is a server-side automation tool — it controls a headless browser programmatically. The Chrome Extension is a client-side tool that runs in your personal browser for interactive use. Browser relay is for automated, unattended tasks.

Can I run multiple browser sessions in parallel?

Yes, by launching multiple relay instances on different ports. Each instance manages its own Chrome process. This is useful for parallel scraping or testing, but watch your memory usage — each Chrome instance uses 200-500MB RAM.

What if the website requires two-factor authentication?

The agent can't handle TOTP codes (the 6-digit codes from authenticator apps) on its own. Options: use a persistent browser profile where you've already completed 2FA, use app passwords that bypass 2FA, or configure the service to whitelist the agent's IP from 2FA requirements.


Want browser automation managed for your team? RunAgents gives you managed OpenClaw hosting with task management, team collaboration, and agent debugging built in. Get started free

Related Guides

Get Your Free Marketing Audit

Our AI agents analyze your site and surface every SEO, CRO, and content problem — with prioritized fixes. Full report in 2 minutes.

Audit My Site Free →

No credit card required