> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrayn.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> From zero to a working scrape in five minutes.

# Quickstart

Get a browser engine, start the MCP server, and drive webrain from an LLM — in
five minutes.

## 1. Install webrain

<CodeGroup>
  ```bash Linux / macOS theme={null}
  curl -fsSL https://raw.githubusercontent.com/prokopis3/webrain/main/scripts/install.sh | bash
  ```

  ```powershell Windows theme={null}
  irm https://raw.githubusercontent.com/prokopis3/webrain/main/scripts/install.ps1 | iex
  ```

  ```bash Rust (cargo) theme={null}
  cargo install --git https://github.com/prokopis3/webrain webrain-cli
  ```
</CodeGroup>

## 2. Get a browser engine

```bash theme={null}
webrain install   # downloads Chrome for Testing (first time only)
```

This downloads Chrome for Testing into a cache dir; that build then wins
discovery over your system Chrome. See [Installation](/installation) for other
engines (`--engine obscura`) and OS specifics.

## 3. Start the MCP server

```bash theme={null}
webrain mcp             # stdio transport (VS Code / Copilot / Claude)
webrain mcp --http 9223 # HTTP transport on 127.0.0.1:9223
```

Logs go to **stderr**; MCP speaks pure JSON on **stdout** — never redirect
stderr into the stream.

## 4. Connect an LLM client (MCP setup)

Webrain is an **MCP server** - register it in your client and the 51 `webrain_*`
tools appear automatically. Two transports:

* **stdio** - `webrain mcp` (default; simplest for local clients)
* **HTTP** - `webrain mcp --http 9223`, endpoint `http://127.0.0.1:9223/mcp`

```jsonc theme={null}
{
  "mcp": {
    "servers": {
      "webrain": {
        "type": "stdio",
        "command": "webrain",
        "args": ["mcp"],
        "env": { "CDP_URL": "http://127.0.0.1:9222" }
      }
    }
  }
}
```

Or over HTTP (start `webrain mcp --http 9223` first):

```jsonc theme={null}
{
  "mcp": {
    "servers": {
      "webrain": { "type": "http", "url": "http://127.0.0.1:9223/mcp" }
    }
  }
}
```

**Claude Desktop** - `claude_desktop_config.json`:

```json theme={null}
{
  "mcpServers": {
    "webrain": { "command": "webrain", "args": ["mcp"] }
  }
}
```

**Cursor** - project `.mcp.json`:

```json theme={null}
{
  "mcpServers": {
    "webrain": { "command": "webrain", "args": ["mcp"] }
  }
}
```

Restart the client, then **verify the server is live**: ask the LLM to call
`webrain_guide` - it returns the browser/challenge/extraction decision guide.

Then ask the LLM something like:

> Scrape all product titles + prices from URL X

The model calls `webrain_navigate` → `webrain_autoschema` →
`webrain_extract_json` and returns structured data. No selectors on your part.

## Drive it by hand instead?

Every engine + tool has a CLI twin:

```bash theme={null}
webrain doctor                # full diagnosis: engines, MCP, CDP, vault, sidecar
webrain fetch https://example.com
webrain screenshot https://example.com
webrain eval "document.title"
webrain launch scrapingcourse demo "https://example.com/login" --port 9222
```
