# stealth-agent-browser-mcp A Model Context Protocol (MCP) server that gives AI agents a **stealth-grade Chromium browser** with a **hybrid Accessibility-Object-Model + Set-of-Mark vision** interface. Built for Claude, works with any MCP-compatible host. - **Stealth first.** Uses [`rebrowser-playwright`](https://github.com/rebrowser/rebrowser-playwright) to patch the `Runtime.Enable` CDP leak that bypasses `playwright-extra`-class stealth plugins. Passes modern bot-detection suites (CreepJS, bot.sannysoft.com) where vanilla Playwright fails. - **Token-lean by default.** `browser_snapshot` returns [Playwright aria snapshot](https://playwright.dev/docs/aria-snapshots) YAML (~2–5 KB) instead of raw HTML (100KB+). Every interactive element carries a `[ref=eN]` id that actions consume directly — no selectors, no drift. - **Hybrid vision when it matters.** Ask for `mode: "hybrid"` and the server overlays numbered red boxes on the screenshot so the model can ground visually ([Set-of-Mark prompting, Yang et al.](https://arxiv.org/abs/2310.11441)). The ref ids on the image match the ids in the YAML. No parallel numbering scheme to go out of sync. - **Readability-based content extraction.** `browser_scroll_read` runs [Mozilla Readability](https://github.com/mozilla/readability) through JSDOM and returns clean Markdown — optionally delta-only, so re-reads cost nothing when nothing changed. - **Proxy-ready.** Per-session proxy auth, useful with residential pools. > **Authorized use only.** Stealth tooling has legitimate applications (accessibility auditing, your-own-account automation, QA against sites you own or have permission to test). Do not use this server to violate a site's terms of service or applicable law. See [SECURITY.md](./SECURITY.md). --- ## Install ```bash npm install -g stealth-agent-browser-mcp # Chromium binary is fetched automatically on first launch npx playwright-core install chromium ``` Or run without install via `npx stealth-agent-browser-mcp`. ## Quickstart (Claude Desktop / Claude Code / Cursor) Add to your MCP config: ```json { "mcpServers": { "stealth-browser": { "command": "npx", "args": ["-y", "stealth-agent-browser-mcp"], "env": { "SAB_HEADLESS": "true", "SAB_STEALTH_LEVEL": "patched" } } } } ``` Restart the host. The agent will see the tools listed below. ## Tools | Tool | Purpose | |---|---| | `browser_navigate` | Navigate a URL and return a snapshot. | | `browser_snapshot` | `aom` (YAML only, cheapest), `vision` (raw screenshot), or `hybrid` (YAML + Set-of-Mark screenshot). | | `browser_click` | Click an element by its `[ref=eN]`. | | `browser_type` | Type into an input/textarea by ref. | | `browser_select` | Choose options in a `