browser-mcp
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., "@browser-mcp Open example.com, take a snapshot, then click the login link and screenshot the result."
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.
browser-mcp
一个为 AI 而设计的浏览器操作 MCP 服务器:22 个工具,让 AI 像人一样浏览、点击、输入、截图网页——不需要手写选择器。针对办公自动化场景做了专项优化:批量填表、数据提取、文件下载、PDF 存档、页面监控。
为什么是它
市面上大多数浏览器 MCP 要求 AI 写 CSS 选择器,这是 AI 操作网页失败的头号原因。browser-mcp 采用 ref 编号体系:
AI: browser_snapshot
← [e1] <a> More information -> /about
[e2] <input type=search> (搜索)
[e3] <button> 登录
AI: browser_click { "ref": "e3" } ← 点击"登录",指哪打哪
✓ 已点击:e3snapshot 一次,拿到全部可交互元素的编号,之后所有操作只用 ref。元素找不到时,错误信息还会附带当前页面状态摘录,AI 能自行纠错重试,而不是瞎猜。
Related MCP server: Cloudflare Playwright MCP
特性
ref 编号体系 — 快照给可交互元素编号,点击/输入/选择全部支持 ref 定位,AI 无需写选择器
智能等待 — 导航、点击后自动等待网络空闲(最多 4s),大幅减少手动 wait
登录态持久化 — cookie/localStorage 保存到磁盘(
storageState),重启免重新登录错误自解释 — 操作失败时返回当前 URL + 页面文本摘录 + 修复建议
办公自动化专项 — 批量填表、表格/列表数据提取(JSON/CSV)、文件下载落盘、页面 PDF 存档、后台变化监控
多浏览器回退 — Chromium → Edge → Chrome 依次尝试,Windows 无需下载浏览器即可使用
零构建 — 纯 ESM 单文件,
node index.mjs直接跑
演示
AI 通过 MCP 协议真实打开 example.com、识别元素、点击链接跳转:

快速开始
git clone https://github.com/jixingyu999/browser-mcp.git
cd browser-mcp
npm install
npm test # 端到端测试:真实打开网页、ref 点击、截图接入 MCP 宿主(Claude Desktop / Cursor / WorkBuddy 等)
在宿主的 MCP 配置文件中添加:
{
"mcpServers": {
"browser-mcp": {
"command": "node",
"args": ["/path/to/browser-mcp/index.mjs"],
"env": {
"BROWSER_MCP_HEADLESS": "0",
"BROWSER_MCP_STORAGE_STATE": "/path/to/browser-mcp/storage.json"
}
}
}
}环境变量
变量 | 默认值 | 说明 |
|
| 设为 |
| 系统临时目录 | 截图输出目录 |
| (空) | 登录态文件路径,配置后自动加载/保存 |
|
| 默认操作超时(毫秒) |
工具列表(22 个)
工具 | 说明 |
| 打开 URL,自动补全协议前缀,完成后等待网络空闲 |
| 获取页面结构 + 可交互元素 ref 编号列表(核心工具) |
| 点击元素: |
| 输入文字:ref 定位,可选清空、回车提交 |
| 发送按键(Enter / Escape / Control+A …) |
| 截图,返回图片数据并保存文件 |
| 获取页面或指定元素的文本 |
| 在页面上下文执行 JavaScript |
| 上/下滚动 |
| 选择下拉框选项 |
| 等待毫秒 / 元素出现 / 文本出现 |
| 后退 |
| 列出所有标签页 |
| 新建 / 切换标签页 |
| 手动保存登录态 |
| 专项:一次填完整个表单(文本/勾选/下拉混合,可自动提交) |
| 专项:提取 |
| 专项:按容器+字段映射抓取列表数据(JSON/CSV) |
| 专项:点击触发下载并自动保存到输出目录 |
| 专项:页面保存为 PDF 存档(无头模式) |
| 专项:后台轮询监控页面变化(selector/text/JS 三种模式) |
| 关闭浏览器(自动保存登录态) |
办公自动化专项
针对日常工作中最繁琐的重复流程,提供一站式工具:
场景 | 工具组合 | 效果 |
填写报名/审批/申请表单 |
| 一次调用填完文本、勾选、下拉全部字段,自动提交 |
扒取后台数据/报表 |
| 表格、列表一键转 JSON/CSV 并落盘,CSV 转义正确处理 |
导出对账单/发票 |
| 点击导出按钮自动等待下载并保存 |
网页存档留证 |
| 页面转 A4 PDF 存档 |
盯库存/价格/审批状态 |
| 后台轮询监控,随时 check 是否变化 |
示例:把后台报表自动存档
1. browser_navigate 后台地址(登录态已持久化,免登录)
2. browser_fill_form { fields: [{ref:"e3", value:"2026-09"}, {ref:"e5", value:true}], submitRef: "e6" }
3. browser_extract_table { format: "csv", save: true, filename: "9月报表.csv" }
4. browser_pdf { filename: "9月报表存档.pdf" }典型用法(AI 工作流)
1. browser_navigate https://example.com
2. browser_snapshot → 拿到元素 ref 列表
3. browser_type { ref: "e2", text: "关键词", submit: true }
4. browser_click { ref: "e3" } → 点击搜索按钮
5. browser_screenshot → 截图查看结果
6. browser_get_text { selector: "body" } → 提取结果文本架构
AI 宿主(Claude Desktop / Cursor / WorkBuddy)
│ MCP 协议(stdio / JSON-RPC)
▼
browser-mcp(Node.js,@modelcontextprotocol/sdk)
│ Playwright API
▼
Chromium / Edge / Chrome(自动回退)Roadmap
网络嗅探工具(拦截 XHR / WebSocket,直接读数据)
游戏操作套件(鼠标坐标移动、按住不放、状态轮询)
失败视觉回退(选择器失败自动截图,AI 视觉定位)
操作轨迹回放(Playwright trace 生成)
License
Available Tools
22 toolsbrowser_backB
浏览器后退一步
Inputs: no named parameters.
browser_clickB
点击元素。优先用 ref(来自 browser_snapshot,如 'e12');也支持 CSS 选择器 / text=文案 / role=名称
Inputs: ref, selector.
browser_closeA
关闭浏览器并释放资源(自动保存登录态)
Inputs: no named parameters.
browser_downloadA
点击触发下载并把文件保存到输出目录(如导出按钮、附件链接)
Inputs: ref, filename, selector.
browser_evaluateC
在页面上下文执行 JavaScript 并返回结果(读 window 全局变量、DOM 数据等)
Inputs: script (required).
browser_extractB
按"重复容器 + 字段映射"抓取列表数据(商品列表/搜索结果/通知列表等),返回 JSON/CSV
Inputs: items (required), fields (required), save, format, +1 more.
browser_extract_tableA
提取页面 表格数据为 JSON/CSV(自动识别表头),可直接保存为文件
Inputs: save, format, filename, selector.
browser_fill_formA
一次性填完整个表单:混合支持文本、勾选/取消勾选、下拉选择,可指定提交按钮。比逐字段调用 browser_type 快数倍
Inputs: fields (required), submitRef, submitSelector.
browser_get_textC
获取页面或指定元素的文本内容
Inputs: selector.
browser_list_tabsB
列出所有打开的标签页
Inputs: no named parameters.
browser_pdfB
把当前页面保存为 PDF(用于报告存档、留证)。注意:仅在无头模式可用
Inputs: format, filename.
browser_press_keyB
向当前焦点元素发送按键,如 Enter / Tab / ArrowDown
Inputs: key (required).
browser_save_stateA
把当前登录态(cookie/localStorage)保存到磁盘,重启后免登录。需配置 BROWSER_MCP_STORAGE_STATE
Inputs: no named parameters.
browser_screenshotB
截图当前页面(返回图片并保存到输出目录)
Inputs: filename, fullPage.
browser_scrollC
滚动页面
Inputs: direction (required), amount.
browser_select_optionC
选择下拉框(select 元素)的选项
Inputs: values (required), ref, selector.
browser_snapshotA
获取页面结构与可交互元素列表(每个元素带 ref 编号),后续操作直接用 ref,无需写选择器
Inputs: no named parameters.
browser_tabC
新建或切换标签页
Inputs: action (required), url, index.
browser_typeB
向输入框输入文字。优先用 ref 定位;可选回车提交
Inputs: text (required), ref, clear, submit, +1 more.
browser_waitB
等待:指定毫秒数、或等待某元素/某段文本出现
Inputs: ms, text, selector.
browser_watchB
后台监控页面变化:盯库存/价格/审批状态等。start 登记轮询任务,check 查询变化,stop 停止
Inputs: action (required), id, mode, target, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 22 tools
Most tools have clearly distinct targets (navigate vs click vs press_key vs select_option vs download), and the descriptions give explicit routing hints (ref-first, fill_form is the batch version of type). A few pairs still blur: browser_get_text / browser_snapshot / browser_evaluate / browser_extract all return page content, and browser_wait vs browser_watch both involve waiting for change. browser_type vs browser_fill_form is clarified but still a judgment call for the agent.
Every tool uses the same browser_ prefix plus a snake_case verb/noun (browser_list_tabs, browser_select_option, browser_save_state). No camelCase, no bare verbs, no version suffixes. The pattern is fully predictable and lets an agent guess names.
22 tools is at the heavy end of the range; the core set (navigate, snapshot, click, type, get_text, screenshot, scroll, tabs) covers 80% of usage, while extract_table, extract, pdf, watch, save_state and fill_form are convenience or niche wrappers. Each is defensible on its own, but the surface is larger than the domain strictly requires.
Navigation, interaction, extraction, tabs, downloads, PDF, state persistence and background monitoring are all covered — a fuller lifecycle than most browser servers. Gaps: no hover tool (common for dropdown menus), no dialog/alert accept-dismiss tool, and no drag-and-drop, which will force agents into browser_evaluate workarounds for some flows.
Maintenance
Related MCP Connectors
AI-powered browser automation — navigate, click, fill forms, and extract data from any website.
AI-powered web automation. Navigate websites using AI agents for one page or a thousand
AI-powered web automation. Navigate websites using AI agents for one page or a thousand
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to interact with web browsers using natural language, featuring automated browsing, form filling, vision-based element detection, and structured JSON responses for systematic browser control.63MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to control a browser for web automation tasks like navigation, typing, clicking, and taking screenshots.Apache 2.0
- FlicenseNot gradedqualityBmaintenanceEnables AI assistants to browse websites, extract information, fill forms, interact with pages, and execute multi-step web tasks autonomously.-
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to navigate, interact with, search, extract from, and download from websites through anti-detection browser automation, with multi-tab workflows, session persistence, and batch operations.468 npmMIT