{
  "markdown": "# docker-stealthy-auto-browse\n\n[![CI](https://github.com/psyb0t/docker-stealthy-auto-browse/actions/workflows/pipeline.yml/badge.svg?branch=main)](https://github.com/psyb0t/docker-stealthy-auto-browse/actions/workflows/pipeline.yml)\n[![version](https://raw.githubusercontent.com/psyb0t/docker-stealthy-auto-browse/badges/version.svg)](https://github.com/psyb0t/docker-stealthy-auto-browse/releases)\n[![license](https://raw.githubusercontent.com/psyb0t/docker-stealthy-auto-browse/badges/license.svg)](LICENSE)\n[![Docker Pulls](https://img.shields.io/docker/pulls/psyb0t/stealthy-auto-browse?style=flat-square)](https://hub.docker.com/r/psyb0t/stealthy-auto-browse)\n\nStealth browser automation that actually works. Runs Camoufox (custom Firefox) in Docker with zero Chrome DevTools Protocol exposure, real OS-level mouse and keyboard input via PyAutoGUI, and a JSON HTTP API + MCP server to control it all remotely. Watch it live via noVNC. Run a single instance or spin up a cluster behind HAProxy with Redis cookie sync, request queuing, and sticky sessions. Drive it with curl, pipe YAML scripts through stdin, send multi-step scripts via the API, use page loaders to auto-handle popups and paywalls, or connect AI agents directly via MCP. Optional Bearer token auth via `AUTH_TOKEN`.\n\nPasses Cloudflare, CreepJS, BrowserScan, Pixelscan, and every other bot detector we've thrown at it. While Chromium-based tools are getting caught by the first line of defense, this thing walks through the front door unnoticed.\n\n## Table of Contents\n\n- [What's Inside](#whats-inside)\n- [Quick Start](#quick-start)\n- [Two Input Modes](#two-input-modes)\n- [Virtual Camera & Microphone](#virtual-camera--microphone)\n- [MCP Server](#mcp-server)\n- [Agent integrations](#agent-integrations)\n- [Script Mode](#script-mode)\n- [Page Loaders](#page-loaders)\n- [Screen Recording](#screen-recording)\n- [Cluster Mode](#cluster-mode)\n- [Authentication](#authentication)\n- [Configuration](#configuration)\n- [Development](#development)\n- [Bot Detection Results](#bot-detection-results)\n- [License](#license)\n\n## What's Inside\n\n| Component      | What It Does                                                                                                                                                                                |\n| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **Camoufox**   | A custom build of Firefox with zero Chrome DevTools Protocol exposure. Bot detectors look for CDP signals — this browser simply doesn't have any.                                           |\n| **Xvfb**       | Virtual framebuffer that lets the browser run with a full graphical display inside a container, no physical monitor needed. This matters because headless mode is another detection signal. |\n| **PyAutoGUI**  | Generates real OS-level mouse movements and keystrokes. The browser receives these as genuine user input — it has no idea it's being automated.                                             |\n| **noVNC**      | Web-based VNC client so you can watch the browser in real time from your own browser. Great for debugging and seeing exactly what's happening.                                              |\n| **Openbox**    | Lightweight window manager — adds title bars and resize handles to popup windows (OAuth dialogs, etc.) that would otherwise be too small to interact with. Zero stealth impact.             |\n| **HTTP API**   | A JSON API on port 8080 that lets you control everything — navigate pages, click elements, type text, take screenshots, manage tabs, handle cookies, and more.                              |\n| **MCP Server** | [Model Context Protocol](https://modelcontextprotocol.io/) server at `/mcp` on the same port. AI agents (Claude, etc.) can drive the browser directly over MCP using Streamable HTTP.       |\n| **ffmpeg**     | `x11grab` against Xvfb for screen recording. Captures actual rendered pixels including the OS-level mouse cursor — see [Screen Recording](#screen-recording).                               |\n\nPre-installed extensions: **uBlock Origin** (ads/trackers), **LocalCDN** (prevents CDN tracking), **ClearURLs** (strips tracking params), **Consent-O-Matic** (auto-handles cookie popups).\n\n## Quick Start\n\n```bash\ndocker run -d --name browser \\\n  -p 8080:8080 \\\n  -p 5900:5900 \\\n  psyb0t/stealthy-auto-browse\n```\n\nPort **8080** is the HTTP API, port **5900** is the VNC viewer (`http://localhost:5900/`).\n\n```bash\n# Navigate\ncurl -X POST http://localhost:8080 \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"action\": \"goto\", \"url\": \"https://example.com\"}'\n\n# Get page text\ncurl -X POST http://localhost:8080 \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"action\": \"get_text\"}'\n\n# Click by CSS selector (preferred — fast and reliable)\ncurl -X POST http://localhost:8080 \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"action\": \"click\", \"selector\": \"button#submit\"}'\n\n# Screenshot (last resort — prefer get_text; always resize to save tokens)\ncurl \"http://localhost:8080/screenshot/browser?whLargest=512\" -o screenshot.png\n```\n\n**Run multi-step scripts in one request:**\n\n```bash\ncurl -X POST http://localhost:8080 \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"action\": \"run_script\",\n    \"steps\": [\n      {\"action\": \"goto\", \"url\": \"https://example.com\", \"wait_until\": \"domcontentloaded\"},\n      {\"action\": \"sleep\", \"duration\": 2},\n      {\"action\": \"get_text\", \"output_id\": \"text\"},\n      {\"action\": \"eval\", \"expression\": \"document.title\", \"output_id\": \"title\"}\n    ]\n  }'\n```\n\nAlso accepts `\"yaml\": \"...\"` with the same YAML format used in script mode. In single-instance mode, requests are serialized automatically — send multiple scripts in parallel and they queue up.\n\nSee [docs/api.md](docs/api.md) for all actions and the full API reference.\n\nNavigation uses app-owned controls, not a hidden browser-library timeout: each attempt gets 30 seconds by default, one timeout retry, and a one-second retry delay. Pass `timeout`, `retry_count`, and `retry_delay` with `goto`, `refresh`, or `new_tab` when a workflow needs different bounds. `retry_count: 0` disables retries. See [navigation controls](docs/api.md#navigation) for the limits and retry behavior.\n\n## Two Input Modes\n\nThere are two ways to interact with pages. **System input** uses PyAutoGUI to generate real OS-level mouse and keyboard events — the browser cannot tell these apart from a real human. **Playwright input** uses CSS selectors and DOM event injection — easier, but theoretically detectable by behavioral analysis. Use system input on any site with bot protection.\n\nFull breakdown and usage guide: [docs/stealth.md](docs/stealth.md)\n\n## Virtual Camera & Microphone\n\nMount test media read-only at `/media` and set `VIRTUAL_CAMERA_FILE` and/or `VIRTUAL_MICROPHONE_FILE`. Pages that call `navigator.mediaDevices.getUserMedia()` receive tracks captured from those files, so camera and microphone checks can run without host hardware.\n\n```bash\ndocker run -d -p 8080:8080 \\\n  -v ./media:/media:ro \\\n  -e VIRTUAL_CAMERA_FILE=camera.webm \\\n  -e VIRTUAL_MICROPHONE_FILE=microphone.wav \\\n  psyb0t/stealthy-auto-browse\n```\n\nSources must remain inside `/media`; restart the browser after changing them. A request for a kind without a configured virtual source fails with `NotFoundError` rather than falling back to hardware. Virtual tracks use the source file's native format, so pages must not require incompatible exact media constraints. This virtualizes `getUserMedia()` only, not `enumerateDevices()`.\n\nTo switch sources during an authorized test without replacing an already acquired camera or microphone track, enable `VIRTUAL_MEDIA_DYNAMIC=true`. Dynamic mode is disabled by default. Use `set_virtual_media_source` to choose an existing relative file name under `VIRTUAL_MEDIA_DIR`, or `upload_virtual_media` to add bounded base64 content and optionally activate it. An upload filename is only a safe, type-matching media name; the service generates a collision-safe stored basename, returns it, and never overwrites an existing named source. Before storage or activation, the decoded upload is checked with `ffprobe` for a stream matching the requested camera or microphone kind. The media directory must be writable for uploads; `VIRTUAL_MEDIA_UPLOAD_MAX_BYTES` defaults to 50 MiB. Existing page streams keep their track identities while the source changes.\n\nDynamic mode accepts files from the configured media directory only. It does not accept arbitrary host paths, remote URLs, WebSocket streams, or other live ingress. Both actions use the normal API authentication: when `AUTH_TOKEN` is set, send the usual `Authorization: Bearer <token>` header. See [docs/api.md#virtual-camera-and-microphone](docs/api.md#virtual-camera-and-microphone) and [docs/configuration.md](docs/configuration.md) for the action contract and writable-volume setup.\n\n## MCP Server\n\nAI agents can control the browser over the [Model Context Protocol](https://modelcontextprotocol.io/) via Streamable HTTP at `/mcp` on the same port 8080. All browser actions are exposed as MCP tools — navigation, screenshots, clicking, typing, JavaScript evaluation, cookies, and more.\n\nFor authorised test flows that need a human review when a verification widget appears, use `detect_challenge`. It is read-only: it reports a best-effort `absent`, `present`, or `unknown` status with bounded vendor/location evidence, but never clicks, enters a frame, or solves a challenge. Pass `scroll_into_view: true` to bring the first visible detected frame or widget into the viewport for VNC handoff; it still never clicks or focuses it. In cluster mode, include it as a `run_script` step. See [the API reference](docs/api.md#challenge-detection).\n\nConnect any MCP-compatible client (Claude Desktop, Claude Code, custom agents) to `http://localhost:8080/mcp/` and start browsing.\n\nWorks in both standalone and [cluster mode](#cluster-mode).\n\n## Agent integrations\n\nThe [skill](.agents/skills/stealthy-auto-browse) works in any agent that reads `.agents/skills/`, and installs natively in the clients below.\n\n### Claude Code\n\n```bash\nclaude plugin marketplace add psyb0t/agents\nclaude plugin install stealthy-auto-browse@psyb0t\n```\n\nClaude Code prompts for the stealthy-auto-browse URL and, if auth is enabled, the token — the token is stored in your OS keychain.\n\n### Codex\n\n```bash\ncodex plugin marketplace add psyb0t/agents\ncodex plugin add stealthy-auto-browse@psyb0t\n```\n\nInstalled via the marketplace, the skill invokes as `$stealthy-auto-browse:stealthy-auto-browse`. Codex also picks the skill up automatically with no install in any repo containing `.agents/skills/`, where it invokes as plain `$stealthy-auto-browse`.\n\n### OpenClaw\n\nThe skill is published to ClawHub on every release:\n\n```bash\nopenclaw skills install @psyb0t/stealthy-auto-browse\n```\n\nFor MCP clients that speak local stdio, the [`@psyb0t/stealthy-auto-browse`](.agents/plugins/stealthy-auto-browse) plugin bridges to the service's `/mcp` endpoint:\n\n```bash\nopenclaw plugins install clawhub:@psyb0t/stealthy-auto-browse\n```\n\nThen set `STEALTHY_AUTO_BROWSE_URL` (and `AUTH_TOKEN` if the server requires auth).\n\n## Script Mode\n\nPipe a YAML script into the container, get JSON results on stdout, container exits. No HTTP server. Good for CI, cron jobs, one-shot scraping.\n\n```bash\ncat my-script.yaml | docker run --rm -i \\\n  -e TARGET_URL=https://example.com \\\n  psyb0t/stealthy-auto-browse --script > results.json\n```\n\nFull docs: [docs/script-mode.md](docs/script-mode.md)\n\nScript mode also supports explicit `if` branches plus bounded `repeat` and `while` loops. Conditions can inspect elements, visible text, URLs, JavaScript booleans, and prior `output_id` values; see [the control-flow reference](docs/script-mode.md#control-flow).\n\n## Page Loaders\n\nDefine URL patterns + action sequences in YAML files. Mount them at `/loaders`. Whenever `goto` matches a pattern, the loader runs automatically — removes popups, waits for content, cleans up the page. Greasemonkey for the HTTP API.\n\nFull docs: [docs/page-loaders.md](docs/page-loaders.md)\n\n## Screen Recording\n\nRecord the browser as MP4 with mouse cursor visible. ffmpeg `x11grab` against Xvfb writes to a mounted `/recordings` volume. Three modes: `window` (full Camoufox window), `viewport` (chrome cropped using calibrated `mozInnerScreenX/Y`), `desktop` (entire Xvfb screen). Slug provided at stop time so you name the file after the run completes. Path-traversal-safe, collision-safe, crash-safe.\n\n```bash\nmkdir -p ./recordings\ndocker run -d -p 8080:8080 -v ./recordings:/recordings psyb0t/stealthy-auto-browse\n```\n\n```bash\ncurl -X POST http://localhost:8080 \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"action\": \"start_recording\", \"mode\": \"viewport\", \"fps\": 20}'\n\n# … do stuff …\n\ncurl -X POST http://localhost:8080 \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"action\": \"stop_recording\", \"slug\": \"my-flow\"}'\n# → ./recordings/my-flow.mp4\n```\n\nAlso works inside `run_script` (cluster-mode safe: start and stop must live in the same `run_script` so both hit the same instance). Full action table + script-mode example + notes in [docs/api.md#screen-recording](docs/api.md#screen-recording).\n\n## Cluster Mode\n\nRun multiple browser instances behind HAProxy with a request queue, sticky sessions, and Redis cookie sync (default 5, configurable via `NUM_REPLICAS`). Download the compose file and HAProxy config, then start:\n\n```bash\ncurl -LO https://raw.githubusercontent.com/psyb0t/docker-stealthy-auto-browse/main/docker-compose.cluster.yml\ndocker compose -f docker-compose.cluster.yml up -d\n```\n\nCookies set on any instance propagate to all others instantly via Redis PubSub. Log in once, the whole fleet is authenticated.\n\nEach browser defaults to a 5GB memory limit. Set `BROWSER_MEMORY_LIMIT` and `BROWSER_MEMORY_RESERVATION` when your fleet or display resolution needs a different budget; see [cluster mode](docs/cluster-mode.md#environment-variables).\n\n**Script-only enforcement (v1.0.0+):** When `NUM_REPLICAS > 1`, both the HTTP API and MCP server restrict to `run_script` only (plus `ping` and `sleep`). Individual actions are rejected to prevent stale content bugs from cross-instance routing. All actions remain available as steps inside `run_script`.\n\nFull docs: [docs/cluster-mode.md](docs/cluster-mode.md)\n\n## Authentication\n\nSet `AUTH_TOKEN` to require a Bearer token on all requests (except `/health`):\n\n```bash\ndocker run -d -p 8080:8080 -e AUTH_TOKEN=your-token-here psyb0t/stealthy-auto-browse\n```\n\nPass the token in the `Authorization` header:\n\n```bash\n# Header\ncurl -H \"Authorization: Bearer your-token-here\" http://localhost:8080 ...\n```\n\n## Examples\n\nSee [`.agents/skills/stealthy-auto-browse/scripts/`](.agents/skills/stealthy-auto-browse/scripts/) for ready-to-use scripts:\n\n- **[`websearch.py`](.agents/skills/stealthy-auto-browse/scripts/websearch.py)** — Multi-engine parallel web search (Brave, Google, Bing) with structured results and AI overview extraction. Outputs JSON with title, URL, and snippet for each result.\n\n## Configuration\n\nFull environment variables table, proxy setup (including a working private [pr0xteus](https://github.com/psyb0t/pr0xteus) HTTP-proxy example), persistent profiles, browser extensions, and VNC access: [docs/configuration.md](docs/configuration.md)\n\n## Development\n\nDocker is the only development dependency. The Makefile builds a local browser base, then runs linting, tests, and security tools in a separate disposable dev container. Only the complete test target receives the Docker socket because it starts its own browser and fixture containers.\n\n```bash\nmake build\nmake lint\nmake test\nmake sec\n```\n\n`make sec` writes `sec.sarif` for GitHub Security. It reports findings without blocking a release. Use `make help` for the complete command list.\n\n## Bot Detection Results\n\n| Service                                                                | Result   | What They Check                                                         |\n| ---------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------- |\n| [CreepJS](https://abrahamjuliot.github.io/creepjs/)                    | **Pass** | Canvas/WebGL fingerprint consistency, lies detection, worker comparison |\n| [BrowserScan](https://www.browserscan.net/bot-detection)               | **Pass** | WebDriver flag, CDP signals, navigator properties                       |\n| [Pixelscan](https://pixelscan.net/)                                    | **Pass** | Fingerprint coherence, timezone/IP match, WebRTC leaks                  |\n| [Cloudflare](https://cloudflare.com)                                   | **Pass** | Challenge pages, Turnstile, bot management                              |\n| [SannySoft](https://bot.sannysoft.com/)                                | **Pass** | Intoli + fingerprint scanner tests                                      |\n| [Incolumitas](https://bot.incolumitas.com/)                            | **Pass** | Modern detection techniques                                             |\n| [Rebrowser](https://bot-detector.rebrowser.net/)                       | **Pass** | CDP leak detection, webdriver, viewport analysis                        |\n| [BrowserLeaks WebRTC](https://browserleaks.com/webrtc)                 | **Pass** | WebRTC IP leak detection                                                |\n| [DeviceAndBrowserInfo](https://deviceandbrowserinfo.com/are_you_a_bot) | **Pass** | 19 checks, all green, \"You are human!\"                                  |\n| [IpHey](https://iphey.com/)                                            | **Pass** | \"Trustworthy\" rating                                                    |\n| [Fingerprint.com](https://fingerprint.com/demo/)                       | **Pass** | Identified as normal Firefox, no bot flags                              |\n\nWhy it works: [docs/stealth.md](docs/stealth.md)\n\n## Known Issues / TODO\n\n- **`system_click` reliability** — OS-level mouse clicks can land in the wrong place if the window offset is stale. Needs a more robust coordinate mapping solution so it works reliably without manual `calibrate` calls.\n\n## License\n\n**WTFPL** — Do What The Fuck You Want To Public License\n",
  "bytes": 18457,
  "sha": "c7fa997d5bcc1d9778541f7b710df6b3b9ffa808470dfc3157a23b5426aca743",
  "repo_slug": "psyb0t/docker-stealthy-auto-browse",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_psyb0t_stealthy_auto_browse_cdd2180e/readme"
}