me.openbrowser/openbrowser-ai
Automates Walmart product scraping by controlling a browser to navigate product pages and extract product data.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Cloud dashboard for saved cookies and scheduled tasks is available in the hosted version. Join the waitlist for early access: https://openbrowser.me :
https://github.com/user-attachments/assets/b17f97f3-f9f8-4707-8e39-abbbbe1a693b
Automating Walmart Product Scraping:
https://github.com/user-attachments/assets/c517c739-9199-47b0-bac7-c2c642a21094
OpenBrowserAI Automatic Flight Booking:
https://github.com/user-attachments/assets/632128f6-3d09-497f-9e7d-e29b9cb65e0f
OpenBrowserAI Automatic Form Filling:
https://github.com/user-attachments/assets/16f7ef1a-beb1-45e2-a733-9592536e0ef7
AI-powered browser automation using CodeAgent and CDP (Chrome DevTools Protocol)
OpenBrowser is a framework for intelligent browser automation. It combines direct CDP communication with a CodeAgent architecture, where the LLM writes Python code executed in a persistent namespace, to navigate, interact with, and extract information from web pages autonomously.
Contents
Related MCP server: mcp-browser-agent
1. Documentation
Full documentation: https://docs.openbrowser.me
2. Key Features
CodeAgent Architecture - LLM writes Python code in a persistent Jupyter-like namespace for browser automation
Raw CDP Communication - Direct Chrome DevTools Protocol for maximum control and speed
Native Web Search - The package-native DDGS client in Python, the CLI, CodeAgent, and MCP. Search snippets are discovery previews.
Vision Support - Screenshot analysis for visual understanding of pages
15 LLM Providers - OpenAI, Anthropic, Google, Groq, AWS Bedrock, Azure, Ollama, DeepSeek, Cerebras, OpenRouter, OCI, and more
MCP Server - Model Context Protocol for Claude Desktop, Claude Code, Codex, OpenCode, and other AI assistants. Modern clients use explicit contexts and isolated profiles. The server includes read-only status and reset tools.
CLI Daemon - Persistent browser daemon with
-cflag for direct code execution from Bash, explicit startup ownership, health and recovery status, saved login state, and 10-minute auto-shutdownFast CLI paths -
-cuses a standard-library thin client against a warm daemon.scrape --no-browseruses OpenBrowser no-browser mode: a light console entry that starts no Chrome, Blink, or V8 process and does not import the browser or configuration stackBatch scraping -
scrape_pagesand the CLI batch scrape multiple URLs with bounded concurrency. An explicit--no-browseror--engine httpbatch starts no browserExplicit Lifecycle State - Browser, CDP, navigation, focus, storage, downloads, agent runs, and CodeAgent runs report typed phases that replace log inspection
Workflow Recording - Record, replay, and export browser sessions to Jupyter notebooks or API crawler code
Video Recording - Record browser sessions as video files with ffmpeg
Cloud Platform - Full-stack web UI with real-time VNC streaming, saved logins (KMS-encrypted), scheduled workflows (EventBridge + SQS), and email notifications (SES)
Plugin System - Claude Code plugin and skills.sh pack with 8 guided skills (setup, deep research, web scraping, form filling, e2e testing, page analysis, accessibility audit, file download)
3. Installation
3.1. Quick install (macOS / Linux)
curl -fsSL https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/main/install.sh | sh3.2. Quick install (Windows PowerShell)
irm https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/main/install.ps1 | iexThe installers require Python 3.12 or newer. They use uv, then pipx, then pip.
To request a pip user install with --local, run:
curl -fsSL https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/main/install.sh | sh -s -- --localThe installer still prefers uv or pipx when either is available. The flag changes the pip fallback to pip install --user.
3.3. Homebrew (macOS / Linux)
brew tap billy-enrizky/openbrowser
brew install openbrowser-ai3.4. pip
pip install openbrowser-ai3.5. uv (recommended)
uv tool install openbrowser-ai3.6. uvx (zero install)
Run without installing the CLI. uvx downloads and caches the package.
The canonical web-search command is on the current source branch. PyPI 0.1.60 exposes the same feature as openbrowser-ai search. The examples below run the source build directly with uvx. To make openbrowser-ai web-search available in your shell, run uv tool install --force "openbrowser-ai @ git+https://github.com/billy-enrizky/openbrowser-ai.git@main" once.
# MCP server mode
uvx openbrowser-ai --mcp
# CLI daemon mode
uvx openbrowser-ai -c "await navigate('https://example.com')"
# Native web search on the current source branch. This command does not start Chromium.
uvx --from git+https://github.com/billy-enrizky/openbrowser-ai.git@main openbrowser-ai web-search "OpenBrowser MCP docs"
uvx --from git+https://github.com/billy-enrizky/openbrowser-ai.git@main openbrowser-ai web-search "OpenBrowser MCP docs" --json --output web-search-results.json
uvx --from git+https://github.com/billy-enrizky/openbrowser-ai.git@main openbrowser-ai web-search "OpenBrowser MCP docs" --urls-only --output web-search-urls.txt
uvx openbrowser-ai scrape --urls-file web-search-urls.txt --no-browser --output scraped-pages.jsonl --output-format jsonl
# OpenBrowser no-browser mode: no Chrome, Blink, or V8 process
uvx openbrowser-ai scrape https://example.com --no-browser --format markdown
uvx openbrowser-ai scrape https://example.com --format json --selector "article"
uvx openbrowser-ai scrape https://example.com --render-mode no-render
# One-shot task with lightweight rendering
uvx openbrowser-ai --render-mode lightweight -p "Read the page title"
# One-shot task without screenshots or visual-only actions
uvx openbrowser-ai --no-render -p "Read the page title"
# Batch scrape with bounded HTTP concurrency
uvx openbrowser-ai scrape https://a.example https://b.example --jsonl --concurrency 8
uvx openbrowser-ai scrape --urls-file urls.txt --output results.jsonlscrape accepts multiple URLs or a file with one URL per line. Use --output-format json or --output-format jsonl to select batch output. A .jsonl output path selects JSONL by default. Each result records its URL, success state, engine, content or error, duration, and timing. One failed URL does not stop the batch.
--no-browser is OpenBrowser no-browser mode. It starts no Chrome, Blink, or V8 process and stays on the HTTP path. JavaScript, screenshots, and browser cookies are unavailable on this path. The asset flags --no-css, --no-images, --no-fonts, --no-media, and --render-mode control the browser fallback and leave the no-browser HTTP path unchanged. Use the default auto engine or --engine browser when a page needs JavaScript.
In CodeAgent and MCP execution, call await scrape_pages(urls, concurrency=4). HTTP requests run concurrently up to the limit. Browser fallbacks run sequentially, and each URL returns its own result.
openbrowser-ai web-search prints a compact table by default. Use --json for a JSON array or --urls-only to write one URL per line. Search snippets are discovery previews. Scrape and read each source page before you cite it. The package caps max_results at 20.
The Python API exports synchronous web_search and asynchronous aweb_search from openbrowser.web_search. The openbrowser-ai web-search command calls this client directly in process. Both functions return typed WebSearchResult values with title, url, and snippet fields. Provider failures raise WebSearchError. The error recommends browser web search as a fallback. The legacy openbrowser.search module and its search and asearch names remain as compatibility aliases.
from openbrowser.web_search import web_search
results = web_search("OpenBrowser MCP", max_results=5)Inside an async function, import and await aweb_search:
from openbrowser.web_search import aweb_search
results = await aweb_search("OpenBrowser MCP", max_results=5)The render modes are full, lightweight, and no-render. Full mode uses normal browser rendering. Lightweight mode blocks images, web fonts, and media. No-render mode disables screenshots and visual-only actions. For one-shot prompt runs, pass --render-mode or use --no-render as a shortcut for --render-mode no-render. The scrape command accepts --render-mode. --lightweight selects lightweight rendering.
3.7. pipx
pipx install openbrowser-ai3.8. From source
git clone https://github.com/billy-enrizky/openbrowser-ai.git
cd openbrowser-ai
uv venv --python 3.12
source .venv/bin/activate
uv pip install -e ".[all]"3.9. Optional Dependencies
pip install openbrowser-ai # CLI, MCP, Agent, and CodeAgent (base package)
pip install openbrowser-ai[all] # Optional providers plus the interactive CLI
pip install openbrowser-ai[anthropic] # Anthropic Claude
pip install openbrowser-ai[groq] # Groq
pip install openbrowser-ai[ollama] # Ollama (local models)
pip install openbrowser-ai[aws] # AWS Bedrock
pip install openbrowser-ai[azure] # Azure OpenAI
pip install openbrowser-ai[video] # Video recording supportNo separate browser install needed. OpenBrowser auto-detects any installed Chromium-based browser (Chrome, Edge, Brave, Chromium) and uses it directly. If none is found and
uvxis available, Chromium is installed automatically on first run. To pre-install manually (requiresuvx):openbrowser-ai install
4. Quick Start
4.1. Basic Usage
import asyncio
from openbrowser import CodeAgent, ChatGoogle
async def main():
agent = CodeAgent(
task="Go to google.com and search for 'Python tutorials'",
llm=ChatGoogle(model="gemini-3-flash-preview"),
)
session = await agent.run()
print(f"Result: {agent.status.result}")
print(f"Executed cells: {len(session.cells)}")
asyncio.run(main())By default, CodeAgent keeps generated files under a unique temporary agent
directory. Pass file_system=FileSystem(base_dir=...) when a stable path is
required. Constructing FileSystem clears <base_dir>/openbrowser_agent_data,
so keep that subdirectory disposable or use a fresh base directory per run.
4.2. With Different LLM Providers
from openbrowser import CodeAgent, ChatOpenAI, ChatAnthropic, ChatGoogle
# OpenAI
agent = CodeAgent(task="...", llm=ChatOpenAI(model="gpt-5.2"))
# Anthropic
agent = CodeAgent(task="...", llm=ChatAnthropic(model="claude-sonnet-4-6"))
# Google Gemini
agent = CodeAgent(task="...", llm=ChatGoogle(model="gemini-3-flash-preview"))4.3. Using Browser Session Directly
import asyncio
from openbrowser import BrowserSession, BrowserProfile
async def main():
profile = BrowserProfile(
headless=True,
viewport={"width": 1920, "height": 1080},
)
session = BrowserSession(browser_profile=profile)
await session.start()
await session.navigate_to("https://example.com")
screenshot = await session.take_screenshot()
await session.stop()
asyncio.run(main())await session.navigate_to(url) waits for the document's load milestone. Use keyword options such as wait_until="domcontentloaded" and timeout_ms=10000 to choose another milestone and deadline. Supported milestones are commit, domcontentloaded, load, and Chromium's networkIdle lifecycle event through wait_until="networkidle". They do not establish application hydration or business-task completion.
Cancelling navigate_to() cancels that request without replaying navigation. An overlapping request raises NavigationBusyError. Wait for the active request to finish before trying again. A download handoff still returns None and is recorded as download. session.lifecycle_snapshot()["navigation"] reports the active or last operation, including its requested URL, observed URL, generation, phase, and error.
When CodeAgent extracts an initial URL from its task, it awaits the registered navigate action without an additional fixed delay. The default action awaits the navigation contract above. If you replace navigate with a custom action, that action must await the readiness your task needs before returning. CodeAgent does not add a load or hydration check after a custom action returns, even if the action waits only for commit.
5. Configuration
5.1. Config file lifecycle
OpenBrowser reads config.json from OPENBROWSER_CONFIG_PATH, then OPENBROWSER_CONFIG_DIR/config.json, then XDG_CONFIG_HOME/openbrowser/config.json. Run uvx openbrowser-ai config status to inspect the selected path and its state as JSON. If the selected file does not exist, the status check creates the default once.
A missing file is created once with defaults. A legacy, invalid, or unreadable file is never rewritten automatically. Browser startup is blocked with a stable config_* error code and a repair hint. If you can fix the file in place, do that and restart any running daemon or MCP server. If you want a fresh default, move the file to a unique backup name first. Moving it aside creates a new default on the next start and does not migrate the old settings. Keep the backup because it may contain proxy credentials or API keys.
uvx openbrowser-ai config status
# Move the exact "path" value reported by the command. Do not assume the default path.
mv <path-from-status> <path-from-status>.invalid.$(date +%Y%m%d%H%M%S)
uvx openbrowser-ai config statusdaemon status and MCP get_status include an additive config block with the startup snapshot, current snapshot, and restart_required. A long-lived daemon or MCP process does not hot reload config.
When a profile is present, both status surfaces include profile.resolution. Daemon status resolves the profile before the first browser start. MCP get_status includes it after the context has resolved its profile. Each entry has a source key plus a value, or a mode and optional count. The source is default, config, environment, managed, or cli. Paths, booleans, channel, executable, download path, action delay, scale factor, and security mode report a value. Storage state, proxy, and launch arguments report only a mode and source, with an argument count for args, so cookies, proxy credentials, and argument values stay out of status.
When a browser session exists, status includes browser.cdp with the root connection phase, client presence, last probe time and latency, a closed error code, and any pending cleanup. cdp.healthy is the last accepted connect or probe observation while the lifecycle preserves an active health claim. An inactive snapshot can report null and keeps the history fields. Use cdp.last_probe_at to tell whether a probe has run and how recent it is. cdp.phase is one of disconnected, resolving, connecting, connected, degraded, or failed. cdp.last_error_code is null or one of not_connected, timeout, connection_closed, session_not_found, probe_failed, connect_failed, or cancelled. session_not_found can come from target attachment during connect setup as well as the root probe. cdp_connected is a legacy pointer-presence alias. Read cdp.healthy for the health result. Root CDP health covers the root connection. A target session, tab, or page can still fail. Daemon status reports the last observation without probing. MCP probes an existing session before execution when time remains, while get_status itself stays read-only and does not probe or start a browser.
The same status surfaces add browser.health when a session exists. health.phase is unknown, healthy, degraded, crashed, stopped, or failed. The block records page-target crash history, the latest focus-recovery outcome, and a status-time local process check. health.healthy=true means setup or focus recovery was observed. A page read shows the current page state. Hydration and target readiness can differ. process_present is null when the published CDP root is not bound to the recorded local owner, or when process identity is inconclusive. That includes remote browsers, stopped sessions, and ambiguous PID reuse. health never performs a page probe or starts a browser. A status response without health means no browser session exists.
5.2. Environment Variables
# Google (recommended)
export GOOGLE_API_KEY="..."
# OpenAI
export OPENAI_API_KEY="sk-..."
# Anthropic
export ANTHROPIC_API_KEY="sk-ant-..."
# Groq
export GROQ_API_KEY="gsk_..."
# AWS Bedrock
export AWS_ACCESS_KEY_ID="..."
export AWS_SECRET_ACCESS_KEY="..."
export AWS_DEFAULT_REGION="us-west-2"
# Azure OpenAI
export AZURE_OPENAI_API_KEY="..."
export AZURE_OPENAI_ENDPOINT="https://your-resource.openai.azure.com/"5.3. BrowserProfile Options
from openbrowser import BrowserProfile
profile = BrowserProfile(
headless=True,
viewport={"width": 1280, "height": 720},
disable_security=False,
extra_chromium_args=["--disable-gpu"],
record_video_dir="./recordings",
proxy={
"server": "http://proxy.example.com:8080",
"username": "user",
"password": "pass",
},
)6. Supported LLM Providers
Provider | Class | Models |
| gemini-3-flash-preview, gemini-3-pro | |
OpenAI |
| gpt-5.2, o4-mini, o3 |
Anthropic |
| claude-sonnet-4-6, claude-opus-4-6 |
Groq |
| llama-4-scout, qwen3-32b |
AWS Bedrock |
| anthropic.claude-sonnet-4-6, amazon.nova-pro |
AWS Bedrock (Anthropic) |
| Claude models via Anthropic Bedrock SDK |
Azure OpenAI |
| Any Azure-deployed model |
OpenRouter |
| Any model on openrouter.ai |
DeepSeek |
| deepseek-chat, deepseek-r1 |
Cerebras |
| llama-4-scout, qwen-3-235b |
Ollama |
| llama-4-scout, deepseek-r1 (local) |
OCI |
| Oracle Cloud GenAI models |
Browser-Use |
| External LLM service |
7. Claude Code Plugin
Install OpenBrowser as a Claude Code plugin:
# Add the marketplace (one-time)
claude plugin marketplace add billy-enrizky/openbrowser-ai
# Install the plugin
claude plugin install openbrowser@openbrowser-aiThis installs the MCP server and 8 built-in skills:
Skill | Description |
| Install the CLI and browser, configure MCP and profiles, and verify a real session |
| Conduct cited, multi-source web research and produce markdown and JSON reports |
| Extract structured data, handle pagination |
| Fill forms, login flows, multi-step wizards |
| Test web apps by simulating user interactions |
| Analyze page content, structure, metadata |
| Audit pages for WCAG compliance |
| Download files (PDFs, CSVs) using browser session |
See plugin/README.md for detailed tool parameter documentation.
8. skills.sh
Install the OpenBrowser skill pack with the skills.sh CLI:
npx skills add billy-enrizky/openbrowser-aiInstall only the first-time setup skill:
npx skills add billy-enrizky/openbrowser-ai --skill setup -a codexThe pack includes setup, deep-research, web-scraping, form-filling, e2e-testing, page-analysis, accessibility-audit, and file-download. These commands install skill definitions. They do not run the setup workflow. After installation, invoke the setup skill to install the CLI and Chromium, configure MCP and profiles, and verify a real browser session. Skills are installed to the current project by default. Add -g for all projects.
9. Codex
OpenBrowser works with OpenAI Codex via native skill discovery.
9.1. Quick Install
Tell Codex:
Fetch and follow instructions from https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/refs/heads/main/.codex/INSTALL.md9.2. Manual Install
# Clone the repository
git clone https://github.com/billy-enrizky/openbrowser-ai.git ~/.codex/openbrowser
# Symlink skills for native discovery
mkdir -p ~/.agents/skills
ln -s ~/.codex/openbrowser/plugin/skills ~/.agents/skills/openbrowser
# Restart CodexThen configure the MCP server in your project (see MCP Server below).
Detailed docs: .codex/INSTALL.md
10. OpenCode
OpenBrowser works with OpenCode.ai via plugin and skill symlinks.
10.1. Quick Install
Tell OpenCode:
Fetch and follow instructions from https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/refs/heads/main/.opencode/INSTALL.md10.2. Manual Install
# Clone the repository
git clone https://github.com/billy-enrizky/openbrowser-ai.git ~/.config/opencode/openbrowser
# Create directories
mkdir -p ~/.config/opencode/plugins ~/.config/opencode/skills
# Symlink plugin and skills
ln -s ~/.config/opencode/openbrowser/.opencode/plugins/openbrowser.js ~/.config/opencode/plugins/openbrowser.js
ln -s ~/.config/opencode/openbrowser/plugin/skills ~/.config/opencode/skills/openbrowser
# Restart OpenCodeThen configure the MCP server in your project (see MCP Server below).
Detailed docs: .opencode/INSTALL.md
11. OpenClaw
OpenClaw supports OpenBrowser via the CLI daemon. Install OpenBrowser,
then use openbrowser-ai -c from the Bash tool:
Before a sequence of calls, run openbrowser-ai warm once to start the daemon and browser.
openbrowser-ai warm
openbrowser-ai -c "await navigate('https://example.com')"
openbrowser-ai -c "print(await evaluate('document.title'))"The daemon starts automatically on first use and persists variables across calls.
For OpenClaw plugin documentation, see docs.openclaw.ai/tools/plugin.
12. MCP Server
OpenBrowser includes an MCP (Model Context Protocol) server that exposes browser automation as tools for AI assistants like Claude. Listed on the MCP Registry as me.openbrowser/openbrowser-ai. The default stdio transport is a lean JSON-RPC loop that answers discovery and the tool catalog before it imports the MCP SDK. It negotiates protocol version 2026-07-28 with modern clients. Set OPENBROWSER_MCP_TRANSPORT=sdk to use the MCP SDK 2.3 escape hatch. Invalid values exit with code 2. No external LLM API keys required: the MCP client provides the intelligence.
By default, each modern MCP context uses an isolated managed profile under ~/.config/openbrowser/profiles/mcp-<owner-id>. The legacy no-handle owner uses mcp-<server-instance-id>. The owner ID is internal. Read the resolved path from get_status.profile.user_data_dir. The context_id handle is separate. The profile's storage_state.json is seeded once from ~/.config/openbrowser/profiles/default/storage_state.json, so existing logins are available without allowing concurrent contexts to kill or corrupt one another's browser. Profiles are retained on disk after close_context. A new MCP server process cannot resume a context handle, and it creates a new isolated profile unless you configure an explicit shared profile. Configure OPENBROWSER_USER_DATA_DIR for a profile that survives restarts. OPENBROWSER_STORAGE_STATE is a one-time seed for managed profiles. Later changes are saved to the active profile copy. OpenBrowser also auto-cleans disposable Chromium caches in managed profiles, which keeps disk usage down without deleting cookies or login state. If you explicitly configure the same OPENBROWSER_USER_DATA_DIR for multiple contexts or servers, the profile lease rejects the second owner with a clear error.
12.1. Quick Setup
Claude Code: add to your project's .mcp.json:
{
"mcpServers": {
"openbrowser": {
"command": "uvx",
"args": ["openbrowser-ai", "--mcp"]
}
}
}Claude Desktop: add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"openbrowser": {
"command": "uvx",
"args": ["openbrowser-ai", "--mcp"],
"env": {
"OPENBROWSER_HEADLESS": "true"
}
}
}
}Run directly:
uvx openbrowser-ai --mcpSet OPENBROWSER_RENDER_MODE to full, lightweight, or no-render to choose the policy for new MCP contexts. The default is full.
12.2. Tools
The MCP server exposes seven tools to modern 2026-07-28 clients and four tools to the legacy handshakes 2024-11-05, 2025-03-26, 2025-06-18, and 2025-11-25. Both catalogs include the stateless web_search tool. The modern catalog adds stateless scrape_web, which fetches one HTTP(S) page in OpenBrowser no-browser mode: it starts no Chrome, Blink, or V8 process and stays on the HTTP path. JavaScript, screenshots, and browser cookies are unavailable on this path.
create_contextcreates an isolated context and returns a server-mintedcontext_id. It does not start a browser until the firstexecute_codecall.execute_coderuns Python code in the namespace for one context. Modern calls requirecontext_id.get_statusreturns server, context, browser, profile, tab, tools, downloads, storage-state, namespace-transfer, and config state as JSON. It includestoolsavailability anddownloads(count,pending,recent,pdf_detection). It is read-only and does not start a browser.reset_browsercloses a stuck browser and preserves scalar and scalar-only container variables unlessclear_variablesis true. Inspectnamespace_transfer.droppedfor names that could not be carried. Cookies and localStorage survive because the profile is reused.close_contextcloses one context and releases its browser and profile. The handle cannot be used after a successful close.web_searchsearches the web with the package-native DDGS client and returns a JSON array. It needs nocontext_idand does not start a browser. Treat snippets as previews. Scrape and read source pages before citing them.scrape_webfetches one static HTTP(S) page without a browser orcontext_id. This is OpenBrowser no-browser mode: it starts no Chrome, Blink, or V8 process and stays on the HTTP path. JavaScript, screenshots, and browser cookies are unavailable on this path. Useexecute_codefor JavaScript pages.
A context is process-local. It lives until close_context or server exit. A new MCP server process cannot resume it.
The browser session closes after 10 minutes without an execute_code call. get_status does not refresh that timer. The context handle and scalar variables remain available. The next execute_code call starts a fresh browser.
A successful close_context invalidates the handle. If cleanup fails, the result is close_failed with a retryable flag. Retry close_context to finish cleanup. The handle cannot run execute_code, get_status, or reset_browser after a failed close. New calls while closing fail with context_closing. Calls after failed close fail with context_close_failed.
Clients that negotiate 2024-11-05, 2025-03-26, 2025-06-18, or 2025-11-25 see four tools: execute_code, get_status, reset_browser, and web_search. The catalog includes stateless web_search and uses a legacy no-handle context. OpenBrowser rejects other protocol versions with MCP error -32602.
A modern stateful request without context_id fails before it affects a browser. create_context does not need a handle. The default limit is 16 open contexts, including the legacy context. Set OPENBROWSER_MCP_MAX_CONTEXTS to change the limit.
If a browser connection fails, call get_status before retrying. Do not replay a page-changing action blindly because the first attempt may have partially run.
Read browser.health after a crash or connection failure. phase=crashed means the local process bound to the current root is missing or no longer matches its recorded identity. phase=degraded records a page-target crash and reports recovery as not_attempted, pending, succeeded, or failed. Wait while recovery is pending. After a failed recovery, inspect focus.last_error and reset only when no usable target exists. Use focus and tabs for target-specific state. A missing health block means no context has a browser session.
Available functions (use await unless noted):
Category | Functions |
Navigation |
|
Interaction |
|
Coordinate interaction |
|
Dropdowns |
|
Tabs |
|
JavaScript |
|
Downloads |
|
State |
|
CSS |
|
Completion |
|
Prefer indexed actions whenever an element index exists. Coordinate actions use CSS viewport pixels. If a screenshot uses a devicePixelRatio other than 1, divide its coordinates by window.devicePixelRatio before calling an *_xy function.
Bundled libraries: json, csv, re, datetime, asyncio, Path, requests, numpy, pandas. Only if installed: matplotlib, BeautifulSoup, pypdf (openbrowser-ai[pdf]), tabulate.
12.3. Configuration
Environment Variable | Description | Default |
| Stdio implementation: |
|
| Run browser without GUI |
|
| Comma-separated domain whitelist | (none) |
| Optional explicit Chrome profile directory. Omit it for one managed profile per context; concurrent owners are rejected | (auto: |
| Optional JSON file used as a one-time seed for cookies plus localStorage in managed MCP profiles | (auto: per-context copy, seeded from |
| Minimal tool description (~500 tokens) |
|
| Max output characters per execution |
|
| Browser startup bound in seconds |
|
| Seconds before a tool call returns a timeout result |
|
| Maximum open contexts total, including the legacy no-handle context |
|
| Base directory for per-context workspaces |
|
| Browser and context cleanup bound in seconds |
|
| Set to |
|
13. Benchmark: Native Local Lanes
Section 13.1 reports the current native local baseline. For a local, no-LLM comparison with pinned runtimes and verified page work, use the navigation comparison verifier. It reports engine, IPC, wait-policy, failure, and cleanup differences. Read it as a navigation-lane result.
13.1. Native Local Benchmarks (2026-11-25)
Local deterministic fixtures, no LLM, and interleaved samples with exact oracles. The full method, raw JSONL, and host-load caveats are in benchmarks/scraping/README.md and benchmarks/interactive/README.md. Build and host are recorded in each raw artifact. The figures below are the last clean tracked N=5 run.
Sequential scraping, N=10, OpenBrowser lightweight against Firecrawl Local 0.1.1:
Task | OpenBrowser p50 | Firecrawl Local p50 | Result | Pairs won |
| 0.7 ms | 1.2 ms | OpenBrowser 1.7x | 10/10 |
| 2.9 ms | 4.4 ms | OpenBrowser 1.5x | 10/10 |
| 1.1 ms | 2.9 ms | OpenBrowser 2.6x | 10/10 |
| 15.1 ms | 556.4 ms | OpenBrowser 36.8x | 10/10 |
| 17.1 ms | 570.7 ms | OpenBrowser 33.4x | 10/10 |
OpenBrowser lightweight won 50 of 50 paired samples. The full arm won 49 of 50, with one static sample 0.13 ms slower. The batch surface measured 2.834 ms against Firecrawl Local batch at 13.448 ms, a 4.75x win in 10 of 10 pairs, with no browser started.
Memory depends on the surface. Values are process-tree RSS on a local fixture:
Path | p50 latency | p50 peak process-tree RSS (MiB) |
OpenBrowser no-browser mode, static scrape | 142.7 ms | 47.6 MiB |
JavaScript scrape, headless shell | 940.1 ms | 355.4 MiB |
JavaScript scrape, full Chrome | 1296.0 ms | 742.4 MiB |
The scrape browser fallback uses the Playwright headless shell by default. OPENBROWSER_USE_HEADLESS_SHELL=0 restores full Chrome.
Warm interactive v2, N=5, rotated arm order. Latency (ms) ↓ Lower is better.
Warm-session readiness uses the native session workflow with OpenBrowser app 5a88fb97. Each arm starts once and every task gets a fresh fixture server. All 100 observations passed the adapter, exact oracle, and keychain checks. Warm tables show milliseconds to three decimal places. The raw file keeps full precision.
Task | OpenBrowser MCP p50 ms | OpenBrowser CLI p50 ms | chrome-devtools-mcp p50 ms | agent-browser p50 ms | browser-use p50 ms |
| 43.555 | 88.456 | 3441.495 | 451.787 | 471.800 |
| 199.144 | 244.149 | 2716.979 | 1095.635 | 912.795 |
| 332.502 | 384.810 | 767.921 | 414.847 | 558.928 |
| 62.077 | 113.553 | 1453.474 | 359.101 | 194.579 |
Both OpenBrowser arms have the lowest warm p50 on all four tasks. Each arm won all 60 eligible pairs, for 120 of 120 total. The auth task is cold only because it restarts the browser.
Raw data, summary, and method provenance.
Cold interactive release baseline, N=5, rotated arm order, lower is better. The timer measures time to result. Final adapter cleanup runs once outside the timed interval for every arm.
Task | OpenBrowser MCP p50 | OpenBrowser CLI p50 | chrome-devtools-mcp p50 | agent-browser p50 | browser-use p50 |
| 569 ms | 677 ms | 4312 ms | 1573 ms | 1111 ms |
| 725 ms | 841 ms | 3471 ms | 2304 ms | 1744 ms |
| 860 ms | 963 ms | 1513 ms | 1484 ms | 1126 ms |
| 593 ms | 683 ms | 2220 ms | 1393 ms | 797 ms |
| 1305 ms | 1604 ms | 3703 ms | 2506 ms | 2476 ms |
In the cold release baseline, both OpenBrowser arms have the lowest p50 on all five tasks and won 5 of 5 pairs against every other framework. All 125 runs passed the exact oracle and keychain check.
Interactive resource lane, N=5: both OpenBrowser arms have the lowest median child footprint, process-tree RSS, and CPU on all five tasks. Both arms won all 150 eligible pairs per metric. Every cell is N=5 and all 125 observations passed. See the charted comparison.
13.2. Why OpenBrowser is faster and more efficient
The measured paths use four areas of work.
Request grouping and state reuse. The interactive MCP and CLI arms group several browser actions into one Python request for most tasks. The
authtask uses a login program and an account program around the browser restart. A request can hold several actions and persistent variables. The namespace loads optional libraries on first use. Warm CLI calls use a small standard-library client over IPC, and cold CLI startup loads the full client.Lean MCP entry. The lean stdio transport reads generated definitions for discovery. Stateful application setup stays lazy, and stateless tools use a direct path. The SDK escape hatch uses a different import path. Stateful task startup still includes browser and application work.
Strict HTTP. Explicit
--no-browserandengine="http"fetch and parse static pages in a Python process. CLI and namespace batches reuse one pooled HTTP client with bounded concurrency. The stateless MCPscrape_webcall creates a one-shot client per call.Targeted browser work. Task scripts use selector and CDP helpers for known targets, which avoids a full DOM scan for those operations. Lightweight and no-render policies block selected asset types. The browser still loads Chromium, Blink, and V8.
The tables above show the effect. The warm lane reaches 43.555 ms p50 on wizard with one long-lived MCP context. The cold lane puts both OpenBrowser arms lowest on all five tasks. The Firecrawl Local batch is 2.834 ms against 13.448 ms, a 4.75x p50 result. OpenBrowser lightweight won 50 of 50 sequential scraping pairs against Firecrawl Local.
Other frameworks also reuse sessions and batch work. These lanes measure the configured combination. The page assigns no causal share to one mechanism without an ablation. The Firecrawl Local batch uses a 10 ms job-poll workflow and returns markdown pages; OpenBrowser returns selected row dictionaries. A matched single-call Firecrawl Local memory lane remains open, as do model-driven Agent and CodeAgent lanes and matched Lightpanda cold and warm lanes.
14. CLI Usage
# Run a browser automation task with an LLM agent
uvx openbrowser-ai -p "Search for Python tutorials on Google"
# Execute code directly via persistent daemon
uvx openbrowser-ai -c "await navigate('https://example.com')"
uvx openbrowser-ai -c "print(await evaluate('document.title'))"
# Daemon management
uvx openbrowser-ai warm # Start the daemon and browser before the first timed call
uvx openbrowser-ai daemon ensure # Start or restart a daemon that matches the requested headless and profile settings
uvx openbrowser-ai daemon start # Start, or restart a daemon whose profile or headless mode differs (auto-starts on first -c call)
uvx openbrowser-ai daemon stop # Request shutdown; poll status or use force-stop to verify
uvx openbrowser-ai daemon force-stop # Force-stop the current endpoint after verifying the owner
uvx openbrowser-ai daemon status # Show lifecycle, profile, browser, and tab state
uvx openbrowser-ai daemon reset # Close the browser but keep the daemon process
uvx openbrowser-ai daemon doctor # Diagnose socket, PID, profile, and log state
uvx openbrowser-ai daemon list # List sockets and this user's daemon processes
uvx openbrowser-ai daemon reap # Stop verified daemons and reap orphaned daemon processes
uvx openbrowser-ai daemon restart # Restart daemon
# OpenBrowser no-browser mode: no Chrome, Blink, or V8 process
uvx openbrowser-ai scrape https://example.com --no-browser --only-main-content
uvx openbrowser-ai map https://docs.example.com --max-urls 50
uvx openbrowser-ai crawl https://docs.example.com --max-pages 20 --max-depth 2
# Install browser
uvx openbrowser-ai install
# Run MCP server
uvx openbrowser-ai --mcpBefore a sequence of -c calls, run openbrowser-ai warm once to start the daemon and browser:
openbrowser-ai warmThen run the calls in the same environment. The daemon keeps Python variables between calls while it remains running.
Use --render-mode full, --render-mode lightweight, or --render-mode no-render to choose a rendering policy for a one-shot run, or --no-render as a shortcut for the last one. No-render mode disables screenshots and visual-only actions. For asset control without changing the mode, use --text-only to block external CSS, images, fonts, media, and text tracks while keeping scripts and screenshots, or one of --no-css, --no-images, --no-fonts, --no-media, --no-scripts. The scrape command accepts --no-css, --no-images, --no-fonts, --no-media, and --render-mode. --no-scripts is available on the one-shot prompt interface. The scrape browser fallback uses the Playwright headless shell by default. Set OPENBROWSER_USE_HEADLESS_SHELL=0 to force full Chrome.
The -c flag connects to a persistent browser daemon over a Unix socket (localhost TCP on Windows). Variables persist across calls while the daemon is running. The daemon starts automatically on first use and shuts down after 10 minutes of inactivity.
After a browser failure, run openbrowser-ai daemon status before retrying because the first call may have partially run. Read browser.health for the last crash, focus-recovery, and local process observation. health is not a live page-readiness probe. Wait while recovery is pending. After a failed recovery, use openbrowser-ai daemon reset only when no usable target exists. Reset clears the Python executor and namespace, so persist values first.
The CLI daemon stores its browser profile in ~/.config/openbrowser/profiles/daemon, so cookies and login sessions survive daemon restarts through Chrome's user-data directory. An explicit storage_state path is still loaded when configured. Custom sockets share the default profile by default to preserve existing logins. Set OPENBROWSER_DAEMON_PROFILE_ISOLATION=true or OPENBROWSER_DAEMON_PROFILE_DIR when several daemons must run with separate profiles. OPENBROWSER_USER_DATA_DIR takes precedence over both and always selects that explicit profile. One-shot -p runs use ~/.config/openbrowser/profiles/cli. Managed profiles automatically clear disposable browser caches on startup and shutdown while keeping auth state.
Execution defaults to 110 seconds so an agent with a 120 second tool timeout receives a structured timeout response. Override it with OPENBROWSER_EXEC_TIMEOUT and set OPENBROWSER_READ_TIMEOUT above that value if you need longer calls. OPENBROWSER_DAEMON_INIT_TIMEOUT bounds browser startup. OPENBROWSER_SHUTDOWN_TIMEOUT bounds inner session cleanup, while the daemon reset/stop wrapper waits up to 5 seconds. OPENBROWSER_IDLE_TIMEOUT changes the 600-second idle shutdown. The daemon downloads to ~/Downloads/openbrowser-daemon by default, and those files survive daemon stop.
15. Project Structure
openbrowser-ai/
├── .claude-plugin/ # Claude Code marketplace config
├── .codex/ # Codex integration
│ └── INSTALL.md
├── .opencode/ # OpenCode integration
│ ├── INSTALL.md
│ └── plugins/openbrowser.js
├── plugin/ # Plugin package (skills + MCP config)
│ ├── .claude-plugin/
│ ├── .mcp.json
│ └── skills/ # 8 guided skills
├── src/openbrowser/
│ ├── __init__.py # Main exports
│ ├── cli.py # CLI commands
│ ├── config.py # Configuration
│ ├── actor/ # Element interaction
│ ├── agent/ # LangGraph agent
│ ├── browser/ # CDP browser control
│ ├── code_use/ # Code agent + shared executor
│ ├── daemon/ # Persistent browser daemon (Unix socket)
│ ├── dom/ # DOM extraction
│ ├── llm/ # LLM providers
│ ├── mcp/ # MCP server
│ └── tools/ # Action registry
├── benchmarks/ # Interactive and scraping harnesses
│ ├── interactive/ # Cold, warm, and resource lanes
│ ├── scraping/ # Firecrawl, Lightpanda, and no-browser lanes
│ └── e2e_published_test.py # Published PyPI package E2E test
└── tests/ # Test suite16. Testing
# Run unit tests
pytest tests/
# Run with verbose output
pytest tests/ -v
# E2E test the MCP server against the published PyPI package
uv run python benchmarks/e2e_published_test.py16.1. Benchmarks
Run the current native harnesses. See the benchmark guides for tasks, exact oracles, raw evidence, and host-load caveats:
uv run --locked python -m benchmarks.interactive.run_benchmark --help
uv run --locked python benchmarks/scraping/scrape_compare.py --helpCurrent native evidence is on Benchmark Comparison.
17. Backend and Frontend Deployment
The project includes a FastAPI backend and a Next.js frontend, both containerized with Docker.
17.1. Prerequisites
Docker and Docker Compose
A
.envfile in the project root withPOSTGRES_PASSWORDand any LLM API keys (seebackend/env.example)
17.2. Local Development (Docker Compose)
# Start backend + PostgreSQL (frontend runs locally)
docker-compose -f docker-compose.dev.yml up --build
# In a separate terminal, start the frontend
cd frontend && npm install && npm run devService | URL | Description |
Backend | FastAPI + WebSocket + VNC | |
Frontend | Next.js dev server | |
PostgreSQL | localhost:5432 | Chat persistence |
VNC | ws://localhost:6080 | Live browser view |
The dev compose mounts backend/app/ and src/ as volumes for hot-reload. API keys are loaded from backend/.env via env_file. The POSTGRES_PASSWORD is read from the root .env file.
17.3. Full Stack (Docker Compose)
# Start all services (backend + frontend + PostgreSQL)
docker-compose up --buildThis builds and runs both the backend and frontend containers together with PostgreSQL.
17.4. Backend
The backend is a FastAPI application in backend/ with a Dockerfile at backend/Dockerfile. It includes:
REST API on port 8000
WebSocket endpoint at
/wsfor real-time agent communicationVNC support (Xvfb + x11vnc + websockify) for live browser viewing on ports 6080-6090
Kiosk security: Openbox window manager, Chromium enterprise policies, X11 key grabber daemon
Health check at
/health
# Build the backend image
docker build -f backend/Dockerfile -t openbrowser-backend .
# Run standalone
docker run -p 8000:8000 -p 6080:6080 \
--env-file backend/.env \
-e VNC_ENABLED=true \
-e AUTH_ENABLED=false \
--shm-size=2g \
openbrowser-backend17.5. Frontend
The frontend is a Next.js application in frontend/ with a Dockerfile at frontend/Dockerfile.
# Build the frontend image
cd frontend && docker build -t openbrowser-frontend .
# Run standalone
docker run -p 3000:3000 \
-e NEXT_PUBLIC_API_URL=http://localhost:8000 \
-e NEXT_PUBLIC_WS_URL=ws://localhost:8000/ws \
openbrowser-frontend17.6. Environment Variables
Key environment variables for the backend (see backend/env.example for the full list):
Variable | Description | Default |
| Google/Gemini API key | (required) |
| Default model for agents |
|
| Enable Cognito JWT auth |
|
| Enable VNC browser viewing |
|
| PostgreSQL connection string | (optional) |
| PostgreSQL password (root | (required for compose) |
18. Research: Reinforcement Fine-Tuning for Browser Agents
Beyond the framework, we conducted two independent research studies on improving browser agents through reinforcement learning, both using the FormFactory benchmark (1,250 form-filling tasks across 8 domains) and OpenBrowser's browser execution environment.
18.1. Study 1: Browser-in-the-Loop (Autoregressive RL)
We investigated whether reinforcement learning can improve a language model's ability to fill web forms beyond what supervised learning achieves.
Method: Two-phase pipeline -- SFT on Qwen3-8B with QLoRA (992 demonstrations), then online GRPO with live browser execution rewards (composite: 40% submission success + 40% field accuracy + 20% execution completeness)
Result: GRPO achieves 9.1% higher average reward than SFT alone on held-out validation (p=0.007, Wilcoxon signed-rank test). Form submission accounts for the reported improvement.
Key finding: SFT is a prerequisite -- without it, the base model generates unstructured text and earns zero reward across all attempts.
Paper: Browser-in-the-Loop: Reinforcement Fine-Tuning LLM Agents for Web Form Filling
Models: Qwen3-8B-FormFactory-SFT-LoRA, Qwen3-8B-FormFactory-GRPO-LoRA
18.2. Study 2: Diffusion Language Models for Web Action Planning
We investigated whether diffusion language models -- which generate text by iteratively denoising an entire sequence in parallel -- can learn web action planning.
Models tested: ReFusion 8B (masked diffusion with causal LM backbone) and FS-DFM 1.3B (pure discrete flow matching)
Result: After SFT, diffusion models solve 60-69% of tasks vs. 100% for the AR baseline. Token-level RL is universally fragile (2/16 comparisons improve, both insignificant). Sequence-level RL succeeds: MDPO pushes ReFusion to 91.9% (+31.4pp) and ESPO pushes FS-DFM to 87.1% (+18.6pp).
Key finding: The appropriate RL formulation is architecture-dependent. ELBO-based optimization (ESPO) produces concentrated distributions across architectures, while per-step trajectory methods produce multimodal distributions.
Models: 10 trained models on HuggingFace including ReFusion-8B-MDPO, FS-DFM-1.3B-ESPO-mu8, and more
18.3. Reproducing RL Experiments
All training code is in infra/training/. Training runs on a single NVIDIA A10G GPU (24GB VRAM) via Anyscale.
# Study 1: Autoregressive RL (Qwen3-8B)
# SFT phase -- QLoRA fine-tuning on 992 FormFactory demonstrations (2-4 hours)
python infra/training/finetuning/sft_trainer.py
# Online GRPO phase -- browser-in-the-loop reward (4-8 hours per epoch)
# Requires headless Chromium + FormFactory forms server
python infra/training/shared/formfactory_server.py & # Start form server
python infra/training/finetuning/online_grpo_trainer.py
# Evaluate SFT and GRPO checkpoints on val/test splits
python infra/training/finetuning/eval_sft.py
# Study 2: Diffusion LM RL (ReFusion 8B, FS-DFM 1.3B)
# SFT phase
python infra/training/flow_matching/fsdfm_sft_trainer.py # FS-DFM SFT
python infra/training/flow_matching/flow_sft_trainer.py # ReFusion SFT
# Sequence-level RL (best results)
python infra/training/flow_matching/espo_fsdfm_trainer.py # ESPO on FS-DFM
python infra/training/flow_matching/espo_refusion_trainer.py # ESPO on ReFusion
python infra/training/flow_matching/mdpo_fsdfm_trainer.py # MDPO on FS-DFM
python infra/training/flow_matching/mdpo_refusion_trainer.py # MDPO on ReFusion
# Submit jobs to Anyscale cloud
python infra/training/anyscale/submit_job.py --config infra/training/anyscale/online_grpo_job.yaml
# Push trained checkpoints to HuggingFace
python infra/training/anyscale/push_checkpoints_to_hf.py
# Serve trained model locally via vLLM or Ollama
python infra/training/serving/serve_vllm.py
python infra/training/serving/export_gguf.py # Export to GGUF for OllamaReward function (in infra/training/shared/reward_functions.py): composite score = 0.4 * task completion + 0.4 * field accuracy + 0.2 * execution completeness. Online reward (online_reward.py) launches headless Chromium, executes the model's action plan, and computes the score from live browser state.
19. Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
After CI passes, add the
merge-queuelabel. The queue tests the merge tree with the full non-integration suite and all static, frontend, and backend checks, then merges it. Direct merges tomainare blocked.
20. License
This project is licensed under the MIT License - see the LICENSE file for details.
21. Contact
Email: billy.suharno@gmail.com
GitHub: @billy-enrizky
Repository: github.com/billy-enrizky/openbrowser-ai
Documentation: https://docs.openbrowser.me
Made with love for the AI automation community
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Cloud browser, web extraction, screenshots, and remote CDP tools for AI agents.
Cloud browsers for AI agents: saved logins, residential IPs, live human takeover, 57 browser tools.
AI-powered web automation. Navigate websites using AI agents for one page or a thousand
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables AI agents to debug code and automate browsers using Chrome DevTools Protocol, supporting breakpoints, variable inspection, and replayable interaction recording.35130 npm19MIT
- AlicenseAqualityDmaintenanceEnables AI agents to control a browser with 30 tools for navigation, interaction, extraction, and tab management, supporting human-like browser automation.3614 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI coding agents to control and inspect a live Chrome browser, providing reliable automation, in-depth debugging, and performance analysis through Chrome DevTools.2,836,985 npmApache 2.0
- AlicenseBqualityBmaintenanceEnables AI agents and developers to automate real Chrome/Chromium browsers through the Chrome DevTools Protocol, with token-efficient snapshots, multi-action batching, shadow DOM traversal, system-page control, extension management, and network/WebSocket inspection.951MIT