Agent Browser

io.github.codeChap由 GitHub 帳號 codeChap 發布v0.1.0更新於 Oct 26, 2026

MCP server for browser automation via Vercel's agent-browser CLI

概覽

AI 產生的概覽

本機 MCP 伺服器,包裝 Vercel 的 agent-browser CLI,讓助理操作真實 Chromium 瀏覽器:導覽、點擊、填表、快照與截圖。

可以做什麼
  • 導覽頁面,並依載入、URL、文字或選擇器等待
  • 透過無障礙樹快照與正規表示式文字擷取檢視頁面內容
  • 依元素參照進行點擊、輸入與表單填寫
  • 擷取螢幕截圖與 PDF,並管理下載檔案
  • 處理 Cookie、工作階段與持久登入狀態,並提供 eval 與 CDP 存取
  • 以診斷工具檢查 CLI、設定與常駐程序狀態
適用情境
適合需要助理操作真實瀏覽器而非抓取文件的場合:填寫表單、點擊需登入的網站、確認頁面實際呈現結果或截圖。它本身不提供搜尋,通常先用搜尋工具找到網址再導覽。
執行需求
以本機 stdio 程序在桌面環境執行;需先安裝 agent-browser CLI(cargo install agent-browser,再執行 agent-browser install),瀏覽器透過 Playwright 驅動 Chromium。MCP 用戶端需指向建置出的執行檔。可選 TOML 設定位於 ~/.config/mcp-server-agent-browser/config.toml,可用 MCP_AGENT_BROWSER_CONFIG 覆寫;相關設定包括 AGENT_BROWSER_PATH、AGENT_BROWSER_HEADED 與 AGENT_BROWSER_ENCRYPTION_KEY。
安裝前請注意
瀏覽器會操作真實網站:點擊、填表與登入會改變遠端狀態,持久化設定或儲存的工作階段狀態可能帶有登入憑證。~/.agent-browser 下的還原檔案屬於憑證,未設定 AGENT_BROWSER_ENCRYPTION_KEY 時以明文保存。程序被強制結束可能留下 Chromium 常駐程序。截圖、PDF 與下載等寫入僅限相對路徑、/tmp 或 download_dir。處於 Beta 階段:真實 Chromium 重新啟動後的 Cookie 還原僅做過手動驗證。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Agent Browser,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

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

bash
cargo install agent-browseragent-browser install

Call browser_doctor if anything is missing.

Build

bash
cargo build --release

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

bash
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):

json
{  "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

來源:README.md,提交 7d1010f

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.0最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。