# Browser Gateway

> Browser Gateway is an MCP server for browser automation. Chrome browser tools for agents, with failover across cloud browser providers. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Platforms:** CLI, self-hosted, Web
- **Repository:** https://github.com/browser-gateway/browser-gateway
- **MCP Registry name:** io.github.browser-gateway/browser-gateway
- **Categories:** [browser automation](https://ai-powered.com/categories/browser-automation), [web search and scraping](https://ai-powered.com/categories/web-search-and-scraping)
- **Listing updated:** 2026-11-18

## About

The npm package works two ways. As a gateway it gives your app one WebSocket endpoint that routes to cloud CDP services, Docker containers or local Chrome, using priority, round-robin, least-connections, latency or weighted strategies, with queueing, cooldowns, health checks and automatic failover. As an MCP server it gives agents browser tools that need no Playwright or Puppeteer dependency and auto-launch Chrome on first use.

The MCP side has two one-call tools, fetch_page (a URL as markdown) and screenshot_page, plus session tools for navigating, snapshotting, acting, extracting, waiting, tabs, evaluating and observing. A Claude Code plugin sends Claude to fetch_page when built-in web fetch is blocked, empty or needs JavaScript.

Other parts include encrypted persistent profiles that restore cookies and localStorage, frame-accurate session replays, a REST API for screenshots, content and scraping, and a dashboard at localhost:9500/web. BG_TOKEN is only needed with remote providers.

## Features

- **Provider failover:** Routes across browser providers and switches when one fails.
- **Agent browser tools:** MCP tools for fetching, screenshots, navigation, actions and extraction.
- **Persistent profiles:** Encrypted cookies and localStorage replay across sessions.
- **Session replay:** Frame-accurate recordings of routed sessions.
- **REST API:** Screenshot, content and scrape endpoints.
- **Computer-use loops:** Helpers for Claude and Gemini computer use on any provider.

## Good for

- Give a coding agent a fallback for blocked web fetches
- Spread browser sessions across several cloud providers
- Keep a logged-in profile between agent runs
- Replay what an agent saw during a session

## Install

### Claude Code (Terminal)

```sh
claude mcp add browser-gateway --env BG_TOKEN='<BG_TOKEN>' -- npx -y browser-gateway
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "browser-gateway": {
      "command": "npx",
      "args": [
        "-y",
        "browser-gateway"
      ],
      "env": {
        "BG_TOKEN": "<BG_TOKEN>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "browser-gateway": {
      "command": "npx",
      "args": [
        "-y",
        "browser-gateway"
      ],
      "env": {
        "BG_TOKEN": "<BG_TOKEN>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "browser-gateway": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "browser-gateway"
      ],
      "env": {
        "BG_TOKEN": "<BG_TOKEN>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "browser-gateway": {
      "command": "npx",
      "args": [
        "-y",
        "browser-gateway"
      ],
      "env": {
        "BG_TOKEN": "<BG_TOKEN>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "browser-gateway": {
      "command": "npx",
      "args": [
        "-y",
        "browser-gateway"
      ],
      "env": {
        "BG_TOKEN": "<BG_TOKEN>"
      }
    }
  }
}
```

## Tools

- `fetch_page`: Read a URL as markdown in a single call
- `screenshot_page`: Capture a URL in a single call
- `browser_session`: Start a browser session
- `browser_navigate`: Navigate the browser
- `browser_snapshot`: Take a page snapshot
- `browser_act`: Perform an action on the page
- `browser_extract`: Extract data from the page
- `browser_screenshot`: Take a screenshot in a session
- `browser_wait`: Wait for a condition
- `browser_tabs`: Manage tabs
- `browser_evaluate`: Evaluate script in the page
- `browser_observe`: Observe the page

## FAQ

### Does it need Playwright?

The MCP tools use raw CDP with no Playwright or Puppeteer dependency.

### Is a token required?

BG_TOKEN is optional and only needed with remote providers.

### What clients work?

Claude Code, Cursor and any MCP-compatible client.

### How are profiles protected?

They are encrypted at rest with AES-256-GCM.

### How do I add Browser Gateway to Claude Code?

Run this command in your terminal: claude mcp add browser-gateway --env BG_TOKEN='<BG_TOKEN>' -- npx -y browser-gateway

### What are the best alternatives to Browser Gateway?

The closest alternatives to Browser Gateway are Browser Use, Scrapling MCP Server, Chrome DevTools MCP, Firecrawl MCP Server and Douyin_TikTok_Download_API.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Browser Use](https://ai-powered.com/mcp/browser-use): Browser Use is a freemium MCP server for browser automation.
- [Scrapling MCP Server](https://ai-powered.com/mcp/scrapling-mcp-server): Scrapling MCP Server is an open-source MCP server for web search and scraping.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Firecrawl MCP Server](https://ai-powered.com/mcp/firecrawl-mcp-server): Firecrawl MCP Server is a freemium MCP server for web search and scraping.
- [Douyin_TikTok_Download_API](https://ai-powered.com/mcp/douyin-tiktok-download-api): Douyin_TikTok_Download_API is an open-source MCP server for web search and scraping.
- [SearXNG Search](https://ai-powered.com/mcp/searxng-search): SearXNG Search is an open-source MCP server for web search and scraping.
- [Oya Browser](https://ai-powered.com/mcp/oya-browser): Oya Browser is a freemium MCP server for browser automation.
- [playwright_mcp](https://ai-powered.com/mcp/playwright-mcp-3): playwright_mcp is an open-source MCP server for browser automation.

---
Source: https://ai-powered.com/mcp/browser-gateway
