browser-gateway — Claude Code MCP server: browser access and setup
Routes browser connections among providers so an agent can open pages, capture screenshots, and interact with a browser through MCP.
claude mcp add browser-gateway -e BG_TOKEN=<BG_TOKEN> -- npx -y browser-gatewayWhat browser-gateway 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.
What it helps with
- 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 for the agent
- Open the page and describe what it contains.
- Capture a screenshot of this page.
- Extract data from the page using these CSS selectors.
How to install browser-gateway
Platform CLI
claude mcp add browser-gateway -e BG_TOKEN=<BG_TOKEN> -- npx -y browser-gatewayReplace <…> with your own values
Platform CLI
codex mcp add browser-gateway --env BG_TOKEN=<BG_TOKEN> -- npx -y browser-gatewayReplace <…> with your own values
Config file
{
"mcpServers": {
"browser-gateway": {
"command": "npx",
"args": [
"-y",
"browser-gateway"
],
"env": {
"BG_TOKEN": "<BG_TOKEN>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"browser-gateway": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"browser-gateway"
],
"env": {
"BG_TOKEN": "<BG_TOKEN>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e BG_TOKEN=<BG_TOKEN> browser-gateway npx -y browser-gatewayReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about browser-gateway
How do I install browser-gateway in Claude Code?
Set a value for BG_TOKEN, then run claude mcp add browser-gateway -e BG_TOKEN=<BG_TOKEN> -- npx -y browser-gateway.
What does browser-gateway do?
It routes browser connections between providers for MCP clients. Its REST API can also capture screenshots, extract page content, and scrape structured data.
What does browser-gateway need for Claude Code setup?
The install command passes a BG_TOKEN environment variable to the server.