浏览器自动化MCP服务器

浏览器自动化MCP服务器

为Claude等MCP兼容AI助手提供浏览器自动化功能的Model Context Protocol (MCP) 服务器。

快速入门

  1. 克隆仓库: git clone https://github.com/samihalawa/browser-automation-server.git cd browser-automation-server
  2. 安装依赖: npm install
  3. 构建服务器: npm run build
  4. 启动服务器: npm start

配置

在MCP配置文件中添加以下内容:

{
  "servers": {
    "browser-automation": {
      "command": "/path/to/node",
      "args": ["/path/to/browser-automation-server/build/index.js"],
      "enabled": true,
      "port": 3008,
      "environment": {
        "NODE_PATH": "/path/to/node_modules",
        "PATH": "/usr/local/bin:/usr/bin:/bin"
      }
    }
  }
}

示例命令

  • 导航到网址:navigate(url: "https://example.com")
  • 截图:screenshot(fullPage: true)
  • 点击按钮:click(selector: "#submit-button")
  • 填写表单:type(selector: "#username", text: "user123")