dev-browser-mcp
dev-browser-mcp
用于 SawyerHood/dev-browser 的 MCP 服务器。代理驱动一个持久的 Chromium(或一个已运行的 Chrome),使用沙盒 JavaScript 和一组小型结构化工具。
仓库:github.com/kamkozlowski/dev-browser-mcp
脚本在 QuickJS 中运行,而非 Node.js。命名页面通过 dev-browser 守护进程在工具调用之间持久存在。
dev-browser(CLI + Playwright Chromium)是此包的依赖项。npm install 会下载 CLI 并安装 Chromium。无需全局安装 dev-browser。设置 DEV_BROWSER_SKIP_CHROMIUM=1 可跳过 Chromium 下载(例如,仅附加到现有 Chrome 时)。DEV_BROWSER_BIN 仍然会覆盖捆绑的 CLI。
安装
克隆并构建:
git clone https://github.com/kamkozlowski/dev-browser-mcp.git
cd dev-browser-mcp
npm install
npm run build或者从 GitHub tarball 安装:
npm pack github:kamkozlowski/dev-browser-mcp
tar -xzf dev-browser-mcp-*.tgz
cd package
npm install
npm run buildRelated MCP server: Cloudflare Playwright MCP
Cursor 配置
添加到 ~/.cursor/mcp.json(或项目 .cursor/mcp.json)。
推荐:从 GitHub 引导(缓存到 ~/.cache 下)
无需本地克隆。首次启动时,Cursor 会下载包、安装依赖、构建并启动服务器:
{
"mcpServers": {
"dev-browser": {
"command": "bash",
"args": [
"/ABS/PATH/TO/dev-browser-mcp/scripts/bootstrap-mcp.sh"
],
"env": {
"DEV_BROWSER_HEADLESS": "true"
}
}
}
}如果没有保留本地克隆,可使用以下一行命令(与 scripts/bootstrap-mcp.sh 逻辑相同):
{
"mcpServers": {
"dev-browser": {
"command": "bash",
"args": [
"-lc",
"CACHE=\"${XDG_CACHE_HOME:-$HOME/.cache}/dev-browser-mcp\"; LOCK=\"$CACHE/.install.lock\"; PKG=\"$CACHE/package\"; ENTRY=\"$PKG/dist/index.js\"; mkdir -p \"$CACHE\"; install() { cd \"$CACHE\" && rm -rf package dev-browser-mcp-*.tgz && npm pack github:kamkozlowski/dev-browser-mcp >/dev/null && tar -xzf dev-browser-mcp-*.tgz && rm -f dev-browser-mcp-*.tgz && cd package && npm install && npm run build; }; if [ ! -f \"$ENTRY\" ]; then ( flock -n 9 || flock 9; [ -f \"$ENTRY\" ] || install ) 9>\"$LOCK\"; fi; [ -f \"$ENTRY\" ] || { echo \"Install failed; rm -rf $CACHE\" >&2; exit 1; }; cd \"$PKG\" && exec node dist/index.js"
],
"env": {
"DEV_BROWSER_HEADLESS": "true"
}
}
}
}如果服务器启动失败并提示 Cannot find module .../dist/index.js,请删除损坏的缓存并重试:
rm -rf "${XDG_CACHE_HOME:-$HOME/.cache}/dev-browser-mcp"要附加到正在运行的 Chrome 而非启动 Chromium:
{
"mcpServers": {
"dev-browser": {
"command": "bash",
"args": [
"-lc",
"CACHE=\"${XDG_CACHE_HOME:-$HOME/.cache}/dev-browser-mcp\"; LOCK=\"$CACHE/.install.lock\"; PKG=\"$CACHE/package\"; ENTRY=\"$PKG/dist/index.js\"; mkdir -p \"$CACHE\"; install() { cd \"$CACHE\" && rm -rf package dev-browser-mcp-*.tgz && npm pack github:kamkozlowski/dev-browser-mcp >/dev/null && tar -xzf dev-browser-mcp-*.tgz && rm -f dev-browser-mcp-*.tgz && cd package && npm install && npm run build; }; if [ ! -f \"$ENTRY\" ]; then ( flock -n 9 || flock 9; [ -f \"$ENTRY\" ] || install ) 9>\"$LOCK\"; fi; [ -f \"$ENTRY\" ] || { echo \"Install failed; rm -rf $CACHE\" >&2; exit 1; }; cd \"$PKG\" && exec node dist/index.js"
],
"env": {
"DEV_BROWSER_CONNECT": "auto",
"DEV_BROWSER_SKIP_CHROMIUM": "true"
}
}
}
}在 Chrome 的 chrome://inspect/#remote-debugging 中启用远程调试,或使用 --remote-debugging-port=9222 启动。
本地克隆(简单)
在检出目录中执行 npm install 和 npm run build 后:
{
"mcpServers": {
"dev-browser": {
"command": "node",
"args": ["/ABS/PATH/TO/dev-browser-mcp/dist/index.js"],
"env": {
"DEV_BROWSER_HEADLESS": "true"
}
}
}
}本地克隆(自引导,bash)
如果 dist/ 不存在,Cursor 会在首次启动时安装并构建:
{
"mcpServers": {
"dev-browser": {
"command": "bash",
"args": [
"-lc",
"REPO=\"/ABS/PATH/TO/dev-browser-mcp\"; if [ ! -f \"$REPO/dist/index.js\" ]; then cd \"$REPO\" && npm install && npm run build; fi; cd \"$REPO\" && exec node dist/index.js"
],
"env": {
"DEV_BROWSER_HEADLESS": "true"
}
}
}
}将 REPO 替换为你的检出路径。
开发(TypeScript,无需构建)
{
"mcpServers": {
"dev-browser": {
"command": "bash",
"args": [
"-lc",
"REPO=\"/ABS/PATH/TO/dev-browser-mcp\"; cd \"$REPO\" && exec npx --yes tsx src/index.ts"
],
"env": {
"DEV_BROWSER_HEADLESS": "true"
}
}
}
}将 REPO 替换为你的检出路径。
工具
工具 | 用途 |
| 主要工具。 执行沙盒化的 Playwright 脚本。 |
| 列出标签页: |
| 获取/创建命名页面(或通过 targetId 附加) |
| 关闭命名页面 |
| 导航 |
| AI 无障碍快照( |
| PNG 截图(也作为图像返回) |
| 通过 CSS 选择器或快照引用点击 |
| 填充输入框 |
| 逐字符输入 |
| 在页面中执行 |
| 等待选择器 |
| 守护进程状态 |
| 管理的浏览器实例 |
| 停止守护进程 |
| 安装 Playwright Chromium |
阅读 dev-browser://guide 查看完整的沙盒 API,包括 page.cua(视觉)和 page.domCua(DOM ID)。
环境变量
变量 | 含义 |
| 覆盖捆绑的 |
| 设为 |
| 命名的守护进程浏览器实例(默认: |
| 设为 |
|
|
| 设为 |
| 脚本超时时间(秒,默认: |
| 关闭空闲启动的浏览器,例如 |
每次调用时可通过 browser、connect、headless、ignoreHttpsErrors 和 timeoutSeconds 覆盖环境变量。
与 Playwright MCP 的区别
dev-browser 围绕每次决策一个沙盒脚本构建,而非一长串原子化的 MCP 调用。对于超出单次 goto/click/fill 的操作,请使用 dev_browser_run。便利工具的存在是为了让常见的检查/操作步骤保持结构化。
与 benkraus/dev-browser-mcp(Chrome 扩展 + CDP 中继)不同,此服务器封装了官方的 dev-browser CLI,带有其 QuickJS 沙盒和持久化守护进程页面。
开发
npm test
npm run typecheck
npm run buildMaintenance
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
- Flicense-qualityCmaintenanceEnables 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.
- Flicense-qualityCmaintenanceEnables 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.
- Flicense-qualityCmaintenanceEnables 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.
- AlicenseBqualityFmaintenanceEnables AI agents to directly control your real Chrome browser with full context including login sessions, cookies, and open tabs. It provides tools for page scanning, JavaScript execution, CDP control, screenshots, and physical mouse/keyboard input for authentic browser automation.20239MIT
Related MCP Connectors
AI-powered browser automation — navigate, click, fill forms, and extract data from any website.
Provides cloud browser automation capabilities using Stagehand and Browserbase, enabling LLMs to i…
Live browser debugging for AI assistants — DOM, console, network via MCP.
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/kamkozlowski/dev-browser-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server