MCP Server Mode
Run browse as an MCP server for Cursor, Claude Desktop, Windsurf, and other editors. All 99 CLI commands available as MCP tools.
Overview
Browse can run as an MCP (Model Context Protocol) server, letting editors communicate with it natively instead of spawning shell commands. All 99 CLI commands are available as MCP tools — zero gap between CLI and MCP.
browse --mcpUse --json alongside --mcp for structured responses:
browse --mcp --jsonNote: Requires
npm install @modelcontextprotocol/sdkalongside browse.
Action Context: In MCP mode, write commands automatically include a
[context]line showing what changed (URL, title, tabs, dialogs, errors). No opt-in needed. See Action Context for details.
Setup
Cursor
Create .cursor/mcp.json in your project root:
{
"mcpServers": {
"browse": {
"command": "browse",
"args": ["--mcp"]
}
}
}After saving, restart Cursor. Browse will appear as an available MCP tool.
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"browse": {
"command": "browse",
"args": ["--mcp"]
}
}
}Windsurf
Add to your Windsurf MCP configuration:
{
"mcpServers": {
"browse": {
"command": "browse",
"args": ["--mcp"]
}
}
}Available Tools (99)
Every CLI command maps to an MCP tool prefixed with browse_. Hyphens become underscores (e.g., perf-audit → browse_perf_audit).
Navigation (5)
| Tool | Description |
|---|---|
browse_goto | Navigate to URL |
browse_back | Go back in history |
browse_forward | Go forward in history |
browse_reload | Reload current page |
browse_url | Get current page URL |
Content Extraction (14)
| Tool | Description |
|---|---|
browse_text | Clean page text (no scripts/styles) |
browse_html | Full HTML or element innerHTML |
browse_links | All links as text → href |
browse_forms | Form structure as JSON |
browse_accessibility | ARIA accessibility tree |
browse_js | Evaluate JavaScript expression |
browse_eval | Evaluate JavaScript file |
browse_css | Get computed CSS property |
browse_attrs | Get element attributes |
browse_element_state | Element state (visible, enabled, checked) |
browse_value | Get input/select value |
browse_dialog | Last dialog info |
browse_clipboard | Read/write system clipboard |
browse_errors | Page errors (filtered from console) |
Interaction (26)
| Tool | Description |
|---|---|
browse_click | Click element |
browse_rightclick | Right-click element |
browse_dblclick | Double-click element |
browse_fill | Clear and fill input |
browse_select | Select dropdown option |
browse_hover | Hover over element |
browse_focus | Focus element |
browse_tap | Tap (touch context) |
browse_check | Check checkbox |
browse_uncheck | Uncheck checkbox |
browse_type | Type via keyboard |
browse_press | Press key (Enter, Tab, etc.) |
browse_keydown | Hold key down |
browse_keyup | Release key |
browse_scroll | Scroll element/viewport |
browse_scrollinto | Scroll element into view |
browse_scrollintoview | Alias for scrollinto |
browse_drag | Drag and drop |
browse_highlight | Visual overlay on element |
browse_download | Download file via click |
browse_upload | Upload files to input |
browse_wait | Wait for element/URL/network/timeout |
browse_swipe | Swipe (touch events) |
browse_mouse | Low-level mouse control |
browse_keyboard | Insert text without key events |
browse_dialog_accept | Auto-accept dialogs |
browse_dialog_dismiss | Auto-dismiss dialogs |
Snapshot & Find (4)
| Tool | Description |
|---|---|
browse_snapshot | Accessibility tree with @refs |
browse_snapshot_diff | Diff current vs previous snapshot |
browse_find | Find elements by role, text, label, testid |
browse_count | Count matching elements |
Visual & Compare (6)
| Tool | Description |
|---|---|
browse_screenshot | Viewport/full-page/element screenshot |
browse_pdf | Save page as PDF |
browse_responsive | Mobile/tablet/desktop screenshots |
browse_diff | Text diff between two pages |
browse_screenshot_diff | Pixel-level visual diff |
browse_box | Get element bounding box |
Performance Audit (4)
| Tool | Description |
|---|---|
browse_perf_audit | Full performance audit — Web Vitals, LCP critical path, layout shifts, resource breakdown, image/font audit, DOM complexity, 108 framework detection, 55 SaaS platforms, third-party impact, JS/CSS coverage, recommendations |
browse_detect | Tech stack fingerprint — frameworks, SaaS platforms, CDN, protocol, compression, caching, DOM complexity, third-party inventory |
browse_coverage | JS/CSS code coverage — per-file used/unused bytes |
browse_initscript | Inject JS before every page load |
Tabs & Frames (6)
| Tool | Description |
|---|---|
browse_tabs | List all tabs |
browse_tab | Switch to tab |
browse_newtab | Open new tab |
browse_closetab | Close tab |
browse_frame | Target iframe |
browse_session_close | Close a session |
Recording & Network (17)
| Tool | Description |
|---|---|
browse_console | View/clear console messages |
browse_network | View/clear network requests |
browse_cookies | Dump cookies as JSON |
browse_storage | View/set localStorage |
browse_perf | Navigation timing metrics |
browse_devices | List device names |
browse_cookie | Set/clear/export/import cookies |
browse_header | Set request header |
browse_useragent | Set user agent |
browse_route | Mock/block network requests |
browse_offline | Toggle offline mode |
browse_set | Set geo/media preferences |
browse_har | HAR recording (start/stop) |
browse_video | Video recording (start/stop) |
browse_record | Command recording and export |
browse_cookie_import | Import cookies from real browsers |
browse_emulate | Emulate device |
Auth & State (5)
| Tool | Description |
|---|---|
browse_state | Save/restore browser state |
browse_auth | Credential vault (save/login/list/delete) |
browse_handoff | Swap to visible browser for CAPTCHA/MFA |
browse_resume | Return to headless after handoff |
browse_sessions | List active sessions |
React DevTools (1)
| Tool | Description |
|---|---|
browse_react_devtools | Component tree, props, state, Suspense, errors, profiler, hydration, renders, owners, context |
Server Control (6)
| Tool | Description |
|---|---|
browse_status | Server health report |
browse_stop | Shutdown server |
browse_restart | Restart server |
browse_inspect | DevTools debugging URLs |
browse_doctor | System check |
browse_upgrade | Self-update |
Advanced (4)
| Tool | Description |
|---|---|
browse_chain | Execute command sequence (JSON array) |
browse_profile | Persistent browser profiles |
browse_provider | Cloud browser providers |
browse_viewport | Set viewport size |
Performance Audit via MCP
The browse_perf_audit tool is the most powerful MCP tool — it runs a complete performance analysis in one call:
{
"tool": "browse_perf_audit",
"arguments": {
"url": "https://example.com",
"json": true
}
}Returns structured JSON with:
- Core Web Vitals (LCP, CLS, TBT, FCP, TTFB, INP)
- LCP critical path reconstruction
- Layout shift attribution
- Long task script attribution
- Resource breakdown by type
- Image audit (format, dimensions, lazy-load, fetchpriority, srcset)
- Font audit (font-display, preload, FOIT/FOUT risk)
- DOM complexity (node count, depth, largest subtree)
- Stack detection (108 frameworks, 55 SaaS platforms)
- Third-party impact (88 classified domains)
- JS/CSS coverage (per-file unused bytes)
- Prioritized recommendations
Use no_coverage: true for faster audits, no_detect: true to skip stack detection.
Stack Detection via MCP
The browse_detect tool gives a quick technology fingerprint:
{
"tool": "browse_detect",
"arguments": {}
}Returns: frameworks (with version, build mode, config), SaaS platforms (with app enumeration), infrastructure (CDN, protocol, compression, caching), DOM complexity, and third-party inventory.
MCP vs CLI
| MCP Mode | CLI Mode | |
|---|---|---|
| Setup | JSON config in editor | npm install -g |
| Integration | Native editor tool | Bash commands |
| Speed | Same (~100ms/cmd) | Same (~100ms/cmd) |
| Features | All 99 commands | All 99 commands |
| Best for | Cursor, Claude Desktop, Windsurf | Claude Code, Cline, scripts |
Both modes use the same persistent daemon — no performance difference. Choose MCP if your editor supports it natively, CLI if you want universal compatibility.