mcp-browser-agent
Supports automating Gmail tasks such as logging in, composing emails, and managing the inbox through browser control.
Click on "Deploy 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., "@mcp-browser-agent Extract the headlines from bbc.com"
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.
🤖 MCP Browser Agent
让 AI Agent(Claude/GPT)像人一样操作浏览器。 Let AI agents control the browser just like a human.
📋 工具清单(30 个)
🧭 导航类
工具 | 说明 |
| 打开网页并截图(支持全页截图) |
| 获取当前页面 URL |
| 获取页面标题 |
| 获取 HTML 源码 |
| 刷新页面 |
| 后退 |
| 前进 |
| 导出当前页面为 PDF |
🖱️ 交互类
工具 | 说明 |
| 点击元素(CSS 选择器、文本、右键) |
| 填写输入框(模拟真实输入) |
| 清空输入框 |
| 下拉列表选择(value/label/index) |
| 键盘按键(Enter/Escape/Tab/组合键) |
| 鼠标悬停 |
| 提交表单 |
| 滚动(上/下/到顶/到底/到元素) |
| 拖拽元素 |
📝 提取类
工具 | 说明 |
| 提取文字内容(支持选择器和属性) |
| 执行自定义 JavaScript |
| 截取指定元素的截图 |
| 获取 Cookie |
| 删除 Cookie |
📑 标签页管理
工具 | 说明 |
| 打开新标签页 |
| 切换到指定标签页 |
| 关闭标签页 |
⚡ 高级功能
工具 | 说明 |
| 等待(时间或元素出现/消失) |
| 切换 iframe 上下文 |
| 获取控制台日志 |
| 重置浏览器实例 |
| 关闭当前页面 |
Related MCP server: Cloudflare Playwright MCP
🚀 快速开始
前提
Node.js >= 18
(推荐)Claude Desktop / Cursor / 任何支持 MCP 的客户端
快速使用
# 全局安装(推荐)
npm install -g @yubao2000/mcp-browser-agent
# 启动服务
mcp-browse-agent在 Claude Desktop 中配置
找到配置文件 claude_desktop_config.json:
平台 | 路径 |
Windows |
|
macOS |
|
Linux |
|
💡 找不到文件? 打开 Claude Desktop → 点 Developer(开发者)→ Edit MCP Config(编辑 MCP 配置),会自动打开或创建这个文件。
将以下内容填入:
{
"mcpServers": {
"browser-agent": {
"command": "mcp-browse-agent",
"args": []
}
}
}配置完成后,直接对 Claude 说:
"帮我打开百度首页,截图给我看"
"搜索 'MCP 协议',把搜索结果提取出来"
"帮我登录 Gmail,填上用户名和密码,点击登录"
在 Cursor 中配置
打开 Cursor → 设置 → Features → MCP Servers → Add New MCP Server:
字段 | 填什么 |
Name |
|
Type |
|
Command |
|
Arguments | 留空 |
或者直接在项目下创建 .cursor/mcp.json 文件:
{
"mcpServers": {
"browser-agent": {
"command": "mcp-browse-agent",
"args": []
}
}
}配置后在 Cursor 中使用 ⌘ . 或 Ctrl . 打开 MCP 面板,选择 browser-agent 即可:
"帮我打开百度首页,截图给我看"
"提取当前页面的所有链接"
在 OpenAI Codex 中配置
编辑 ~/.codex/config.toml:
[mcp_servers.browser-agent]
command = "mcp-browse-agent"
args = []配置后在 Codex 会话中使用 /mcp 确认服务已加载:
"帮我打开百度首页,截图给我看"
"帮我提取当前页面的文字内容"
💡 提示: 在 Codex 中使用
/mcp列出所有配置的 MCP 服务,/mcp verbose查看详细状态。
🛠 配置文件
项目支持 .mcp-browser.json 配置文件(放在项目目录或用户目录 ~/.mcp-browser.json):
{
"dataDir": "./.browser-data",
"viewport": { "width": 1280, "height": 800 },
"headless": true,
"defaultTimeout": 30000,
"chromePath": null
}环境变量也可配置:
BROWSER_DATA_DIR— 数据目录(Cookie 等)MCP_BROWSER_CONFIG— 配置文件路径MCP_PRO_LICENSE— Pro 版 License Key
👁️ 显示浏览器窗口(调试/过验证码)
默认浏览器在后台运行(不可见)。如果需要看到浏览器窗口:
# 方式 1:环境变量
SHOW_BROWSER=true mcp-browse-agent
# 方式 2:配置文件 .mcp-browser.json
{
"showBrowser": true
}浏览器窗口会弹出,你可以看到 AI 的每一步操作。适用于:
调试(看 AI 点了哪里、填了什么)
遇到滑动验证码时手动操作
演示/录屏
🍪 Cookie 持久化
Cookie 自动保存在 .browser-data/cookies.json。重启服务后,之前登录的网站自动恢复登录态。对于需要频繁登录的网站(Gmail、知乎、小红书等),只需登录一次。
📦 本地开发
git clone https://github.com/yubao2000/mcp-browser-server.git
cd mcp-browser-server
npm install
npm run build
npm start💰 Pro 版
功能 | 免费版 | Pro 版 ($9.9/月) | 终身版 ($99) |
全部 34 个工具 | ✅ | ✅ | ✅ |
Cookie 持久化 | ✅ | ✅ | ✅ |
标签页管理 | ✅ | ✅ | ✅ |
批量自动化(CSV 驱动) | ❌ | ✅ 100条/次 | ✅ 100条/次 |
多标签页并发 | 1个 | 10个 | 10个 |
Cookie 加密备份 | ❌ | ✅ | ✅ |
JSON/CSV 数据导出 | ❌ | ✅ | ✅ |
企业级技术支持 | ❌ | ✅ | ✅ |
永久免费升级 | ❌ | ❌ | ✅ |
Pro 版即将推出。订阅通知获取早鸟优惠!
🤝 贡献
欢迎 Star、Issue、PR!
📄 License
MIT
Available Tools
36 toolsbrowser_backA
浏览器后退到上一页。
Inputs: no named parameters.
browser_batchB
批量执行自动化操作序列。按顺序执行一系列操作:打开网页、点击、填表、提取、等待等。限时免费中。
Inputs: steps (required).
browser_clearA
清空输入框的内容。
Inputs: selector (required).
browser_clickC
点击页面上的元素(支持 CSS 选择器或文本匹配)。
Inputs: text, selector, rightClick.
browser_clickAtA
在页面的指定坐标位置点击(如无法用 CSS 选择器定位的元素)。用于滑动验证码、弹窗、canvas 等场景。
Inputs: x (required), y (required), button, clickCount.
browser_closeA
关闭当前页面(不清除浏览器实例,下次操作自动新建页面)。
Inputs: no named parameters.
browser_closeTabA
关闭当前标签页,自动切换到上一个标签页。
Inputs: index.
browser_consoleB
获取页面控制台日志(console.log/error/warn 的输出)。
Inputs: clear.
browser_deleteCookiesC
删除 Cookie。不传参数则删除所有 Cookie。
Inputs: name, domain.
browser_dragB
拖拽元素到目标位置。
Inputs: selector (required), xOffset, yOffset, targetSelector.
browser_evaluateB
在页面中执行自定义 JavaScript 代码,返回结果。
Inputs: code (required).
browser_exportC
将页面数据导出为 CSV 或 JSON 文件。限时免费中。
Inputs: selector (required), format, filePath.
browser_extractB
提取页面文字内容。
Inputs: selector, attribute.
browser_fillA
填写输入框。模拟真实用户输入,带延迟。
Inputs: value (required), selector (required), clear, delayMs.
browser_forwardB
浏览器前进到下一页。
Inputs: no named parameters.
browser_getBoundsA
获取页面上元素的位置和大小信息。用于计算点击坐标、滑动距离等。
Inputs: selector (required).
browser_getCookiesA
获取当前页面的所有 Cookie。
Inputs: domain.
browser_getHTMLA
获取当前页面的 HTML 源码(或指定元素的 HTML)。
Inputs: outer, selector.
browser_getTitleA
获取当前页面的标题。
Inputs: no named parameters.
browser_getUrlB
获取当前页面的完整 URL。
Inputs: no named parameters.
browser_getViewportA
获取当前页面的视口大小和滚动位置。
Inputs: no named parameters.
browser_hoverA
将鼠标悬停在元素上(触发 hover CSS 效果)。
Inputs: text, selector.
browser_iframeA
切换到 iframe 上下文(之后的操作在 iframe 内执行),或切回主页面。
Inputs: selector (required).
browser_mouseMoveB
模拟鼠标移动到指定坐标。支持分段移动(模拟真人轨迹)。
Inputs: x (required), y (required), steps.
browser_newTabB
打开一个新的空白标签页。
Inputs: url.
browser_pdfA
将当前页面导出为 PDF(返回 Base64 编码的 PDF)。
Inputs: scale, format, landscape.
browser_pressKeyA
在页面上按下键盘按键。支持 Enter, Escape, Tab, Backspace, ArrowUp/Down/Left/Right, Delete, 以及组合键如 Control+A, Control+C。
Inputs: key (required).
browser_reloadB
刷新当前页面。
Inputs: ignoreCache.
browser_resetA
重置浏览器实例。关闭所有页面和浏览器进程,重新启动。用于浏览器卡死或状态异常时。
Inputs: no named parameters.
browser_screenshotA
打开一个网页并截图。如果已打开页面,直接截图当前页。返回 PNG 图片。
Inputs: url, waitMs, fullPage.
browser_screenshotElementA
截取页面中某个元素的截图(如某个按钮、图片、区域)。
Inputs: selector (required), scrollIntoView.
browser_scrollB
滚动页面。支持方向滚动或滚动到指定元素。
Inputs: direction (required), amount, selector.
browser_selectA
从下拉列表 () 中选择选项。
Inputs: selector (required), index, label, value.
browser_submitC
提交表单。
Inputs: selector.
browser_switchTabB
切换到指定索引的标签页(从 0 开始)。
Inputs: index (required).
browser_waitA
等待一段时间,或等待某个元素出现。
Inputs: ms, timeout, selector, disappear.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 36 tools
每个工具针对明确的浏览器操作,如导航、交互、提取、标签页管理,用途清晰无重叠。尽管有多个点击类工具(click, clickAt, mouseMove),但描述明确区分了元素点击、坐标点击和鼠标移动。
所有工具统一使用browser_前缀,且动词为小写snake_case风格,如browser_getUrl、browser_mouseMove、browser_clickAt,模式高度一致,便于预测。
36个工具对于完整的浏览器自动化场景是合理的,覆盖了导航、交互、提取、标签页、Cookie、调试等功能,但数量略多,部分工具(如browser_export、browser_batch)可能属于高级功能,整体仍可接受。
工具集覆盖了浏览器自动化的完整生命周期:页面导航、元素操作、表单处理、内容提取、标签页管理、Cookie、截图、PDF导出、控制台日志等,没有明显缺失的核心功能。
Maintenance
Related MCP Connectors
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Cloud browsers for AI agents: saved logins, residential IPs, live human takeover, 57 browser tools.
AI-powered browser automation — navigate, click, fill forms, and extract data from any website.
Cloud browser, web extraction, screenshots, and remote CDP tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to control a browser through a set of tools, allowing them to perform web automation tasks like navigation, typing, clicking, and taking screenshots.Apache 2.0
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to control a browser through a set of tools, allowing them to perform web automation tasks like navigation, typing, clicking, and taking screenshots.Apache 2.0
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to control a browser through a set of tools, allowing them to perform web automation tasks like navigation, typing, clicking, and taking screenshots.Apache 2.0
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to control a browser through a set of tools, allowing them to perform web automation tasks like navigation, typing, clicking, and taking screenshots.Apache 2.0