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 的场景:测试本地 Web 应用、填写并提交表单、检查控制台或网络错误、截取屏幕截图。也适合从命令行或 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 分