# browser-gateway

Routes browser connections among providers so an agent can open pages, capture screenshots, and interact with a browser through MCP.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 18
- Author: browser-gateway
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/browser-gateway/browser-gateway
- Updated: 2026-10-22
- HTML: https://affpapa.org/en/nevibecode/mcp/browser-gateway

## What it does

browser-gateway selects a browser provider according to its health, capacity, and routing strategy. If a provider fails, another can take over; the gateway also offers load balancing and queues connections while providers are busy. This is useful when an agent needs browser access through MCP.

A REST API handles screenshots, page content extraction, and structured scraping. The included dashboard displays provider and session status and lets you control a remote browser. Claude Code setup passes a `BG_TOKEN` value to the server, so have that token ready before running the command.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `BG_TOKEN` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add browser-gateway -e BG_TOKEN=<BG_TOKEN> -- npx -y browser-gateway
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add browser-gateway --env BG_TOKEN=<BG_TOKEN> -- npx -y browser-gateway
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "browser-gateway": {
            "command": "npx",
            "args": [
                "-y",
                "browser-gateway"
            ],
            "env": {
                "BG_TOKEN": "<BG_TOKEN>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "browser-gateway": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "browser-gateway"
            ],
            "env": {
                "BG_TOKEN": "<BG_TOKEN>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e BG_TOKEN=<BG_TOKEN> browser-gateway npx -y browser-gateway
```
Replace <…> with your own values

## When to use it
- open a web page through a browser provider
- capture a page screenshot
- extract page text or HTML
- collect structured data with CSS selectors
- route a connection to another provider after a failure

## Example prompts
- Open the page and describe what it contains.
- Capture a screenshot of this page.
- Extract data from the page using these CSS selectors.

## Similar
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [AIHawk](https://affpapa.org/en/nevibecode/mcp/aihawk.md) — MCP server · ★ 32221
- [Skyvern](https://affpapa.org/en/nevibecode/mcp/skyvern.md) — MCP server · ★ 23263
- [SeleniumBase MCP](https://affpapa.org/en/nevibecode/mcp/seleniumbase-mcp.md) — MCP server · ★ 13169
- [apify-mcp-server](https://affpapa.org/en/nevibecode/mcp/apify-mcp-server.md) — MCP server · ★ 12927

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
