BrowserGateway: An Open Router for Cloud Browser Sessions
BrowserGateway routes Puppeteer, Playwright, Stagehand and MCP clients across multiple cloud browser providers through one WebSocket endpoint, adding failover, saved logins, session replay and a dashboard. This guide explains the routing strategies, profile handling, agent setup, free tier and paid credits, the project's own 'when not to use it' guidance, and the technical limits of a CDP gateway.
View 3 referencesAllow the functional cookie to save your likes. Privacy details
Cloud browser providers fail in ordinary ways: they go down, fill up and drop connections. BrowserGateway is built on the premise that an agent should not have to notice. It sits between your automation code and whichever browser backends you already pay for, and keeps the session alive when one of them misbehaves.
What is BrowserGateway?
BrowserGateway is an open-source router for cloud browsers. You point Puppeteer, Playwright, Stagehand or an MCP client at one WebSocket endpoint, and it distributes sessions across providers such as Browserless, Steel, Browserbase, Lightpanda and Cloudflare Browser Rendering, adding failover, saved logins and replay.
The project documentation describes it as "the open router for cloud browsers": you bring the backends, and the gateway handles routing, state and the dashboard. It works with more than 250 agent tools over MCP or the Chrome DevTools Protocol and is released under MIT, with both a hosted service at browsergateway.com and a self-hosted option.
Why route browser sessions through a gateway?
Because providers go down, fill up or drop connections. BrowserGateway watches provider health and skips a bad one before your code notices, keeps the browser alive after a dropped connection so you can reconnect to the same page, and loads saved cookies into whichever provider takes the session.
The homepage illustrates a session that starts on your own Chrome, moves to a paid provider on failure, holds through a timeout, reroutes and then replays the whole run. The value is not raw speed; it is continuity. An agent working through a multi-step login flow does not have to start over because one vendor had a bad minute.
Which routing strategies does BrowserGateway support?
It supports priority chains, weighted round-robin, latency-aware routing and least-connections, with failover and cooldowns per provider. A common setup sends sessions to your own server first as priority 1 and falls back to paid providers only when that capacity is unavailable or too slow.
Configuration lives in a gateway.yml file. The router can be tuned by cost, latency or load, and each provider gets its own health checks and concurrency cap. When a provider is busy, a FIFO queue holds requests rather than failing them, which matters for scrape jobs with bursts of traffic.
How do saved logins and session replay work?
Profiles capture cookies and localStorage when a session ends and inject them on the next connection, on any provider. IndexedDB and service workers also round-trip on the self-hosted runtime. Profiles are encrypted at rest with a key you control, and selected sessions can be recorded and exported as MP4.
This provider-portability is the most distinctive feature. A saved login is not tied to Browserless or Steel; it travels to whichever backend serves the next session. On the hosted service, replay is recorded from CDP screencast frames and read back through the REST API, with a live view available in the dashboard for debugging a run in progress.
How do you connect an AI agent to BrowserGateway?
Point an MCP client at the hosted server at cdp.browsergateway.io/mcp with a bearer token, or connect a Playwright script through chromium.connectOverCDP using the gateway WebSocket URL. Each agent session gets its own browser, and tools such as navigate, screenshot and interact are available without changing client code.
import { chromium } from "playwright-core";
const browser = await chromium.connectOverCDP(
"wss://cdp.browsergateway.io/v1/connect?token=bg_YOUR_KEY"
);
const page = await browser.newPage();
await page.goto("https://example.com/dashboard");
console.log(await page.title());
await browser.close();
The MCP configuration is similarly short: add a server entry with the URL and an Authorization header. The gateway also supports Claude and Gemini computer-use tools on any provider, so agent frameworks that expect a browser can reuse it.
What does BrowserGateway cost?
Routing on your own provider keys is free up to 10,000 sessions per month. Paid usage draws from a prepaid wallet for recording, tracing and managed browsers, with no subscription; DevHunt listed paid credits starting at $5. Self-hosting is free under the MIT licence.
The pricing model is deliberately asymmetric: if you already pay Browserless or Steel, routing is free at the stated volume, and you only pay for features the gateway itself provides. Managed browsers are the option for teams that have no provider account and still want a browser to connect to.
When should you not use BrowserGateway?
The project's own docs say to use Playwright, Puppeteer or Stagehand directly if you need a full browser automation API, and to use managed browsers if you have no provider account. It is also not an anti-detect or stealth product. A router adds a hop, so single-provider setups gain little.
That guidance is unusually candid and worth heeding. If your work is a straightforward Playwright suite against one browser service, the gateway adds configuration without benefit. It earns its place when you operate several providers, need logged-in state to survive across days, or want to review what an agent saw when a task broke.
What are the technical limits?
It is a Chrome DevTools Protocol gateway, not a browser itself. The hosted MCP server exposes browser tools, while the REST API covers stateless screenshots and content extraction. Public metadata for some MCP tools has no parameter schema yet, and the project was still at version 0.4.x in late 2026.
The router is also a single point of failure for setups that depend on it: self-hosting removes that dependency but adds operational work. Encryption of profile data depends on a key you control, so losing that key means losing saved logins. For regulated workloads, check where the hosted service stores replay video and profile data before enabling recording.
Frequently asked questions about BrowserGateway
BrowserGateway raises a handful of practical questions before adoption: whether it replaces an automation library, whether it can be self-hosted, what happens when a provider fails mid-session and what the free tier actually includes. The answers below are drawn from the project's own documentation and homepage.
Does BrowserGateway replace Playwright?
No. It routes connections for Playwright and other clients; you still write the automation. The docs explicitly recommend using the automation libraries directly if a router is not needed.
Can it run on my own infrastructure?
Yes. It is MIT-licensed and available as an npm package and Docker image for self-hosting. That also gives you IndexedDB and service-worker round-tripping, which the hosted runtime does not offer.
How does it handle a provider failure mid-session?
It holds the browser when a connection breaks and lets you reconnect to the same page with a single replay of the run. Provider health checks and cooldowns stop the next session from landing on the same bad backend.
Is free routing really free?
Up to 10,000 sessions per month on your own provider keys, according to the site. You still pay the underlying provider, and recording, tracing and managed browsers draw from a paid wallet.
BrowserGateway solves an infrastructure problem that appears only at scale: keeping browser sessions reliable across several vendors. For a single-provider script it is unnecessary; for a fleet of agents that must stay logged in and be debuggable after a failure, the routing layer is a sensible addition. Verify current limits and pricing on the official site before committing, since the project is young and its tier details may change.