.agents / browser

Version 0.46.0 MCP Python 3.10+ PyPI License

Ultra-fast, zero-Node Python CDP Browser MCP for AI coding agents.
Connects directly to your local Chrome, Edge, or Brave instance via native CDP. Headless by default.

--- ## Quickstart ### 1-Step Setup ```bash pip install agents-browser && agents-browser init ``` Scaffolds `~/.agents/browser/`, autowires MCP configurations into your installed IDEs, and registers assistant skills. > [!TIP] > **๐Ÿค– Agent-Driven Setup (Zero Friction):** > Simply tell your coding agent: **"Install and set up agents-browser for me."** > The agent installs the package, runs `agents-browser init`, and interacts with web applications, documentation, and search engines autonomously. *Source checkouts can also be installed and managed using [vand](https://github.com/Lolaplex/vand).* --- ## Why `.agents/browser`? Traditional browser automation MCPs (Playwright, Puppeteer) introduce massive friction: - Download ~300MB Chromium binaries that hog disk space - Spin up heavy Node.js runtimes that leave detached zombie processes - Lack access to existing user sessions, cookies, and saved logins - Dump 100k+ tokens of raw bloated HTML into LLM context windows **`agents-browser` connects directly to your installed browser via native CDP:** - **Headless by Default:** Silent `--headless=new` background automation. Visible window only on explicit ask. - **Zero Node.js / Zero 300MB Downloads:** Pure lightweight Python (`FastMCP` + `websockets`). - **Indexed `@ref` Interactive Snapshots:** Generates clean markdown with compact element references (`[@1] Button: Login`, `[@2] Input: Search`). - **High-Level Built-in Tools:** Web search, clean reader-mode extraction, table scraping, batch form filling, dropdown selection, viewport scrolling, in-page search, and network/DOM stability detection. - **Persistent Sessions (`~/.agents/browser`):** Preserves cookies, sessions, and saved logins across turns. - **Universal Multi-IDE Auto-Config:** Plugs into Cursor, Antigravity, Claude Desktop, and Zed in 1 second. --- ## Architecture & Flow ```text โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ CODING AGENT / IDE โ”‚ โ”‚ Cursor ยท Antigravity ยท Claude Code ยท Windsurf ยท Zed โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ FastMCP stdio โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ AGENTS-BROWSER CDP CLIENT โ”‚ โ”‚ Pure Python WebSocket ยท Port 9222 ยท Zero Node Runtime โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ Direct CDP Commands โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ LOCAL BROWSER (Chrome / Edge / Brave) โ€” headless=new โ”‚ โ”‚ Persistent Profile: ~/.agents/browser โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ–ผ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ INDEXED SNAPSHOTS โ”‚ โ”‚ HIGH-LEVEL TOOLS โ”‚ โ”‚ [@1] Button: Sign In โ”‚ โ”‚ browser_search โ”‚ โ”‚ [@2] Input: Search โ”‚ โ”‚ browser_read_article โ”‚ โ”‚ Compact Interactive Tokens โ”‚ โ”‚ browser_fill_form โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` --- ## CLI Reference | Command | Purpose | |---------|---------| | `agents-browser init` | Plug & Play setup: auto-configures MCP across Cursor, Antigravity, Claude Desktop, Zed | | `agents-browser open ` | Navigates headless (add `--visible` for a desktop window) | | `agents-browser system-open ` | Opens URL in the OS default desktop browser | | `agents-browser search ""` | Performs a web search and prints top 10 organic markdown results | | `agents-browser read` | Extracts active web page in clean Reader Mode | | `agents-browser snapshot` | Captures text outline with compact indexed `@ref` interactive elements | | `agents-browser screenshot --out ` | Captures a full or viewport PNG screenshot | | `agents-browser serve` | Runs the FastMCP stdio server (default) | --- ## Task-Adaptive Tool Architecture `agents-browser` adapts dynamically to the developer's specific task without forcing a rigid workflow: - **Research & Reading:** `browser_search`, `browser_read_article` (distraction-free markdown), `browser_extract_pdf`, `browser_fetch` (fast HTTP using browser cookies). - **Web Automation & Forms:** `browser_snapshot` (`@ref` indexing) โ†’ `browser_click`, `browser_type`, `browser_select`, `browser_fill_form`, `browser_scroll(target=...)`. - **Data Scraping:** `browser_scrape(mode='table'|'links'|'text')`, `browser_download`. - **Developer UI Testing & Dev Servers:** `browser_audit` (console errors & horizontal overflow detection), `browser_inspect`, `browser_get_styles`, `browser_get_layout`, `browser_set_viewport`. - **Visual Proofs & Demos:** `browser_screenshot` (PNG), `browser_record` / `browser_record_start` + `stop` (MP4 video screencast via local ffmpeg). --- ## MCP Tools Reference | Category | Tool | Parameters | Description | | :--- | :--- | :--- | :--- | | **Navigation** | `browser_open` | `url`, `new_tab`, `visible` | Navigate headless by default; intercepts direct downloads & auto-dismisses cookie overlays. | | | `browser_system_open` | `url` | Open URL in the user's personal desktop browser (Floorp, Firefox, Chrome, Edge). | | | `browser_set_headless` | `headless` | Toggle background headless mode (True = background, False = window). | | | `browser_go_back` | *None* | Navigate back in browser history. | | | `browser_reload` | `ignore_cache` | Reload active page (optional hard refresh). | | | `browser_tabs` | *None* | List active browser tabs with IDs, titles, and URLs. | | | `browser_switch_tab` | `tab_id` | Switch active tab focus. | | **Research** | `browser_search` | `query`, `engine` | Direct web search returning top organic results with Title, URL, and Snippet. | | | `browser_read_article` | *None* | Extracts clean article markdown, stripping ads, navbars, and banners. | | | `browser_extract_pdf` | `url_or_ref`, `save_path`, `max_pages` | Extracts PDF streams via Chrome PDF Viewer or Page.printToPDF with text preview. | | | `browser_fetch` | `url`, `method`, `headers`, `json_data`, `body` | Fast non-DOM HTTP/REST client using browser session cookies without rendering overhead. | | **Automation** | `browser_snapshot` | *None* | Extract clean text outline with indexed `@ref` element IDs (`@1`, `@2`). | | | `browser_click` | `target` | Click element by `@ref` (e.g. `@1`), CSS selector, or matching text. | | | `browser_type` | `target`, `text`, `clear`, `press_enter` | Focus and type text into input/textarea. | | | `browser_select` | `target`, `value` | Select dropdown `