@bunbrowser/mcp
Ultra-fast, zero-download MCP server for browser automation powered by Bun.WebView. Provides 24 tools for navigation, interaction, screenshots, performance audits, and more, as a drop-in replacement for @playwright/mcp.
README
β‘ @bunbrowser/mcp
Ultra-fast, zero-download Model Context Protocol (MCP) server for browser automation, powered natively by
Bun.WebView.A 100% drop-in lightweight replacement for
@playwright/mcpwith identical AI tool semantics, nativeisTrusted: trueOS events, sub-50ms startup times, and zero binary bloat.
π Why bunbrowser?
| Feature | @playwright/mcp (Official Playwright) |
@bunbrowser/mcp (Native Bun.WebView) |
|---|---|---|
| Startup Latency | ~500ms - 2.5s cold start | < 50ms (Instantaneous) |
| Binary Downloads | ~300MB - 1GB dedicated browser packages | 0 MB (Uses Chrome/Chromium on Linux/Win or WKWebView on macOS) |
| Base Memory Footprint | ~180MB - 350MB RAM | ~25MB - 50MB RAM |
| Event Fidelity | Synthetic via CDP JavaScript injection | Native OS-level compositor events (isTrusted: true) |
| Accessibility Tree | browser_snapshot with [ref=eN] |
Identical [ref=eN] format and prompt compatibility |
| Batch Form Filling | Individual turns for each field | Single-turn browser_fill_form |
| Performance & SEO | Requires custom scripts | Built-in browser_lighthouse_audit (0-100 scores) & browser_get_metrics |
| Motion & Animation | Not exposed directly | Built-in browser_record_animation (WebM & animated GIF) |
| Raw CDP Access | Restricted | Built-in browser_cdp tool |
π Official Documentation (DiΓ‘taxis Framework)
The project documentation is structured using the DiΓ‘taxis Framework:
- π Tutorials (Learn from scratch): Guided onboarding, installation, and your first AI automation.
- π οΈ How-To Guides (Practical recipes):
- π Technical Reference (Specifications):
- π‘ Explanation & Architecture (Concepts):
For a complete navigation map, see docs/index.md.
π¦ Installation & Setup
1. Requirements
- Bun (v1.3.12 or higher).
- On macOS: Zero additional downloads (uses built-in
WKWebView). - On Linux / Windows: Google Chrome, Chromium, Brave, or Microsoft Edge installed.
2. Configure in your MCP Client
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"playwright": {
"command": "bunx",
"args": ["@bunbrowser/mcp"]
}
}
}
Cursor (.cursor/mcp.json):
{
"mcpServers": {
"browser": {
"command": "bunx",
"args": ["@bunbrowser/mcp"]
}
}
}
Google Antigravity (~/.gemini/antigravity/mcp_config.json):
{
"mcpServers": {
"browser": {
"command": "bunx",
"args": ["@bunbrowser/mcp"]
}
}
}
CLI Execution with Custom Viewport:
bunx @bunbrowser/mcp --width 1920 --height 1080 --url "https://bun.sh"
π οΈ Complete MCP Tools Catalog (24 Tools)
π Navigation
browser_navigate: Navigate to a URL with optional accessibility snapshot.browser_navigate_back: Navigate back in history.browser_navigate_forward: Navigate forward in history.browser_reload: Reload active page.
π Inspection & State
browser_snapshot: PRIMARY INSPECTION. Captures semantic accessibility tree with[ref=eN]IDs.browser_take_screenshot: Visual viewport screenshot in Base64 (PNG, JPEG, WebP).browser_evaluate: Evaluates JavaScript in page context.browser_get_content: Returns full HTML markup or plain text.browser_console_logs: Retrieves recorded console logs.
π±οΈ Element Interaction
browser_click: Clicks element viaref, CSS selector, or coordinates.browser_type: Types text into input elements with auto-wait.browser_fill_form: BATCH FORM FILLER. Fills multiple inputs and submits in a single turn.browser_press_key: Dispatches keyboard keys and key combinations.browser_hover: Moves mouse pointer over an element.browser_scroll: Directional, delta-based, or element-targeted scrolling.browser_select_option: Selects options in<select>dropdowns.browser_drag: Drag-and-drop between source and destination elements.
π Tab Management
browser_tabs: Lists all open tabs and active state.browser_tab_new: Opens a new tab with optional URL and viewport size.browser_tab_switch: Switches active tab focus bytabId.browser_tab_close: Closes a specific tab or active tab.browser_resize: Resizes viewport dimensions.
β‘ Storage & CDP
browser_cdp: Executes raw Chrome DevTools Protocol commands.browser_cookies: Gets, sets, or clears browser session cookies.browser_localstorage: Gets, sets, or clearslocalStoragekeys.
π Performance & Lighthouse Audits
browser_get_metrics: Real-time network timings (TTFB, DOM load), JS heap memory, and resource waterfalls.browser_lighthouse_audit: Full Lighthouse audit with 0-100 scores for Performance, Accessibility, Best Practices, and SEO.
π¬ Video Recording & Motion
browser_start_recording: Starts continuous video recording (webmorgif).browser_stop_recording: Stops recording and exports file with duration and size metrics.browser_record_animation: One-shot recording of UI transitions and keyframe animations for a givendurationMs.
π§ͺ Automated Testing
Run the complete test suite:
# Run unit & integration tests
bun test
# Verify strict TypeScript types
bun run check
π Codebase Structure
bunbrowser/
βββ bin/
β βββ bunbrowser.ts # CLI binary executable
β βββ bunpw-mcp.ts # Legacy compatibility wrapper
βββ src/
β βββ index.ts # Entrypoint CLI & Stdio transport
β βββ server.ts # McpServer instance & tool registration
β βββ browser/
β β βββ types.ts # TypeScript interfaces & configuration types
β β βββ manager.ts # BrowserManager (multi-tab lifecycle)
β β βββ tab.ts # BrowserTab wrapper over Bun.WebView
β β βββ recorder.ts # TabRecorder video & animation capture
β β βββ gif_encoder.ts # Pure TypeScript GIF89a encoder (0 dependencies)
β β βββ snapshot.ts # Accessibility Tree & ref resolver
β βββ tools/
β βββ navigation.ts # Navigation tools
β βββ inspection.ts # Snapshot, screenshot, evaluate, content, logs
β βββ interaction.ts # Click, type, fill_form, press_key, hover, scroll, drag
β βββ tabs.ts # Tabs management & resize
β βββ storage_cdp.ts # CDP, cookies, localStorage
β βββ metrics.ts # get_metrics, lighthouse_audit
β βββ video.ts # start_recording, stop_recording, record_animation
βββ test/
β βββ manager.test.ts # Tab manager tests
β βββ snapshot.test.ts # Accessibility tree tests
β βββ interaction.test.ts # Real DOM interaction tests
β βββ metrics.test.ts # Metrics & Lighthouse audit tests
β βββ video.test.ts # Video recording & GIF encoder tests
β βββ mcp_server.test.ts # End-to-end MCP JSON-RPC tests
βββ docs/ # DiΓ‘taxis framework documentation
βββ 1-tutorials/
βββ 2-how-to/
βββ 3-reference/
βββ 4-explanation/
π License
MIT License. See LICENSE for details.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.