Skip to main content
Glama
kamkozlowski

dev-browser-mcp

by kamkozlowski

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 build

Related 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 installnpm 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 替换为你的检出路径。

工具

工具

用途

dev_browser_run

主要工具。 执行沙盒化的 Playwright 脚本。

dev_browser_list_pages

列出标签页:{id, url, title, name}

dev_browser_page_open

获取/创建命名页面(或通过 targetId 附加)

dev_browser_close_page

关闭命名页面

dev_browser_goto

导航

dev_browser_snapshot

AI 无障碍快照(snapshotForAI

dev_browser_screenshot

PNG 截图(也作为图像返回)

dev_browser_click

通过 CSS 选择器或快照引用点击

dev_browser_fill

填充输入框

dev_browser_type

逐字符输入

dev_browser_evaluate

在页面中执行 eval JavaScript

dev_browser_wait_for_selector

等待选择器

dev_browser_status

守护进程状态

dev_browser_browsers

管理的浏览器实例

dev_browser_stop

停止守护进程

dev_browser_install

安装 Playwright Chromium

阅读 dev-browser://guide 查看完整的沙盒 API,包括 page.cua(视觉)和 page.domCua(DOM ID)。

环境变量

变量

含义

DEV_BROWSER_BIN

覆盖捆绑的 dev-browser CLI 路径

DEV_BROWSER_SKIP_CHROMIUM

设为 true 跳过安装后/自动 Chromium 设置

DEV_BROWSER_BROWSER

命名的守护进程浏览器实例(默认:default

DEV_BROWSER_HEADLESS

设为 true 以无窗口模式启动 Chromium

DEV_BROWSER_CONNECT

auto / true 附加到 Chrome,或 CDP URL

DEV_BROWSER_IGNORE_HTTPS_ERRORS

设为 true 以接受自签名证书

DEV_BROWSER_TIMEOUT

脚本超时时间(秒,默认:30

DEV_BROWSER_IDLE_TIMEOUT

关闭空闲启动的浏览器,例如 5m

每次调用时可通过 browserconnectheadlessignoreHttpsErrorstimeoutSeconds 覆盖环境变量。

与 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 build
Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • F
    license
    -
    quality
    C
    maintenance
    Enables 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.
  • A
    license
    B
    quality
    F
    maintenance
    Enables 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.
    20
    239
    MIT

View all related MCP servers

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.

View all MCP Connectors

Latest Blog Posts

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