Skip to main content
Glama

Auto Browser

CI License: MIT MCP Server Local First Glama Open in GitHub Codespaces

Auto Browser demo

为您的 AI 智能体提供一个真实的浏览器,并实现人机协作。

Auto Browser 是一个用于授权工作流的 MCP 原生浏览器控制平面。它为 MCP 客户端、LLM 智能体和操作员提供了一个共享的 Playwright 浏览器,支持人工接管、可重用的身份验证配置文件、审批、审计追踪以及本地优先部署。

支持:

  • Claude Desktop

  • Cursor

  • 任何支持 HTTP 或 stdio 的 MCP 客户端

  • 当您需要 curl 优先控制时的直接 REST 调用者

为什么选择 Auto Browser

  • 从第一天起就是 MCP 原生的。 浏览器界面直接封装为 MCP 服务器,而不是事后添加的。

  • 当网页变得脆弱时,支持人工接管。 noVNC 确保在需要人工介入时,始终可以使用相同的实时会话。

  • 一次登录,后续复用。 保存命名的身份验证配置文件,并重新打开已登录的新会话。

  • 默认本地优先。 使用 Docker Compose 在您自己的机器上运行整个堆栈,或使用 Codespaces 进行快速托管演示。

  • 内置安全护栏。 审批、操作员身份、PII(个人身份信息)脱敏、见证回执和合规模板都是产品功能的一部分。

Related MCP server: Browser-Use MCP Server

版本亮点 (v1.0.2)

  • 框架安全更新,FastAPI 和 Starlette 已锁定在当前的补丁版本线

  • 更安全的错误边界,涵盖浏览器操作、CDP、OCR、网格、工作流、隧道、社交和共享令牌界面

  • 速率限制加固,使用有界桶和哈希操作员标识符

  • 主机和路径策略收紧,针对生产环境的 ALLOWED_HOSTS、身份验证配置文件路径和上传根目录

  • 1.0 平台界面,包括签名网格委托、工作流路由、/dashboard、noVNC 接管、MCP 传输、审计追踪和就绪检查

查看 CHANGELOG.md 获取完整的发布历史。

适用场景

  • 内部仪表板和管理工具

  • 操作员辅助的 QA 和浏览器调试

  • 一次登录、后续复用的账户工作流

  • 需要人工介入以恢复流程的脆弱网站

  • 需要真实浏览器(而非仅 HTML 获取)的 MCP 驱动智能体工作流

非目标场景

  • 隐身或反机器人工作

  • 验证码破解

  • 未经授权的抓取或账户自动化

  • 欺骗性身份塑造或绕过工具

您将获得什么

浏览器控制

操作员安全

部署与集成

基于 Playwright 的会话,支持截图、DOM 摘要、OCR 摘录、标签页控制、下载和网络检查

审批门控、操作员身份标头、审计事件、PII 脱敏、见证回执和保护配置文件

基于 HTTP 的 MCP、捆绑的 stdio 网桥、REST API、Docker Compose、Codespaces、身份验证配置文件以及可选的每会话隔离

快速入门

git clone https://github.com/LvcidPsyche/auto-browser.git
cd auto-browser
docker compose up --build

这对于使用默认设置进行本地开发已足够。

可选:

cp .env.example .env
make doctor

在具有本地 Docker 访问权限和打开 localhost 套接字权限的普通终端中运行 make doctor。

打开:

  • API 文档:http://127.0.0.1:8000/docs

  • 操作员仪表板:http://127.0.0.1:8000/dashboard

  • 可视化接管:http://127.0.0.1:6080/vnc.html?autoconnect=true&resize=scale

所有已发布的端口默认绑定到 127.0.0.1。

在 Codespaces 中尝试

Open in GitHub Codespaces

Codespaces 会自动配置堆栈。仪表板和 noVNC 标签页通常在 90 秒内准备就绪。

第一个实用演示

此仓库中信号最强的流程是:

  1. 创建会话

  2. 如果网站需要人工,则手动登录

  3. 将会话保存为命名的身份验证配置文件

  4. 从该配置文件打开新会话

  5. 无需重新验证即可继续工作

从这里开始:

最小会话创建:

curl -s http://127.0.0.1:8000/sessions \
  -X POST \
  -H 'content-type: application/json' \
  -d '{"name":"demo","start_url":"https://example.com"}' | jq

最小观察:

curl -s http://127.0.0.1:8000/sessions/<session-id>/observe | jq

MCP 客户端

Auto Browser 暴露了:

  • http://127.0.0.1:8000/mcp 处的 HTTP MCP 端点

  • http://127.0.0.1:8000/mcp/tools 和 http://127.0.0.1:8000/mcp/tools/call 处的便捷端点

  • scripts/mcp_stdio_bridge.py 处的捆绑 stdio 网桥

默认的 MCP 工具配置文件是 curated,它保持浏览器界面紧凑,以便更好地进行工具选择。如果您需要完整的内部工具界面,请设置:

MCP_TOOL_PROFILE=full

原始工具调用示例:

curl -s http://127.0.0.1:8000/mcp/tools/call \
  -X POST \
  -H 'content-type: application/json' \
  -d '{
    "name":"browser.create_session",
    "arguments":{
      "name":"demo",
      "start_url":"https://example.com"
    }
  }' | jq

客户端设置指南:

安全与合规

对于真正的私有部署,至少设置:

APP_ENV=production
API_BEARER_TOKEN=<strong-random-secret>
REQUIRE_OPERATOR_ID=true
AUTH_STATE_ENCRYPTION_KEY=<44-char-fernet-key>
REQUIRE_AUTH_STATE_ENCRYPTION=true
REQUEST_RATE_LIMIT_ENABLED=true
METRICS_ENABLED=true

COMPLIANCE_TEMPLATE 可以在启动时应用预配置的姿态:

模板

身份验证加密

操作员 ID

PII 脱敏

隔离

最大会话时长

HIPAA

必需

必需

所有层

docker_ephemeral

4h

PCI-DSS

必需

必需

所有层

docker_ephemeral

1h

SOC2

-

必需

网络 + 文本

共享

24h

GDPR

-

-

所有层

共享

24h

所有模板都需要上传审批。HIPAA、SOC2 和 PCI-DSS 还启用了见证回执。启动时会将应用的策略写入 /data/compliance-manifest.json。

示例:

COMPLIANCE_TEMPLATE=HIPAA docker compose up

有关部署详情、托管见证说明、CLI 身份验证模式和反向 SSH 指导,请参阅:

架构概览

flowchart LR
    User[Human operator] -->|watch / takeover| noVNC[noVNC]
    LLM[OpenAI / Claude / Gemini] -->|shared tools| Controller[Controller API]
    Controller -->|Playwright protocol| Browser[Browser node]
    noVNC --> Browser
    Browser --> Artifacts[(screenshots / traces / auth state)]
    Controller --> Artifacts
    Controller --> Policy[Allowlist + approval gates]

核心组件:

  • browser-node/ 运行 Chromium、Xvfb、x11vnc 和 noVNC

  • controller/ 暴露 FastAPI 控制器、MCP 传输、策略护栏和编排端点

  • data/ 保存运行时工件、身份验证状态、审批、审计日志和可选的 CLI 缓存

  • scripts/ 包含用于 doctor、冒烟测试、网桥和发布检查的本地辅助工具

仓库指南

路径

包含内容

controller/

控制器 API、MCP 传输、测试和打包

browser-node/

浏览器运行时和 Playwright 连接层

examples/

复制粘贴流程和 MCP 客户端设置

integrations/langchain/

LangChain、LangGraph 和 CrewAI 适配器

docs/

架构、部署、加固和启动文档

scripts/

doctor、冒烟测试工具、stdio 网桥和身份验证辅助工具

ops/

支持服务模板和操作资产

常用命令

命令

用途

make help

列出可用的仓库命令

make lint

在应用、测试和辅助脚本上运行 Ruff 检查

make test

在 Docker 中运行控制器测试

make test-local

在主机 Python 3.10+ 上运行控制器测试

make doctor

运行本地就绪冒烟测试

make release-audit

运行更完整的发布验证流程

make smoke-isolation

验证每会话 Docker 隔离

make smoke-reverse-ssh

验证反向 SSH 远程访问

文档地图

如果您想...

从这里开始

了解系统形态

docs/architecture.md

连接 Claude Desktop 或 Cursor

docs/mcp-clients.md

运行 curl 优先示例

examples/README.md

在受信任的主机上部署

docs/deployment.md

查看生产环境约束

docs/production-hardening.md

检查发布历史

CHANGELOG.md

查看项目发展方向

ROADMAP.md

贡献

如果您想提供帮助,请从以下内容开始:

如果 Auto Browser 对您有用,点个星标可以帮助其他人找到它。

Available Tools

20 tools
browser.activate_tabA

Bring one tab to the foreground so subsequent observations and actions target it. Tab indexes come from browser.list_tabs. Returns the activated index, the updated session summary, and the current tab list.

Inputs: index (required), session_id.

browser.close_sessionB
Destructive

Close a session and finalize its trace/artifacts.

Inputs: session_id, approval_id, workflow_profile.

browser.close_tabB
Destructive

Close one tab index if more than one tab is open.

Inputs: index (required), session_id, approval_id, workflow_profile.

browser.create_sessionA

Create a new browser session and optionally navigate to a start URL.

Inputs: name, start_url, totp_hosts, user_agent, +9 more.

browser.eval_jsA

Execute a JavaScript expression in the current page context and return the result. Every call needs operator approval for that exact expression: the first call returns status approval_required with an approval_id; retry with approval_id once it is approved. Prefer find_elements, get_html or observe for reading the page — they need no approval.

Inputs: expression (required), session_id, timeout_ms, approval_id, +1 more.

browser.execute_actionA

Execute one browser action (navigate, click, hover, type, press, select_option, scroll, …) in a session, using the same action schema the agent planner emits. Actions are policy-checked and audited, and governed actions may require a granted approval_id. Call browser.observe first to get targetable element IDs and selectors. Returns the action's verification (what changed) and an observation of the page after it (up to 20 interactables).

Inputs: action (required), detail, session_id, approval_id, +1 more.

browser.find_elementsA

Find elements either by CSS selector or by a text/regex query across the page's text content. selector mode returns matching elements' text, href, value, bounding box, and visibility -- useful before clicking or scraping multiple items. query mode (set query, optionally regex and context) returns the matched text plus surrounding context for each hit -- a cheap way to locate a specific string on the page without a full observe.

Inputs: limit, query, regex, context, +2 more.

browser.fork_sessionA

Fork a session: snapshot its cookies, storage state, and current URL, then create a new independent session with that state. Useful for branching workflows or running parallel variants. Without start_url, a page that is no URL to open (blank, data:, Chrome's error page) forks onto a blank page. Counts as a new session: needs MAX_SESSIONS of at least 2.

Inputs: name, start_url, session_id, user_agent, +2 more.

browser.get_htmlA
Read-onlyIdempotent

Read the current page: its serialized DOM (the whole document, not just the viewport), or with text_only=true its visible text — the cheapest way to read a page's content. Returns up to max_chars (default 20,000) from offset; when truncated is true, call again with offset=next_offset for the rest. On Chrome's error page for a navigation the pre-request gate stopped, blocked_navigation says what was stopped and why.

Inputs: offset, max_chars, text_only, session_id.

browser.get_sessionA
Read-onlyIdempotent

Get the full record for one browser session by ID: the live session summary (status, current page, tabs) when the session is active, or the persisted session record when it has been closed. Use browser.list_sessions to discover session IDs.

Inputs: session_id.

browser.list_auth_profilesA
Read-onlyIdempotent

List reusable saved auth profiles that can be loaded into a new session.

Inputs: no named parameters.

browser.list_downloadsA
Read-onlyIdempotent

List files captured from browser downloads for one session.

Inputs: session_id.

browser.list_sessionsA
Read-onlyIdempotent

List live and persisted browser sessions, one reference each (id, name, status, live, current page, takeover URL). browser.get_session returns a full record.

Inputs: no named parameters.

browser.list_tabsA
Read-onlyIdempotent

List currently open tabs/pages for one session.

Inputs: session_id.

browser.observeA
Read-only

Capture the current browser observation: interactables, tabs, console, and a perception summary. Presets: 'text' — no screenshot or OCR: interactables, accessibility tree and the first 2,000 characters of page text; for text-only models. 'fast' — screenshot only, returned as an image, no text/accessibility extraction; for vision models. 'normal' (default) — text plus a screenshot URL and OCR. 'rich' — normal with twice the interactables and 4,000 characters of text. To read a whole page, use browser.get_html with text_only=true. On Chrome's error page for a navigation the pre-request gate stopped, blocked_navigation says what was stopped and why.

Inputs: limit, detail, preset, session_id.

browser.read_downloadA

Read a downloaded file as text (CSV, JSON, TXT, HTML, ...), by download_id from browser.list_downloads or, if omitted, the latest completed download. Paged like browser.get_html. Binary files (PDF, XLSX, images) are refused with their artifact URL. With PII scrubbing on, the text is scrubbed; pii_scrub says whether it was and how many redactions were made.

Inputs: offset, max_chars, session_id, download_id.

browser.request_human_takeoverC

Ask for a human to take over the shared browser desktop.

Inputs: reason, session_id, approval_id, workflow_profile.

browser.save_auth_profileB

Save the current session storage state into a reusable named auth profile.

Inputs: profile_name (required), session_id, approval_id, workflow_profile.

browser.screenshotA
Read-only

Capture the current viewport and return it as an image (plus its artifact URL), without the full observe payload.

Inputs: label, session_id.

browser.wait_for_selectorA
Read-only

Wait for a CSS selector to reach a specific state (visible, hidden, attached, detached). Returns when the condition is met or raises on timeout.

Inputs: selector (required), state, session_id, timeout_ms.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 20 tools

    Disambiguation4/5

    Most tools target clearly distinct concerns (sessions, tabs, observation, downloads, auth profiles). The read-side tools (observe, screenshot, get_html, find_elements) overlap somewhat, but each description explicitly scopes itself and cross-references the alternatives, so an agent can reliably choose.

    Naming Consistency5/5

    Every tool follows a consistent verb_noun snake_case pattern under a uniform browser. namespace (list_tabs, close_tab, create_session, read_download). No mixed conventions or casing.

    Tool Count4/5

    20 tools is on the heavy side, but the server legitimately spans sessions, tabs, observation, downloads, and auth profiles, and each tool maps to a real operation. Slightly over the comfortable range but not padded.

    Completeness4/5

    The session lifecycle (create/list/get/close/fork), tab management, observation, navigation/actions, downloads, and auth profiles are all covered. Minor gaps like deleting saved auth profiles or an explicit new-tab tool are workable around via execute_action.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • -
      license
      Not graded
      quality
      F
      maintenance
      This server provides cloud browser automation capabilities using Browserbase, Puppeteer, and Stagehand. This server enables LLMs to interact with web pages, take screenshots, and execute JavaScript in a cloud browser environment.
      1,158 npm
      3,397
      MIT
    • A
      license
      A
      quality
      F
      maintenance
      Enables LLMs like Claude to navigate the web through Puppeteer-based tools and Steel. Based on the Web Voyager framework, it provides tools for all the standard web actions click clicking/scrolling/typing/etc and taking screenshots.
      16
      58
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      A Model Context Protocol (MCP) integration that provides Claude Desktop with autonomous browser automation capabilities. This agent enables Claude to interact with web content, manipulate DOM elements, execute JavaScript, and perform API requests.
      13
      43
      TypeScript
      Mozilla Public 2.0