@hasna/browser
v0.3.4
Published
General-purpose browser agent toolkit — Playwright, Chrome DevTools Protocol, Lightpanda with auto engine selection. CLI + MCP + REST + SDK.
Maintainers
Readme
open-browser
Unified browser automation MCP for AI agents — wraps Chrome DevTools, Playwright, and Lightpanda with a common interface, screenshot compression, and switchable backends.
Problem
chrome-devtools-mcp is great but has critical issues:
take_screenshotreturns raw PNG that can exceed 20MB, breaking MCP protocol- No compression/resize before returning
- No backend flexibility (only Chrome)
- No smart routing (always spins up full Chrome even for simple fetches)
Solution
open-browser provides:
- Unified tool interface — same tools work across all backends
- Automatic screenshot compression — max 1200px, JPEG 70%, guaranteed <500KB
- Switchable backends — Chrome DevTools, Playwright, Lightpanda
- Smart auto-selection — light pages → Lightpanda, JS apps → Chrome, cross-browser → Playwright
- All the tools — navigate, click, fill, snapshot, screenshot, upload, evaluate, wait
Backends
| Backend | Speed | JS Support | Use case | |---------|-------|------------|----------| | Chrome DevTools | Medium | Full | Complex SPAs, auth flows, file uploads | | Playwright | Medium | Full | Cross-browser, PDF, reliable selectors | | Lightpanda | Fast (~10x) | Partial | Static pages, scraping, DOM inspection |
Installation
bun install -g @hasna/browserRequirements
Note: The Bun.WebView engine requires Bun canary until WebView support lands in a stable release. Install with:
bun upgrade --canary. Other engines (Playwright, CDP, Lightpanda) work with stable Bun.
Usage
# Default (Chrome DevTools backend)
browser serve
# Playwright backend
BROWSER_BACKEND=playwright browser serve
# Lightpanda backend
BROWSER_BACKEND=lightpanda browser serveMCP Tools
All tools work identically across backends:
navigate_page— Go to URLtake_snapshot— Get accessibility tree (text, no size issues)take_screenshot— Compressed screenshot (max 1200px, JPEG 70%)click— Click element by UIDfill— Fill inputtype_text— Type textpress_key— Press keyboard keyupload_file— Upload file to inputevaluate_script— Execute JavaScriptwait_for— Wait for element/conditionnew_page— Open new tabclose_page— Close tablist_pages— List open tabsget_network_requests— Inspect network traffic
Status
🚧 In development. See tasks for progress.
License
Apache-2.0 — see LICENSE
