@ulpi/browse

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 --mcp

Use --json alongside --mcp for structured responses:

browse --mcp --json

Note: Requires npm install @modelcontextprotocol/sdk alongside 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-auditbrowse_perf_audit).

ToolDescription
browse_gotoNavigate to URL
browse_backGo back in history
browse_forwardGo forward in history
browse_reloadReload current page
browse_urlGet current page URL

Content Extraction (14)

ToolDescription
browse_textClean page text (no scripts/styles)
browse_htmlFull HTML or element innerHTML
browse_linksAll links as text → href
browse_formsForm structure as JSON
browse_accessibilityARIA accessibility tree
browse_jsEvaluate JavaScript expression
browse_evalEvaluate JavaScript file
browse_cssGet computed CSS property
browse_attrsGet element attributes
browse_element_stateElement state (visible, enabled, checked)
browse_valueGet input/select value
browse_dialogLast dialog info
browse_clipboardRead/write system clipboard
browse_errorsPage errors (filtered from console)

Interaction (26)

ToolDescription
browse_clickClick element
browse_rightclickRight-click element
browse_dblclickDouble-click element
browse_fillClear and fill input
browse_selectSelect dropdown option
browse_hoverHover over element
browse_focusFocus element
browse_tapTap (touch context)
browse_checkCheck checkbox
browse_uncheckUncheck checkbox
browse_typeType via keyboard
browse_pressPress key (Enter, Tab, etc.)
browse_keydownHold key down
browse_keyupRelease key
browse_scrollScroll element/viewport
browse_scrollintoScroll element into view
browse_scrollintoviewAlias for scrollinto
browse_dragDrag and drop
browse_highlightVisual overlay on element
browse_downloadDownload file via click
browse_uploadUpload files to input
browse_waitWait for element/URL/network/timeout
browse_swipeSwipe (touch events)
browse_mouseLow-level mouse control
browse_keyboardInsert text without key events
browse_dialog_acceptAuto-accept dialogs
browse_dialog_dismissAuto-dismiss dialogs

Snapshot & Find (4)

ToolDescription
browse_snapshotAccessibility tree with @refs
browse_snapshot_diffDiff current vs previous snapshot
browse_findFind elements by role, text, label, testid
browse_countCount matching elements

Visual & Compare (6)

ToolDescription
browse_screenshotViewport/full-page/element screenshot
browse_pdfSave page as PDF
browse_responsiveMobile/tablet/desktop screenshots
browse_diffText diff between two pages
browse_screenshot_diffPixel-level visual diff
browse_boxGet element bounding box

Performance Audit (4)

ToolDescription
browse_perf_auditFull 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_detectTech stack fingerprint — frameworks, SaaS platforms, CDN, protocol, compression, caching, DOM complexity, third-party inventory
browse_coverageJS/CSS code coverage — per-file used/unused bytes
browse_initscriptInject JS before every page load

Tabs & Frames (6)

ToolDescription
browse_tabsList all tabs
browse_tabSwitch to tab
browse_newtabOpen new tab
browse_closetabClose tab
browse_frameTarget iframe
browse_session_closeClose a session

Recording & Network (17)

ToolDescription
browse_consoleView/clear console messages
browse_networkView/clear network requests
browse_cookiesDump cookies as JSON
browse_storageView/set localStorage
browse_perfNavigation timing metrics
browse_devicesList device names
browse_cookieSet/clear/export/import cookies
browse_headerSet request header
browse_useragentSet user agent
browse_routeMock/block network requests
browse_offlineToggle offline mode
browse_setSet geo/media preferences
browse_harHAR recording (start/stop)
browse_videoVideo recording (start/stop)
browse_recordCommand recording and export
browse_cookie_importImport cookies from real browsers
browse_emulateEmulate device

Auth & State (5)

ToolDescription
browse_stateSave/restore browser state
browse_authCredential vault (save/login/list/delete)
browse_handoffSwap to visible browser for CAPTCHA/MFA
browse_resumeReturn to headless after handoff
browse_sessionsList active sessions

React DevTools (1)

ToolDescription
browse_react_devtoolsComponent tree, props, state, Suspense, errors, profiler, hydration, renders, owners, context

Server Control (6)

ToolDescription
browse_statusServer health report
browse_stopShutdown server
browse_restartRestart server
browse_inspectDevTools debugging URLs
browse_doctorSystem check
browse_upgradeSelf-update

Advanced (4)

ToolDescription
browse_chainExecute command sequence (JSON array)
browse_profilePersistent browser profiles
browse_providerCloud browser providers
browse_viewportSet 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 ModeCLI Mode
SetupJSON config in editornpm install -g
IntegrationNative editor toolBash commands
SpeedSame (~100ms/cmd)Same (~100ms/cmd)
FeaturesAll 99 commandsAll 99 commands
Best forCursor, Claude Desktop, WindsurfClaude 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.

On this page