---
title: "AI agent browser"
description: "An AI agent browser in the cloud: let Claude, Cursor or your own agent log in, fill forms and click through portals over MCP or Playwright CDP."
canonical: https://www.zenrows.com/use-cases/ai-agent-browser
updated: 2026-10-18
---

# AI agent browser

An AI agent browser is a real cloud browser an AI agent controls to act on websites: open pages, log in, click, type, fill forms and read what loads. Zenrows Browser gives agents that browser through MCP tools like browser_navigate and browser_click, or Playwright and Puppeteer over CDP, with Zenrows' stealth on every session.

## Sample output: one agent task, step by step

```json
{
  "task": "Find the newest invoice in the supplier portal",
  "session_id": "sess_8c41e2",
  "steps": [
    { "tool": "browser_navigate", "url": "https://portal.example.com/login" },
    { "tool": "browser_fill", "selector": "#email", "value": "ops@example.com" },
    { "tool": "browser_fill", "selector": "#password", "value": "********" },
    { "tool": "browser_click", "selector": "button[type=submit]" },
    { "tool": "browser_wait_for_selector", "selector": "table.invoices" },
    { "tool": "browser_get_text", "selector": "table.invoices tbody tr:first-child" },
    { "tool": "browser_close" }
  ],
  "result": {
    "invoice": "INV-2026-0912",
    "amount": 1240.0,
    "currency": "EUR",
    "due_date": "2026-11-05"
  },
  "session_minutes": 2
}
```

Illustrative trace through the Zenrows MCP server: real tool names, placeholder portal and values.

## What teams use an agent browser for

If one request returns the page, Fetch is faster. A browser earns its place at a login, form or click.

| Job | Data you collect | Typical sources |
|---|---|---|
| Portal logins and downloads | Invoices, statements, order and shipment status | Supplier portals, Maersk and Hapag-Lloyd, utilities |
| Form-driven lookups | Results behind a search form | State court portals, company registries, county property search |
| Availability checks | Slots, seats or stock behind clicks | Government appointments, airline booking, ticketing |
| Configurators and quotes | A price that depends on options | Car configurators, insurance quotes, B2B calculators |
| Dynamic dashboards | Numbers behind tabs, filters or scroll | Seller centers, analytics dashboards |
| Checking your own flows | Sign-up, search and checkout still working | Your staging and production apps |

## Why agents fail in a browser

A smart agent still fails if a local headless browser is flagged, loses its login or dies mid-task.

| What breaks | What it looks like | How Zenrows handles it |
|---|---|---|
| Headless browser flagged | A Turnstile loop or "verify you are human" on step one | Zenrows' stealth gets through Cloudflare Turnstile and similar |
| State lost between steps | Logged in, then logged out on the next action | One `session_id` keeps cookies and tabs across tool calls |
| Selectors the agent guesses wrong | Clicks miss after a redesign; the agent loops | `browser_get_accessibility_tree` picks elements by role and text |
| Sessions left running | Open sessions pile up after the answer | `browser_close` at the end of each task frees the session |
| Browser infrastructure | Chrome versions, memory limits, crashed containers | A hosted browser at `wss://browser.zenrows.com`, nothing to run |
| No record of what happened | Nobody knows why a run went wrong | `browser_screenshot` captures any step for review |

## Set up an AI agent browser with Zenrows

1. **Connect the agent**: `claude mcp add zenrows -e ZENROWS_API_KEY=YOUR_ZENROWS_API_KEY -- npx -y @zenrows/mcp`, or `https://mcp.zenrows.com/mcp` with a Bearer key in any MCP client.
2. **Describe the goal** and end state; the agent starts with `browser_navigate` and picks each step.
3. **Script the parts that never change**, like logins, in Playwright or Puppeteer over CDP; the model takes the variable part.
4. **Close every session** with `browser_close` and log session minutes per task.

```javascript Node.js
// npm install playwright-core
import { chromium } from "playwright-core";

const browser = await chromium.connectOverCDP(
  "wss://browser.zenrows.com?apikey=YOUR_ZENROWS_API_KEY"
);
const context = browser.contexts()[0] ?? (await browser.newContext());
const page = await context.newPage();

// Scripted login: credentials stay in env vars, never in the prompt.
await page.goto(LOGIN_URL);
await page.fill("#email", process.env.PORTAL_USER);
await page.fill("#password", process.env.PORTAL_PASSWORD);
await page.click("button[type=submit]");
await page.waitForSelector("main");

// Hand the model a compact view of the page to choose its next action.
const snapshot = await page.locator("main").ariaSnapshot();
console.log(snapshot);

await browser.close();
```

```text Claude Code (MCP)
# Connect once
claude mcp add zenrows -e ZENROWS_API_KEY=YOUR_ZENROWS_API_KEY -- npx -y @zenrows/mcp

# Then ask:
Use the Zenrows browser to open TARGET_URL, search for "ACME Holdings" in the company search form, open the first result, and tell me the registration number and status. Close the browser session when done.
```

```bash CLI
npx -y @zenrows/cli init
# Print the MCP config for your agent, so it gets the browser tools
zenrows mcp config --client claude-code
# Read a page that needs no clicks straight from the terminal
zenrows fetch TARGET_URL --output markdown
```

## Which Zenrows product fits

| If you need to | Use | Why |
|---|---|---|
| Let an agent log in and fill forms | [Browser](/products/browser) | A cloud browser over CDP or MCP |
| Give Claude, Cursor or Codex browser tools | [MCP Server](/mcp) | `browser_navigate`, `browser_click`, `browser_fill` and more |
| Set up and read from an agent's shell | [CLI](/cli) | `zenrows mcp config` prints the setup; `zenrows fetch` reads pages |
| Read a page that needs no interaction | [Fetch](/products/fetch) | One request, no session to manage |
| Teach the agent which tool fits | [Agent Toolkit](/agents) | Skills and plugins route reads to Fetch, actions to Browser |

## What success looks like

| Measure | What good looks like | How to check it |
|---|---|---|
| Task completion | Test tasks reach their end state | Weekly rerun of known-answer tasks |
| Steps per task | Stable step counts per task | Tool calls per task in the trace |
| Session minutes per task | Minutes match the work, no idle tail | Session duration against last action time |
| Orphaned sessions | Every session closed | Each opening `browser_navigate` has a `browser_close` |
| Challenge pages | Block pages are rare on your targets | Screenshot or log pages with a challenge marker |
| Human handoffs | Few tasks need a person | Tasks escalated to a human per week |

## AI agent browser FAQ

### What is an AI agent browser?

A browser an AI agent drives instead of a person: given a goal, it reads each page and picks the next action (click, type, select, scroll, wait). Zenrows Browser runs it in the cloud, reached over MCP or CDP.

### How do I give Claude or Cursor a browser?

Connect the Zenrows MCP server: claude mcp add zenrows -e ZENROWS_API_KEY=YOUR_ZENROWS_API_KEY -- npx -y @zenrows/mcp in Claude Code; in Cursor, Windsurf, VS Code and others, https://mcp.zenrows.com/mcp with your key as Bearer token. The agent gets the browser_* tools.

### Can an AI agent log in to websites?

Yes, with credentials you may use; the session keeps cookies. Safer: script the login in Playwright from environment variables and hand the model the logged-in page, so passwords never enter the prompt.

### Should I use MCP or Playwright over CDP?

MCP when the path is unknown and the model decides; Playwright or Puppeteer over CDP for fixed, fast, repeatable flows. Both use the same Zenrows Browser: script the fixed part, hand the rest to the agent.

### What happens when a site shows a CAPTCHA or a Cloudflare challenge?

Zenrows' stealth gets agents through Cloudflare, Turnstile, DataDome and Akamai checks like a regular visitor. browser_screenshot shows what it saw at any step.

### Which browser tools does the Zenrows MCP server give an agent?

What a person does on a page: browser_navigate opens a URL; browser_click , browser_fill , browser_type and browser_select_option act; browser_scroll and browser_wait_for_selector move and wait; browser_get_text , browser_get_accessibility_tree , browser_screenshot and browser_evaluate read. Also tabs, cookies, back and forward; browser_close ends the session.

### When should an agent use Fetch instead of a browser?

When the page needs no interaction: Fetch returns HTML, Markdown or JSON in one request, rendering only when needed (Adaptive Stealth Mode), no session. Most agents use both.

## Related use cases

- [Browser automation](https://www.zenrows.com/use-cases/browser-automation.md): Logins, portal lookups and report downloads run in a cloud browser your Playwright or Puppeteer code drives.
- [Automated form filling](https://www.zenrows.com/use-cases/automated-form-filling.md): Quote requests, applications and portal data entry submitted from your CSV, with every confirmation captured.
- [LLM web scraping for RAG and agents](https://www.zenrows.com/use-cases/llm-web-scraping.md): Live pages as Markdown or JSON for RAG pipelines, grounding and agent tool calls.
- [Deep research agent](https://www.zenrows.com/use-cases/deep-research-agent.md): An agent that reads dozens of live sources as Markdown, including protected pages, and cites every claim.
- [Public records API](https://www.zenrows.com/use-cases/public-records-api.md): Permits, violations, licenses and registry filings from public record portals, returned as JSON on demand.

Start free: https://app.zenrows.com/register. Docs: https://docs.zenrows.com

## Structured data



<script type="application/ld+json">
{"@context":"https://schema.org","@graph":[{"@type":"WebPage","@id":"https://www.zenrows.com/use-cases/ai-agent-browser#webpage","url":"https://www.zenrows.com/use-cases/ai-agent-browser","name":"AI agent browser","description":"An AI agent browser in the cloud: let Claude, Cursor or your own agent log in, fill forms and click through portals over MCP or Playwright CDP.","isPartOf":{"@id":"https://www.zenrows.com/#website"},"inLanguage":"en","datePublished":"2026-10-18","dateModified":"2026-10-18","about":{"@type":"Thing","name":"ai agent browser"},"keywords":"ai agent browser, browser for ai agents, web access for ai agents, mcp web scraping, web scraping mcp, browser mcp, cloud browser for agents, agent browser automation","publisher":{"@type":"Organization","name":"Zenrows","url":"https://www.zenrows.com/"}},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://www.zenrows.com/"},{"@type":"ListItem","position":2,"name":"Use cases","item":"https://www.zenrows.com/use-cases"},{"@type":"ListItem","position":3,"name":"AI agent browser","item":"https://www.zenrows.com/use-cases/ai-agent-browser"}]},{"@type":"FAQPage","@id":"https://www.zenrows.com/use-cases/ai-agent-browser#faq","mainEntity":[{"@type":"Question","name":"What is an AI agent browser?","acceptedAnswer":{"@type":"Answer","text":"A browser an AI agent drives instead of a person: given a goal, it reads each page and picks the next action (click, type, select, scroll, wait). Zenrows Browser runs it in the cloud, reached over MCP or CDP."}},{"@type":"Question","name":"How do I give Claude or Cursor a browser?","acceptedAnswer":{"@type":"Answer","text":"Connect the Zenrows MCP server: claude mcp add zenrows -e ZENROWS_API_KEY=YOUR_ZENROWS_API_KEY -- npx -y @zenrows/mcp in Claude Code; in Cursor, Windsurf, VS Code and others, https://mcp.zenrows.com/mcp with your key as Bearer token. The agent gets the browser_* tools."}},{"@type":"Question","name":"Can an AI agent log in to websites?","acceptedAnswer":{"@type":"Answer","text":"Yes, with credentials you may use; the session keeps cookies. Safer: script the login in Playwright from environment variables and hand the model the logged-in page, so passwords never enter the prompt."}},{"@type":"Question","name":"Should I use MCP or Playwright over CDP?","acceptedAnswer":{"@type":"Answer","text":"MCP when the path is unknown and the model decides; Playwright or Puppeteer over CDP for fixed, fast, repeatable flows. Both use the same Zenrows Browser: script the fixed part, hand the rest to the agent."}},{"@type":"Question","name":"What happens when a site shows a CAPTCHA or a Cloudflare challenge?","acceptedAnswer":{"@type":"Answer","text":"Zenrows' stealth gets agents through Cloudflare, Turnstile, DataDome and Akamai checks like a regular visitor. browser_screenshot shows what it saw at any step."}},{"@type":"Question","name":"Which browser tools does the Zenrows MCP server give an agent?","acceptedAnswer":{"@type":"Answer","text":"What a person does on a page: browser_navigate opens a URL; browser_click , browser_fill , browser_type and browser_select_option act; browser_scroll and browser_wait_for_selector move and wait; browser_get_text , browser_get_accessibility_tree , browser_screenshot and browser_evaluate read. Also tabs, cookies, back and forward; browser_close ends the session."}},{"@type":"Question","name":"When should an agent use Fetch instead of a browser?","acceptedAnswer":{"@type":"Answer","text":"When the page needs no interaction: Fetch returns HTML, Markdown or JSON in one request, rendering only when needed (Adaptive Stealth Mode), no session. Most agents use both."}}]}]}
</script>
