B

Browser Ref MCP

by zy2755 · io.github.zy2755/browser-ref-mcp

Enables AI agents to reliably control Chrome or Edge through MCP using semantic snapshots and ref-based actions. Provides self-healing browser reconnection, session recovery, and resilient interaction fallbacks.

npm Local · stdio GlamaOfficial MCP Registry High confidence

Install

Add to ~/Library/Application Support/Claude/claude_desktop_config.json

Windows / Linux path
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "io-github-zy2755-browser-ref-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "browser-ref-mcp"
      ],
      "env": {
        "BROWSER_MCP_CDP_URL": "<VALUE>",
        "BROWSER_MCP_HEADLESS": "<VALUE>",
        "BROWSER_MCP_PROFILE": "<VALUE>",
        "BROWSER_MCP_CHANNELS": "<VALUE>",
        "BROWSER_MCP_DIALOGS": "<VALUE>",
        "BROWSER_MCP_VIEWPORT": "<VALUE>",
        "BROWSER_MCP_START_URL": "<VALUE>",
        "BROWSER_MCP_EXECUTABLE": "<VALUE>"
      }
    }
  }
}

Restart Claude Desktop to activate the new server.

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)

Windows / Linux path
Windows: .cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global)
Linux: .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
  "mcpServers": {
    "io-github-zy2755-browser-ref-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "browser-ref-mcp"
      ],
      "env": {
        "BROWSER_MCP_CDP_URL": "<VALUE>",
        "BROWSER_MCP_HEADLESS": "<VALUE>",
        "BROWSER_MCP_PROFILE": "<VALUE>",
        "BROWSER_MCP_CHANNELS": "<VALUE>",
        "BROWSER_MCP_DIALOGS": "<VALUE>",
        "BROWSER_MCP_VIEWPORT": "<VALUE>",
        "BROWSER_MCP_START_URL": "<VALUE>",
        "BROWSER_MCP_EXECUTABLE": "<VALUE>"
      }
    }
  }
}

Cursor usually picks up config changes automatically; if the server does not appear, reload the window.

Add to .mcp.json (project) or ~/.claude.json (global)

Windows / Linux path
Windows: .mcp.json (project) or %USERPROFILE%\.claude.json (global)
Linux: .mcp.json (project) or ~/.claude.json (global)
{
  "mcpServers": {
    "io-github-zy2755-browser-ref-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "browser-ref-mcp"
      ],
      "env": {
        "BROWSER_MCP_CDP_URL": "<VALUE>",
        "BROWSER_MCP_HEADLESS": "<VALUE>",
        "BROWSER_MCP_PROFILE": "<VALUE>",
        "BROWSER_MCP_CHANNELS": "<VALUE>",
        "BROWSER_MCP_DIALOGS": "<VALUE>",
        "BROWSER_MCP_VIEWPORT": "<VALUE>",
        "BROWSER_MCP_START_URL": "<VALUE>",
        "BROWSER_MCP_EXECUTABLE": "<VALUE>"
      }
    }
  }
}

The server will be available in the next Claude Code session.

Add to .vscode/mcp.json

Windows / Linux path
Windows: .vscode\mcp.json
Linux: .vscode/mcp.json
{
  "servers": {
    "io-github-zy2755-browser-ref-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "browser-ref-mcp"
      ],
      "env": {
        "BROWSER_MCP_CDP_URL": "<VALUE>",
        "BROWSER_MCP_HEADLESS": "<VALUE>",
        "BROWSER_MCP_PROFILE": "<VALUE>",
        "BROWSER_MCP_CHANNELS": "<VALUE>",
        "BROWSER_MCP_DIALOGS": "<VALUE>",
        "BROWSER_MCP_VIEWPORT": "<VALUE>",
        "BROWSER_MCP_START_URL": "<VALUE>",
        "BROWSER_MCP_EXECUTABLE": "<VALUE>"
      }
    }
  }
}

Reload the VS Code window to activate.

Add to ~/.codeium/windsurf/mcp_config.json

Windows / Linux path
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Linux: ~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "io-github-zy2755-browser-ref-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "browser-ref-mcp"
      ],
      "env": {
        "BROWSER_MCP_CDP_URL": "<VALUE>",
        "BROWSER_MCP_HEADLESS": "<VALUE>",
        "BROWSER_MCP_PROFILE": "<VALUE>",
        "BROWSER_MCP_CHANNELS": "<VALUE>",
        "BROWSER_MCP_DIALOGS": "<VALUE>",
        "BROWSER_MCP_VIEWPORT": "<VALUE>",
        "BROWSER_MCP_START_URL": "<VALUE>",
        "BROWSER_MCP_EXECUTABLE": "<VALUE>"
      }
    }
  }
}

Restart Windsurf (or refresh its MCP servers panel) to activate the new server.

Windsurf Next uses ~/.codeium/windsurf-next/mcp_config.json. Devin Desktop (the Windsurf rebrand) uses ~/.config/devin/mcp_config.json and imports the Windsurf file.

Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Windows / Linux path
Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
{
  "mcpServers": {
    "io-github-zy2755-browser-ref-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "browser-ref-mcp"
      ],
      "env": {
        "BROWSER_MCP_CDP_URL": "<VALUE>",
        "BROWSER_MCP_HEADLESS": "<VALUE>",
        "BROWSER_MCP_PROFILE": "<VALUE>",
        "BROWSER_MCP_CHANNELS": "<VALUE>",
        "BROWSER_MCP_DIALOGS": "<VALUE>",
        "BROWSER_MCP_VIEWPORT": "<VALUE>",
        "BROWSER_MCP_START_URL": "<VALUE>",
        "BROWSER_MCP_EXECUTABLE": "<VALUE>"
      }
    }
  }
}

Cline reloads cline_mcp_settings.json automatically; if the server does not appear, reload the VS Code window.

Open it from Cline's MCP Servers panel → Configure. Roo Code uses a different file and format.

Configuration

Environment variables this server reads. Secrets stay on your machine.

NameRequiredDescription
BROWSER_MCP_CDP_URL No Connect to a browser already running with a debug port, e.g. http://127.0.0.1:9222. Leave unset to launch your own Chrome/Edge.
BROWSER_MCP_HEADLESS No Run the browser in headless mode. Equivalent to the --headless command line argument.
BROWSER_MCP_PROFILE No Browser profile directory. Equivalent to --profile <dir>.
BROWSER_MCP_CHANNELS No Browser channels to use, e.g. chrome,msedge. Equivalent to --channels chrome,msedge.
BROWSER_MCP_DIALOGS No Dialog auto-handling policy: accept or dismiss (default accept). Equivalent to --dialogs accept|dismiss.
BROWSER_MCP_VIEWPORT No Viewport size, e.g. 1440x900. Equivalent to --viewport 1440x900.
BROWSER_MCP_START_URL No Initial URL to open. Equivalent to --start-url <url>.
BROWSER_MCP_EXECUTABLE No Path to the browser executable. Equivalent to --executable <path>.

Similar servers