browser-automation
Allows automated browser interactions with Baidu, such as navigating to search pages, typing queries into the search box, and clicking the search button.
Offers CrewAI agent scheduling integration, exposing atomic browser tools for natural-language browser tasks, e-commerce searches, and form filling.
Provides e-commerce search automation for Taobao, allowing product searches to be performed through browser automation.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@browser-automationOpen google.com, type 'MCP servers' in the search box, and click the search button"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AI Browser Automation
通用浏览器自动化框架,支持反检测、智能元素定位、工作流编排,通过 MCP 协议对外暴露单一工具接口。
核心特性
反检测浏览器 — CloakBrowser / rebrowser-playwright / Playwright 三级降级,自动选择最佳后端
三级元素查找 — A(AX树相似度匹配) → B(Shadow-DOM TreeWalker穿透) → C(多模态VLM视觉定位)
工作流编排 — 一次调用执行完整动作序列,内置重试与熔断机制
MCP 协议 — 对外仅暴露
run_workflow单一工具,Host 侧零调度逻辑会话持久化 — 浏览器降级时自动保留登录状态(cookies + localStorage)
Related MCP server: web-scraper-server
架构
┌─────────────────────────────────────────────────────────┐
│ Host (OpenCode / Claude-Code / 任意 MCP Client) │
│ 仅负责生成 action_list,调用一次 run_workflow │
└───────────────────────┬─────────────────────────────────┘
│ MCP 协议(单次调用)
┌───────────────────────▼─────────────────────────────────┐
│ MCP Server (mcp_server.py) │
│ ┌─────────────────────────────────────────────────────┐│
│ │ WorkflowRunner (workflow_runner.py) ││
│ │ ││
│ │ for action in action_list: ││
│ │ A: AX树匹配 (similarity.py) ││
│ │ ↓ 置信度 < 0.7 或失败 ││
│ │ B: Shadow-DOM穿透 (_browser_utils.py) ││
│ │ ↓ 找不到或失败 ││
│ │ C: VLM视觉定位 (vlm_client.py) [可选] ││
│ │ ↓ 全部失败 → 重试 → 熔断 ││
│ └─────────────────────────────────────────────────────┘│
│ │
│ ┌─────────────────────────────────────────────────────┐│
│ │ Browser Manager (browser_manager.py) ││
│ │ CloakBrowser → rebrowser → Playwright 三级降级 ││
│ │ 反检测指纹 / 会话持久化 / 单例浏览器管理 ││
│ └─────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────┘快速开始
安装
# 克隆项目
git clone https://github.com/your-username/ai-browser-automation.git
cd ai-browser-automation
# 创建虚拟环境
python3 -m venv venv
source venv/bin/activate
# 安装依赖
pip install -r requirements.txt
# 安装浏览器(必须)
playwright install chromium依赖说明
依赖 | 用途 | 必须 |
| 浏览器自动化核心 | 是 |
| 源码级反检测(推荐) | 否 |
| 反检测 Playwright 分支 | 否 |
| MCP 协议支持 | 是 |
| Agent 框架(可选) | 否 |
| VLM 多模态兜底(C方案) | 否 |
浏览器后端按优先级自动选择:CloakBrowser > rebrowser-playwright > Playwright。至少需要安装其中一个。
直接测试
python test_workflow.py测试脚本会启动可见浏览器,依次执行:导航 → 输入 → 点击,验证工作流引擎和熔断机制。
MCP 集成
配置
在 MCP 客户端(OpenCode / Claude Desktop)中添加:
{
"mcpServers": {
"browser-automation": {
"command": "python",
"args": ["/path/to/ai-browser-automation/mcp_server.py"]
}
}
}调用示例
{
"action_list": [
{"action": "goto", "target_url": "https://www.baidu.com"},
{"action": "type", "element_label": "搜索框", "text": "hello world"},
{"action": "click", "element_label": "百度一下"}
],
"single_step_max_retry": 2,
"enable_vlm_fallback": false
}参数说明
参数 | 类型 | 默认值 | 说明 |
|
| 必填 | 动作清单数组 |
|
|
| 单步最大重试次数,耗尽后熔断 |
|
|
| 是否启用 VLM 视觉兜底(C方案) |
动作类型
action | 必填参数 | 可选参数 | 说明 |
|
| — | 导航到指定 URL |
|
| — | 查找并点击元素 |
|
| — | 查找输入框并填写文本 |
| — |
| 等待指定毫秒 |
返回值
{
"success": true,
"total_steps": 3,
"executed_steps": 3,
"failed_step": null,
"error_message": "",
"step_results": [
{"step_index": 0, "action": {"action": "goto", ...}, "success": true, "method": "direct", "confidence": 1.0},
{"step_index": 1, "action": {"action": "type", ...}, "success": true, "method": "aria", "confidence": 0.0},
{"step_index": 2, "action": {"action": "click", ...}, "success": true, "method": "aria", "confidence": 0.95}
]
}元素查找策略
A 方案:AX树本地匹配
通过 JS 注入提取页面所有可交互元素,使用 difflib.SequenceMatcher 计算目标文本与元素的文本相似度。置信度 ≥ 0.7 时直接通过元素索引点击。
速度最快,无外部依赖
适用于标准 HTML 页面
B 方案:Shadow-DOM TreeWalker 穿透
递归遍历所有 DOM 节点及 Shadow DOM 子树,搜索目标文本。找到后向上查找最近的可交互父元素,检查可见性、视口位置后点击。
支持 Web Components / Shadow DOM
包含可见性、视口内、可交互父元素三重验证
C 方案:多模态 VLM 视觉定位(可选)
截取页面截图,发送给远端多模态大模型(如 Qwen2.5-VL),获取目标元素归一化坐标,鼠标点击。
需配置环境变量:
export VLM_API_BASE="http://localhost:11434/v1"
export VLM_API_KEY="ollama"
export VLM_MODEL="qwen2.5-vl:7b"CrewAI 集成(可选)
项目同时支持 CrewAI Agent 调度模式,提供 6 个原子工具:
from ecommerce_api import run_browser_task, run_ecommerce_search, run_form_fill
# 自然语言的任务
result = run_browser_task("在百度搜索 Python 教程", url="https://www.baidu.com")
# 电商搜索快捷接口
result = run_ecommerce_search("iPhone 16", platform_url="https://www.taobao.com")
# 表单自动填写
result = run_form_fill("https://example.com/form", {"name": "张三", "phone": "13800138000"})项目结构
ai-browser-automation/
├── tools/
│ ├── browser_manager.py # 隐身浏览器管理(三级降级 + 会话持久化)
│ ├── browser_navigate_tool.py # 导航工具
│ ├── browser_scan_tool.py # ARIA 扫描工具
│ ├── browser_click_tool.py # 点击工具
│ ├── browser_type_tool.py # 输入工具
│ ├── browser_screenshot_tool.py# 截图工具
│ ├── browser_extract_tool.py # 数据提取工具
│ ├── similarity.py # 文本相似度计算
│ ├── _browser_utils.py # 底层原子函数(扫描/点击/Shadow DOM/VLM)
│ ├── vlm_client.py # VLM 多模态视觉定位客户端
│ ├── workflow_runner.py # 工作流编排引擎
│ └── __init__.py
├── mcp_server.py # MCP 协议层(run_workflow 工具)
├── ecommerce_api.py # CrewAI Agent 调度入口
├── manual_test.py # 交互式测试
├── test_workflow.py # 工作流引擎测试
├── requirements.txt
├── .gitignore
├── LICENSE
└── README.md设计原则
单一工具暴露 — MCP 层只注册
run_workflow,Host 侧零调度逻辑无 LLM 依赖 — 元素匹配、重试熔断全部是普通业务代码,不调用大模型
增量不改原有代码 — 6 个原子工具完全不动,新功能全部通过新增文件实现
降级而非失败 — 浏览器后端三级降级、元素查找三级降级、单步重试后熔断
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables real browser automation as tools in Cursor, Claude Desktop, Windsurf, and any MCP-compatible client, allowing AI agents to interact with web pages through natural language.24MIT
- AlicenseCqualityCmaintenanceProvides browser automation and web scraping as MCP tools, enabling autonomous URL ingestion, crawling, extraction, and anti-bot handling with interactive browser control.625MIT
- AlicenseNot gradedqualityDmaintenanceProvides a real browser that bypasses bot detection (Cloudflare, Turnstile) for AI agents, enabling navigation, clicking, typing, screenshots, and data collection through MCP tools.104MIT
- AlicenseAqualityBmaintenanceEnables MCP clients to automate a real Chrome browser via Playwright, supporting session sharing and tools for navigation, clicking, typing, and more.112MIT
Related MCP Connectors
Stealth web browser for agents: search, fetch, click, download and type in persistent MCP sessions.
AI-powered browser automation — navigate, click, fill forms, and extract data from any website.
Browser MCP for logged-in tasks. Uses your Chrome — credentials stay local. Zero-token replay.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/zyjzyjlh3-alt/ai-browser-automation'
If you have feedback or need assistance with the MCP directory API, please join our Discord server