Modern MCP server + browser extensions for reliable, multi‑instance automation over a single WebSocket daemon.
- Single WS daemon (8765), many sessions (Claude instances)
- Per‑session tab routing and ownership (no cross‑talk)
- Unified tools across Chrome and Firefox
- Auto‑reconnect (Firefox adds alarms + online hooks)
- Node.js 20+
- Chrome or Firefox
- Claude Code
- Also works with WSL2 and Windows Chrome
git clone https://github.com/david-strejc/browsermcp-enhanced.git
cd browsermcp-enhanced
./scripts/deploy-
Option A: User services (recommended for nvm users, no sudo required):
./scripts/systemd-user-install.sh
-
Option B: System services (requires sudo):
sudo ./scripts/systemd-install.sh --user "$USER" \ --install-dir "/home/$USER/.local/lib/browsermcp-enhanced" \ --http-port 3000 --ws-port 8765
- Chrome:
chrome://extensions→ Developer mode → Load unpacked →chrome-extension/ - Firefox:
about:debugging#/runtime/this-firefox→ Load Temporary Add‑on →firefox-extension/manifest.json
{
"mcpServers": {
"browsermcp": {
"type": "http",
"url": "http://127.0.0.1:3000/mcp"
}
}
}For detailed architecture and troubleshooting information, see ADVANCE_INFO.md
- WebSocket reconnection may require Chrome restart
- Some sites with strict CSP may require unsafe mode
- Safari and Firefox support coming in v2.0.0
- Behind proxy: If you're behind a proxy, set
NO_PROXY=localhost,127.0.0.1to allow local connections
// Navigate to a URL
await browser_navigate({ url: "https://example.com" })
// Snapshot
await snapshot.accessibility({ mode: 'scaffold' })
// Click an element
await browser_click({ ref: "button-1", element: "Submit button" })// Plain DOM
await js.execute({ code: "return document.title" })
// Safe operation (no code)
await js.execute({ method: 'query', args: ['h3', { attrs: ['textContent'], limit: 10 }] })
// Unsafe (enable in extension options first)
await js.execute({ code: "(function(){ return location.href })()", unsafe: true })// Multi-step form filling
await browser_multitool({
intent: "form_fill",
snapshot: snapshotData,
fields: {
"username": "john.doe",
"email": "[email protected]",
"message": "Hello world"
}
})Daemon: /tmp/browsermcp-daemon.log, /tmp/browsermcp-events.log
Chrome: chrome://extensions → Inspect (background)
Firefox: about:debugging → Inspect (background)
# Allow all origins (development)
BROWSER_MCP_ALLOWED_ORIGINS="*"
# Specific origins (production)
BROWSER_MCP_ALLOWED_ORIGINS="https://example.com,https://app.example.com"
# Custom WebSocket port
BROWSER_MCP_PORT=8765- Unsafe mode toggle (required for
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
# Run tests
npm test
# Quick test
npm run test:quick
# With coverage
npm run test:coverage# Watch mode
npm run watch
# Type checking
npm run typecheck
# Inspector
npm run inspectorSee CHANGELOG.md for detailed version history.
- 🚀 First production-ready release
- ✅ RPC-based safe mode execution
- ✅ Sandboxed iframe isolation
- ✅ Comprehensive testing suite
- ✅ Full documentation
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Model Context Protocol team for the MCP specification
- Playwright for browser automation inspiration
- Claude and the o3 model for architectural guidance
- All contributors and testers
- WebSocket reconnection may require Chrome restart
- Some sites with strict CSP may require unsafe mode
- Safari and Firefox support coming in v2.0.0
Made with ❤️ by the LaskoBOT Contributors