{
  "markdown": "# mcp-server-agent-browser\n\n> **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.\n\nLet LLMs drive a real browser. This MCP server wraps [agent-browser](https://github.com/vercel-labs/agent-browser) (Vercel Labs) so any MCP client can navigate, fill forms, click, snapshot the accessibility tree, and screenshot.\n\nIt is not Grok's `web_search` / `open_page`. Those fetch documents. This one runs Chromium. Use search to find a URL, then `browser_navigate`.\n\n## Prerequisites\n\n```bash\ncargo install agent-browser\nagent-browser install\n```\n\nCall `browser_doctor` if anything is missing.\n\n## Build\n\n```bash\ncargo build --release\n```\n\nBinary: `target/release/mcp-server-agent-browser`\n\n```bash\ncargo test\n./tests/test-stdio.sh\n```\n\nReal 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.\n\n## Configuration\n\nMCP client (stdio):\n\n```json\n{\n  \"mcpServers\": {\n    \"agent-browser\": {\n      \"command\": \"/path/to/mcp-server-agent-browser\"\n    }\n  }\n}\n```\n\nOptional 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`.\n\n| Setting | Default | Meaning |\n|---|---|---|\n| `headed` | `false` | Show a window. Launch-time only; `browser_close` first if a headless daemon is already up. Also `AGENT_BROWSER_HEADED=1`. |\n| `persist` | `true` | Bare `--restore` per `session_id` (default session key `default`) plus `--namespace mcp-server`. |\n| `keep_daemon` | `false` | If false, MCP exit runs `close` so restore state is saved and Chrome does not leak. |\n| `namespace` | `mcp-server` | Isolates this MCP's daemon sockets and restore files from a human using the CLI. |\n| `command_timeout_secs` | `120` | Wrapper timeout. Playwright's own 25s action timeout is left alone (CLI IPC is ~30s). |\n| `idle_timeout` | `1h` | Daemon idle shutdown. Use `\"0\"` with `keep_daemon = true`. |\n| `download_dir` | `~/Downloads` | `--download-path`. `~` is expanded. |\n| `profile` | unset | Optional persistent Chrome user-data dir. Not your daily Chrome profile. |\n| `encryption_key_file` | unset | Sets `AGENT_BROWSER_ENCRYPTION_KEY`. Restore files are credentials; plaintext unless this is set. |\n| `AGENT_BROWSER_PATH` | `agent-browser` | CLI binary. |\n\n`allowed_domains` is optional. Localhost is allowed unless you set a list that excludes it.\n\n## What it can do\n\nSame interaction set as before (navigate, click, type, snapshot, screenshot, cookies, eval, CDP, sessions), plus:\n\n- **`browser_doctor`** — CLI, config, persist, headed/DISPLAY, daemon guess. Does not launch Chrome.\n- **`browser_get_text` `pattern`** — regex over page text with two lines of context.\n- **`browser_wait`** — `load` / `url` / `text` as well as a selector.\n\nTypical loop:\n\n1. `browser_navigate`\n2. `browser_snapshot` (`-i` for interactive)\n3. `browser_click` / `browser_fill` with `@ref`s\n4. `browser_screenshot` if you need pixels\n\n## Persistence\n\nWith `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_id`s do not share a restore key.\n\nHeaded login once, `browser_close` or exit the MCP, start again. The next navigate should restore that session.\n\nA killed MCP process may leave the daemon running. `browser_doctor` reports that. Idle shutdown still saves if persist is on.\n\n## Limitations\n\n- Chromium via `agent-browser` (Playwright). No search.\n- Headed is ignored until the existing daemon is closed.\n- Snap Chromium on Ubuntu can fail to advertise its DevTools port; prefer `agent-browser install`'s browser or `executable_path`.\n- Writes (screenshot, pdf, download) must be relative, under `/tmp`, or under `download_dir`.\n- 25s Playwright action timeout is an upstream CLI limit, not this wrapper.\n\n## License\n\nMIT\n",
  "bytes": 4040,
  "sha": "1f1128caca869f9e933062d072d60dbe138b651d1811a32439c0e1ac5319a749",
  "repo_slug": "codechap/mcp-server-agent-browser",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_codechap_agent_browser_9c68c0b2/readme"
}