Skip to main content
Glama

About

Browser MCP is an MCP server + browser extension that allows you to automate your browser using AI applications like VS Code, Claude, Cursor, and Windsurf. Supports both Chrome and Firefox.

This is a fork of the original Browser MCP with the following changes:

  • Standalone build: All monorepo dependencies (@repo/*, @r2r/messaging) replaced with local implementations

  • Extended toolset: 39 tools (up from 12 core tools) including tab management, JavaScript execution, cookie/storage access, CSS injection, network monitoring, and more

  • Cross-browser extension: Full-featured extension with all 36 command handlers, compatible with both Chrome (MV3) and Firefox (MV3)

  • WSL support: Auto-detects WSL IP and writes a config file for the extension to discover the correct WebSocket address

  • Connection resilience: Speed guidance in tool descriptions, connection error detection with retry hints

Related MCP server: agent-browser-mcp-server

Features

  • ⚡ Fast: Automation happens locally on your machine, resulting in better performance without network latency.

  • 🔒 Private: Since automation happens locally, your browser activity stays on your device and isn't sent to remote servers.

  • 👤 Logged In: Uses your existing browser profile, keeping you logged into all your services.

  • 🥷🏼 Stealth: Avoids basic bot detection and CAPTCHAs by using your real browser fingerprint.

Installation

Prerequisites

  • Node.js >= 18

  • Google Chrome, Chromium, or Firefox 113+

  • The Browser MCP extension (included in extension/)

From source

git clone https://github.com/IlGabbia998/browsermcp-mcp.git
cd browsermcp-mcp
npm install
npm run build

Load the extension

Chrome

  1. Open Chrome and navigate to chrome://extensions

  2. Enable Developer mode

  3. Click Load unpacked and select the extension/ folder from this project

  4. The extension will show in your toolbar — click it and hit Reconnect when the MCP server is running

Firefox

Firefox MV3 requires a different background entry than Chrome. You must switch the manifest before loading the extension.

Using the helper script (recommended):

npm run use:firefox

Or manually:

  1. Copy extension/manifest.firefox.json to extension/manifest.json (replacing the Chrome one)

Then load it:

  1. Open Firefox and navigate to about:debugging#/runtime/this-firefox

  2. Click Load Temporary Add-on...

  3. Select extension/manifest.json from this project

  4. The extension will show in your toolbar — click it and hit Connect when the MCP server is running

Note: Chrome and Firefox use different manifest formats for MV3. Use manifest.json for Chrome (default) and run npm run use:firefox (or copy manifest.firefox.json) for Firefox. Firefox temporary add-ons are removed when Firefox is restarted. To restore the Chrome manifest, run npm run use:chrome.

Using in your MCP client

Add the server to your MCP client config. The built entry point is dist/index.js.

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "browser": {
      "command": "node",
      "args": ["/absolute/path/to/browsermcp-mcp/dist/index.js"]
    }
  }
}

opencode

Add to your opencode.json:

{
  "mcp": {
    "browser": {
      "type": "local",
      "command": ["node", "/absolute/path/to/browsermcp-mcp/dist/index.js"],
      "enabled": true
    }
  }
}

Cursor / Windsurf

Add to your MCP settings (.cursor/mcp.json or equivalent):

{
  "mcpServers": {
    "browser": {
      "command": "node",
      "args": ["/absolute/path/to/browsermcp-mcp/dist/index.js"]
    }
  }
}

Connect the browser

  1. Start the MCP server (via your MCP client or node dist/index.js)

  2. Open Chrome/Firefox and click the Browser MCP extension icon in the toolbar

  3. Click Reconnect — the extension auto-discovers the server address

  4. The MCP server will detect the connection automatically

Available Tools (39)

Core

Tool

Description

browser_navigate

Navigate to a URL

browser_go_back

Navigate back

browser_go_forward

Navigate forward

browser_snapshot

Capture an accessibility snapshot of the page

browser_click

Click an element (by ref or description)

browser_hover

Hover over an element

browser_type

Type text into an input field

browser_select_option

Select an option in a dropdown

browser_drag

Drag from one element to another

browser_press_key

Press a keyboard key

browser_wait

Wait for N seconds

browser_screenshot

Take a screenshot

browser_get_console_logs

Get browser console logs

Navigation & Tabs

Tool

Description

browser_scroll

Scroll the page (up/down/left/right)

browser_new_tab

Open a new tab

browser_reload

Reload the current page

browser_list_tabs

List all open tabs

browser_close_tab

Close a tab by ID

browser_switch_tab

Switch to a tab by ID

Page Interaction

Tool

Description

browser_find_text

Find text content on the page

browser_execute_js

Execute arbitrary JavaScript

browser_get_links

Extract all links from the page

browser_get_elements

Query elements by CSS selector

browser_extract_table

Extract table data as structured JSON

browser_extract_meta

Extract page metadata and OpenGraph tags

browser_extract_images

Extract all images from the page

browser_right_click

Right-click an element

browser_double_click

Double-click an element

browser_highlight

Highlight elements matching a selector

browser_readability

Extract main article content

browser_wait_for

Wait for an element to appear

browser_get_computed_style

Get computed CSS styles for an element

browser_inject_css

Inject custom CSS into the page

Storage & Cookies

Tool

Description

browser_get_cookies

Get cookies for the current page

browser_set_cookies

Set a cookie

browser_get_storage

Read from localStorage or sessionStorage

browser_set_storage

Write to localStorage or sessionStorage

Monitoring

Tool

Description

browser_network_log

Start/stop/query network request logging

browser_console_log

Start/stop/query console log interception

Usage examples

Ask your AI assistant to do things like:

  • "Go to github.com and take a screenshot"

  • "Click the login button and fill in my email"

  • "Scroll down and click the next page link"

  • "Extract all links from this page"

  • "Show me the cookies for this site"

  • "Run JavaScript to get the page title"

  • "Monitor network requests while I navigate"

  • "Inject a custom CSS theme on this page"

The AI uses accessibility snapshots to understand the page structure and interact with elements reliably.

Contributing

This is a standalone build of the Browser MCP server, extracted from the original monorepo. All monorepo dependencies have been replaced with local implementations.

Project structure

src/
  index.ts              # Entry point, tool registration
  server.ts             # MCP server with connection error handling
  context.ts            # WebSocket context management
  ws.ts                 # WebSocket server creation
  lib/
    config/             # App and MCP configuration
    messaging/          # WebSocket message sender
    types/              # Zod schemas for all tools
  tools/
    snapshot.ts         # Core interaction tools (click, type, hover, etc.)
    common.ts           # Navigation tools (navigate, goBack, etc.)
    custom.ts           # Screenshot, console logs
    extended.ts         # All extended tools (26 new tools)
    tool.ts             # Tool type definitions
  utils/
    port.ts             # Port utilities
    aria-snapshot.ts    # Accessibility snapshot capture
extension/
  background.js         # Cross-browser service worker (36 command handlers)
  manifest.json         # Extension manifest (MV3, Chrome + Firefox compatible)
  popup.html            # Extension popup UI
  popup.js              # Popup JavaScript
  icons/                # Extension icons

Credits

Browser MCP was adapted from the Playwright MCP server in order to automate the user's browser rather than creating new browser instances. This allows using the user's existing browser profile to use logged-in sessions and avoid bot detection mechanisms that commonly block automated browser use.

Available Tools

39 tools
browser_clickC

Click an element. Use the exact ref from the latest snapshot.

Inputs: ref (required), element (required).

browser_close_tabB

Close a tab by ID

Inputs: tabId (required).

browser_console_logC

Monitor console.log/warn/error

Inputs: action (required).

browser_double_clickB

Double-click an element

Inputs: ref (required), element (required).

browser_dragB

Drag from one element to another

Inputs: endRef (required), startRef (required), endElement (required), startElement (required).

browser_execute_jsB

Execute JavaScript on the page

Inputs: script (required).

browser_extract_imagesB

Get all images with src, alt, dimensions

Inputs: no named parameters.

browser_extract_metaB

Extract meta tags, OpenGraph, Twitter Cards

Inputs: no named parameters.

browser_extract_tableB

Extract a table as structured JSON

Inputs: selector.

browser_find_textC

Search for text on the page

Inputs: text (required).

browser_get_computed_styleA

Read computed CSS properties of an element

Inputs: selector (required), properties.

browser_get_console_logsB

Get browser console logs

Inputs: no named parameters.

browser_get_cookiesA

Read cookies for a URL

Inputs: url.

browser_get_elementsB

Query elements by CSS selector

Inputs: selector (required), limit.

browser_get_storageB

Read localStorage or sessionStorage

Inputs: type (required), key.

browser_go_backA

Go back to the previous page

Inputs: no named parameters.

browser_go_forwardA

Go forward to the next page

Inputs: no named parameters.

browser_highlightB

Highlight elements with colored outline

Inputs: selector (required), color.

browser_hoverC

Hover over an element

Inputs: ref (required), element (required).

browser_inject_cssB

Inject custom CSS into the page

Inputs: css (required).

browser_list_tabsA

List all open tabs

Inputs: no named parameters.

browser_navigateB

Navigate to a URL

Inputs: url (required).

browser_network_logC

Monitor fetch/XHR network requests

Inputs: action (required), filter.

browser_new_tabC

Open a new tab

Inputs: url.

browser_press_keyC

Press a key on the keyboard

Inputs: key (required).

browser_readabilityA

Extract main article content (Reader Mode)

Inputs: no named parameters.

browser_reloadA

Reload the current page

Inputs: hard.

browser_right_clickC

Right-click an element

Inputs: ref (required), element (required).

browser_screenshotC

Take a screenshot of the current page

Inputs: no named parameters.

browser_scrollC

Scroll the page

Inputs: direction (required), amount.

browser_select_optionB

Select an option in a dropdown

Inputs: ref (required), values (required), element (required).

browser_set_cookiesC

Set a cookie

Inputs: url (required), name (required), value (required), path, +3 more.

browser_set_storageB

Write to localStorage or sessionStorage

Inputs: key (required), type (required), value (required).

browser_snapshotA

Capture accessibility snapshot. Returns refs like 'e42' — use these in click/type/hover calls.

Inputs: no named parameters.

browser_switch_tabA

Switch to a tab by ID

Inputs: tabId (required).

browser_typeA

Type text into an element. Use Control+a to select all first if replacing text.

Inputs: ref (required), text (required), submit (required), element (required).

browser_waitB

Wait for a specified time in seconds

Inputs: time (required).

browser_wait_forC

Wait for a CSS selector to appear on page

Inputs: selector (required), timeout.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 39 tools

    Disambiguation4/5

    Most tools are clearly distinct, but browser_console_log and browser_get_console_logs are easily confused, and browser_wait/browser_wait_for could be ambiguous without reading descriptions. Overall, the purposes are well differentiated.

    Naming Consistency4/5

    All tools use a consistent browser_ prefix and snake_case naming. However, there is a mix of verb-first (navigate, click) and noun-like (console_log, network_log) patterns, and some tools use 'get_' while others don't, creating minor inconsistency.

    Tool Count2/5

    With 39 tools, the server exceeds the 25+ threshold for 'too many'. While the breadth reflects a comprehensive browser automation scope, the sheer number makes tool selection heavier and suggests possible consolidation.

    Completeness4/5

    The tool set covers navigation, interaction, waiting, extraction, cookies/storage, console/network monitoring, and tab management—nearly all core browser automation needs. Minor gaps exist (e.g., no explicit alert/dialog handling or dedicated URL/page title getter), but most can be worked around via execute_js or snapshot.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables AI agents to directly control your real Chrome browser with full context including login sessions, cookies, and open tabs. It provides tools for page scanning, JavaScript execution, CDP control, screenshots, and physical mouse/keyboard input for authentic browser automation.
      20
      244
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides complete browser automation capabilities for AI agents via 44 tools, including navigation, element interaction, state management, and session recording.
      84 npm
      1
      Apache 2.0
    • A
      license
      B
      quality
      C
      maintenance
      Enables AI-powered Chrome automation through natural language, providing 56+ specialized tools for browser interaction, page analysis, scenario recording, and visual testing.
      59
      25 npm
      9
      ISC