agent-in-browser

io.github.Gwakko由 GitHub 帳號 Gwakko 發布v0.1.2更新於 Oct 25, 2026

Real browser for any agent: Chrome/Edge/Brave via CDP, Firefox via BiDi. Refs, forms, console, net.

已驗證STDIO僅桌面瀏覽器自動化開發者工具

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓 AI 助理操控真實的 Chrome、Edge、Brave 或 Firefox 瀏覽器,進行網頁導覽、頁面讀取與互動操作。

可以做什麼
開啟、切換與關閉分頁,在真實瀏覽器工作階段中導覽至網址,並查看瀏覽器狀態、已安裝瀏覽器、調整視窗大小或關閉瀏覽器。以帶元素參照的快照讀取頁面,尋找元素、取得文字、截圖並等待條件出現。使用受信任輸入進行點擊、懸停、輸入、按鍵、填寫表單與捲動。在頁面中執行 JavaScript,並收集主控台訊息與網路請求。將工具呼叫作為 YAML 測試情境在多個瀏覽器上重播,並輸出 JUnit 或 JSON 報告。
適用情境
適合助理需要驅動真實瀏覽器而非抓取靜態 HTML 的情境:測試本機網頁應用程式、填寫並送出表單、檢查主控台或網路錯誤、擷取螢幕截圖。也適合從命令列或 CI 執行的跨瀏覽器 UI 自動化測試。
執行需求
以本機程序在使用者電腦上執行(僅限桌面端),可透過提供的安裝腳本、Homebrew、Go 或一鍵 MCP 安裝包安裝。它驅動電腦上已安裝的瀏覽器:Chrome 系列瀏覽器透過 CDP,Firefox 透過 WebDriver BiDi;Safari 僅能偵測。未宣告需要帳號、API 金鑰或環境變數。
安裝前請注意
瀏覽器使用獨立設定檔,偵錯端點僅監聽本機,但任何本機程序都能操控該瀏覽器,因此不要在裡面登入不願交給助理的帳號。在助理的瀏覽器視窗登入後,這些登入狀態會保留在該設定檔中。相關工具會點擊、輸入、送出表單並在頁面中執行 JavaScript,可能變更資料或觸發真實操作。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

agent-in-browser

[ci] [release] [Go Report Card] [license]

A real browser for any AI agent, any model, and any test runner — one dependency-free binary.

[The same agent tool calls driving Chrome over CDP and Firefox over WebDriver BiDi]

Real recording, not a mock-up. The agent reads the page as a snapshot with element refs, types, fills the form and clicks, first in Chrome (CDP), then in Firefox (WebDriver BiDi). Regenerate it with task demo.

agent-in-browser is an open take on "Claude in Chrome". It doesn't need an extension or a vendor-specific runtime. It drives the browsers you already have through their native automation protocols:

BrowserProtocolStatus
Chrome, Chrome Beta/Canary, Chromium, Edge, Brave, Vivaldi, OperaChrome DevTools Protocol (CDP)✅
Firefox, Firefox Developer Edition / NightlyWebDriver BiDi✅
SafariWebDriver (safaridriver)🛣 detected, roadmap

It's available three ways, all backed by the same tool catalogue:

  1. MCP server (agent-in-browser mcp): plugs into Claude Code, Claude Desktop, Cursor, Codex, Gemini CLI, Windsurf, VS Code/Copilot, Zed, opencode and any other MCP client, whatever model sits behind it.
  2. Shell CLI (agent-in-browser call <tool> …): for agents without MCP, for scripts, and for humans. Calls share one persistent browser.
  3. Scenario runner (agent-in-browser run test.yaml --browser chrome,firefox): replays tool calls as automated tests across a browser matrix, with JUnit/JSON reports.

An agent skill (skills/agent-in-browser/SKILL.md) ships inside the binary and teaches agents the workflow.

Install

bash
# macOS / Linuxcurl -fsSL https://raw.githubusercontent.com/Gwakko/agent-in-browser/main/scripts/install.sh | sh
# Windows (PowerShell)irm https://raw.githubusercontent.com/Gwakko/agent-in-browser/main/scripts/install.ps1 | iex
# Homebrew (macOS / Linux)brew install gwakko/tap/agent-in-browser
# With Gogo install github.com/gwakko/agent-in-browser/cmd/agent-in-browser@latest
# From a checkout (needs Task: https://taskfile.dev)task install            # → ~/.local/bin/agent-in-browser + alias `aib`

Connect your agent

bash
agent-in-browser setup claude-code --write    # runs `claude mcp add --scope user …`agent-in-browser setup cursor --write         # merges ~/.cursor/mcp.json (a .bak is kept)agent-in-browser setup codex --write          # appends to ~/.codex/config.tomlagent-in-browser setup gemini --write         # ~/.gemini/settings.jsonagent-in-browser setup vscode                 # prints the snippet for .vscode/mcp.jsonagent-in-browser skill install --for claude   # ~/.claude/skills/agent-in-browser (also: codex, agents, --dir)

Claude Desktop, one click: download agent-in-browser-<version>.mcpb from the latest release and open it. It also appears in the MCP Registry as io.github.Gwakko/agent-in-browser.

Without --write, setup only prints the config. Pass browser options through with --args "--browser firefox --headless". See docs/integrations.md for every client.

Use it from the shell

bash
agent-in-browser call navigate url=localhost:3000agent-in-browser call snapshot#   - textbox "Email" [ref=e3] (required, type=email)#   - button "Sign up" [ref=e7]agent-in-browser call type ref=e3 [email protected]agent-in-browser call click ref=e7agent-in-browser call wait_for text=Welcomeagent-in-browser call console_messages level=erroragent-in-browser call screenshot            # → prints PNG pathagent-in-browser stop

Useful flags (they work anywhere on the command line): --browser firefox, --headless, --instance work for a second, independent browser, --endpoint http://127.0.0.1:9222 to attach to a browser you started yourself, and --viewport 390x844.

Test scenarios

yaml
name: signupbrowsers: [chrome, firefox]steps:  - navigate: http://localhost:3000/signup  - fill_form:      fields:        - { selector: "#email", value: "[email protected]" }        - { match: "I accept the terms", value: true }  - click: Sign up  - wait_for: { text: "Welcome" }  - assert: { url_contains: "/dashboard", no_console_errors: true }
bash
agent-in-browser run tests/*.yaml --browser chrome,firefox,edge --junit report.xml

Full format: skills/agent-in-browser/references/scenarios.md.

Tools

browser_status · browsers_installed · tabs_list · tab_new · tab_select · tab_close · navigate · snapshot · find · click · hover · type · press_key · fill_form · scroll · wait_for · get_text · screenshot · evaluate · console_messages · network_requests · resize · browser_close

Arguments are documented in docs/tools.md, which task docs:tools generates.

How it works

 agent ──MCP/stdio──┐ shell ──call───────┼──▶ tools ──▶ session ──▶ Driver ──CDP──────▶ Chrome / Edge / Brave / … CI ────run yaml────┘     (one catalogue)  (attach|launch)  └─BiDi─────▶ Firefox                                                            page lib (injected JS):                                                            snapshot · refs · fill · find
  • The browser runs on a dedicated profile (~/.agent-in-browser/profiles/<instance>-<browser>) and is detached, so it survives MCP server restarts. Separate CLI calls reuse it through ~/.agent-in-browser/instances/<name>.json.
  • Page understanding (snapshot, refs, form filling) is injected JavaScript that works the same in every engine. Trusted input, screenshots, tabs and console/network capture come from each protocol's driver.
  • Details: docs/architecture.md · browser notes: docs/browsers.md · plans: docs/roadmap.md.

Development

bash
task build      # bin/agent-in-browsertask test       # unit teststask test:e2e   # scenario on every installed browsertask smoke      # CLI scenario run, chrome+firefoxtask inspect    # MCP Inspector against the local buildtask build:all  # cross-compile 6 targets into dist/task release TAG=v0.1.0   # tag → GitHub Actions → goreleaser

Security notes

  • The debugging endpoint listens on 127.0.0.1 only. Even so, any local process can drive that browser, so don't sign it into accounts you wouldn't hand to the agent.
  • Since Chrome 136, remote debugging is refused for your default Chrome profile. agent-in-browser always uses its own profile. To reuse your logins, sign in once inside the agent's browser window and the profile keeps them.

License: MIT

來源:README.md,提交 dca60a5

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:該軟體包類型無法在沙箱中執行。

版本歷史

2
  1. v0.1.2最新Oct 25, 2026
  2. v0.1.1Oct 21, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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