LaskoBOT v1.30.7
</div>现代MCP服务器+浏览器扩展,用于通过单个WebSocket守护进程实现可靠的多实例自动化。
git clone https://github.com/david-strejc/browsermcp-enhanced.git
cd browsermcp-enhanced
./scripts/deploy
选项A:用户服务(推荐给nvm用户,无需sudo):
./scripts/systemd-user-install.sh
选项B:系统服务(需要sudo):
sudo ./scripts/systemd-install.sh --user "$USER" \
--install-dir "/home/$USER/.local/lib/browsermcp-enhanced" \
--http-port 3000 --ws-port 8765
chrome://extensions → 开发者模式 → 加载已解压的 → chrome-extension/about:debugging#/runtime/this-firefox → 加载临时附加组件 → firefox-extension/manifest.json {
"mcpServers": {
"browsermcp": {
"type": "http",
"url": "http://127.0.0.1:3000/mcp"
}
}
}
有关详细架构和故障排除信息,请参阅ADVANCE_INFO.md
NO_PROXY=localhost,127.0.0.1以允许本地连接// 导航到URL
await browser_navigate({ url: "https://example.com" })
// 快照
await snapshot.accessibility({ mode: 'scaffold' })
// 点击元素
await browser_click({ ref: "button-1", element: "提交按钮" })
// 简单DOM
await js.execute({ code: "return document.title" })
// 安全操作(无代码)
await js.execute({ method: 'query', args: ['h3', { attrs: ['textContent'], limit: 10 }] })
// 不安全(首先在扩展选项中启用)
await js.execute({ code: "(function(){ return location.href })()", unsafe: true })
// 多步骤表单填写
await browser_multitool({
intent: "form_fill",
snapshot: snapshotData,
fields: {
"username": "john.doe",
"email": "john@example.com",
"message": "Hello world"
}
})
守护进程: /tmp/browsermcp-daemon.log, /tmp/browsermcp-events.log
Chrome: chrome://extensions → 检查(后台)
Firefox: about:debugging → 检查(后台)
# 允许所有来源(开发)
BROWSER_MCP_ALLOWED_ORIGINS="*"
# 特定来源(生产)
BROWSER_MCP_ALLOWED_ORIGINS="https://example.com,https://app.example.com"
# 自定义WebSocket端口
BROWSER_MCP_PORT=8765
unsafe: true所需)browser_navigate, browser_go_back, browser_go_forwarddom.click, dom.type, dom.hover, dom.selectsnapshot.accessibilitytabs.list, tabs.select, tabs.new, tabs.closeconsole.get, screenshot.capture, js.execute# 运行测试
npm test
# 快速测试
npm run test:quick
# 包含覆盖率
npm run test:coverage
# 监视模式
npm run watch
# 类型检查
npm run typecheck
# 检查器
npm run inspector
查看CHANGELOG.md以获取详细的版本历史记录。
欢迎贡献!请随意提交Pull Request。
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)此项目根据MIT许可证发布 - 查看LICENSE文件以获取详细信息。
由LaskoBOT贡献者制作 ❤️