mcpField
A
agent-browser

agent-browser

Local
github.com/codeChapBrowser Automation1Updated 3w ago

About agent-browser

agent-browser is an MCP server that wraps Vercel's agent-browser CLI to let MCP clients automate Chromium, including navigation, interaction, and screenshots. It adds session persistence and diagnostic checks for browser setup.

Key features

  1. 01Chromium navigation and interaction
  2. 02Accessibility snapshots and screenshots
  3. 03Cookie and localStorage persistence
  4. 04Page text pattern search
  5. 05Browser setup diagnostics

Use cases

  1. 01Automating form entry and page clicks
  2. 02Inspecting page structure before interaction
  3. 03Restoring login state between sessions

MCP support

Exposes browser automation tools to MCP clients over stdio, using the agent-browser CLI. Clients can navigate, interact with pages, inspect accessibility snapshots, and capture screenshots.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

mcp-server-agent-browser

Status: Beta — CLI wrapper is covered by unit tests and a fake-browser stdio smoke test. Cookie restore across a real Chromium restart is still a manual check.

Let LLMs drive a real browser. This MCP server wraps agent-browser (Vercel Labs) so any MCP client can navigate, fill forms, click, snapshot the accessibility tree, and screenshot.

It is not Grok's web_search / open_page. Those fetch documents. This one runs Chromium. Use search to find a URL, then browser_navigate.

Prerequisites

cargo install agent-browser
agent-browser install

Call browser_doctor if anything is missing.

Build

cargo build --release

Binary: target/release/mcp-server-agent-browser

cargo test
./tests/test-stdio.sh

Real Chromium login-restore is not in CI. After a headed login, restart the MCP process and confirm the next browser_navigate is still logged in.

Configuration

MCP client (stdio):

{
  "mcpServers": {
    "agent-browser": {
      "command": "/path/to/mcp-server-agent-browser"
    }
  }
}

Optional TOML at ~/.config/mcp-server-agent-browser/config.toml (see config.example.toml). Missing file uses defaults. Override the path with MCP_AGENT_BROWSER_CONFIG.

SettingDefaultMeaning
headedfalseShow a window. Launch-time only; browser_close first if a headless daemon is already up. Also AGENT_BROWSER_HEADED=1.
persisttrue--session-name <namespace>-<session_id> (default session key default). There's no --namespace CLI flag — namespace is folded into that name instead.
keep_daemonfalseIf false, MCP exit runs close so restore state is saved and Chrome does not leak.
namespacemcp-serverPrefix of the --session-name restore key, isolating this MCP's restore files from a human using the CLI directly.
command_timeout_secs120Wrapper timeout. Playwright's own 25s action timeout is left alone (CLI IPC is ~30s).
idle_timeout1hSets AGENT_BROWSER_IDLE_TIMEOUT_MS (env only — there's no --idle-timeout CLI flag). Use "0" with keep_daemon = true.
download_dir~/Downloads--download-path. ~ is expanded.
profileunsetOptional persistent Chrome user-data dir. Not your daily Chrome profile.
encryption_key_fileunsetSets AGENT_BROWSER_ENCRYPTION_KEY. Restore files are credentials; plaintext unless this is set.
AGENT_BROWSER_PATHagent-browserCLI binary.

allowed_domains is optional. Localhost is allowed unless you set a list that excludes it.

What it can do

Same interaction set as before (navigate, click, type, snapshot, screenshot, cookies, eval, CDP, sessions), plus:

  • browser_doctor — CLI, config, persist, headed/DISPLAY, daemon guess. Does not launch Chrome.
  • browser_get_text pattern — regex over page text with two lines of context.
  • browser_wait — load / url / text as well as a selector.

Typical loop:

  1. browser_navigate
  2. browser_snapshot (-i for interactive)
  3. browser_click / browser_fill with @refs
  4. browser_screenshot if you need pixels

Persistence

With persist = true (default), each session saves cookies and localStorage on close and on the CLI's autosave interval. State lives under ~/.agent-browser/, namespaced to mcp-server. Isolated session_ids do not share a restore key.

Headed login once, browser_close or exit the MCP, start again. The next navigate should restore that session.

A killed MCP process may leave the daemon running. browser_doctor reports that. Idle shutdown still saves if persist is on.

Limitations

  • Chromium via agent-browser (Playwright). No search.
  • Headed is ignored until the existing daemon is closed.
  • Snap Chromium on Ubuntu can fail to advertise its DevTools port; prefer agent-browser install's browser or executable_path.
  • Writes (screenshot, pdf, download) must be relative, under /tmp, or under download_dir.
  • Element screenshots take a CSS selector or @ref, plus a trailing :has-text("..."). The selector is checked first, so a miss is an error, not a silent full-viewport shot. Not combinable with full_page.
  • 25s Playwright action timeout is an upstream CLI limit, not this wrapper.

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.