Browserbase MCP Server
Cloud browser automation MCP server powered by Stagehand. Lets agents navigate pages, perform actions, observe elements, and extract data in managed headless browsers.
The Browserbase MCP server gives AI agents access to managed, cloud-hosted headless browsers via the Stagehand framework. Instead of issuing raw Playwright/CDP commands, the agent uses high-level primitives like act, observe, and extract that take natural-language instructions and resolve them against the live DOM. Sessions run on Browserbase infrastructure, which provides residential proxies, stealth/anti-bot evasion via Verified Identity, persistent contexts, and keep-alive sessions.
The server ships in two forms: a hosted remote endpoint at https://mcp.browserbase.com/mcp (Streamable HTTP) that you can drop into any MCP client with just an API key, and a self-hosted variant published as @browserbasehq/mcp on npm with a Docker option. It is maintained by Browserbase, the same team that builds Stagehand, so the integration tracks current Stagehand semantics directly.
Notable capabilities include configurable viewport, custom LLM selection for Stagehand's reasoning step (defaults to google/gemini-2.5-flash-lite), Browserbase Contexts for persisting cookies and storage between runs, and proxy support. The tool surface is intentionally small (6 tools) because Stagehand's act/observe/extract are designed to subsume most low-level browser primitives.
Tools
| Tool | Description |
|---|---|
start |
Create or reuse a Browserbase session. |
end |
Close the current Browserbase session. |
navigate |
Navigate the active page to a URL. |
act |
Perform a natural-language action on the page via Stagehand (click, type, select, etc.). |
observe |
Identify actionable elements on the page that match an instruction. |
extract |
Extract structured data from the current page, optionally guided by an instruction. |
Prerequisites
- A Browserbase account with an API key and project ID (from the Browserbase dashboard)
- A model API key for Stagehand's reasoning step. Defaults to Gemini (
GEMINI_API_KEY); other providers can be configured with--modelNameand--modelApiKey
Option 1: Hosted remote server (recommended)
Point any MCP client at the hosted Streamable HTTP endpoint, passing the API key as a query string parameter:
{
"mcpServers": {
"browserbase": {
"url": "https://mcp.browserbase.com/mcp?browserbaseApiKey=YOUR_BROWSERBASE_API_KEY"
}
}
}
Option 2: Self-hosted via npx
{
"mcpServers": {
"browserbase": {
"command": "npx",
"args": ["@browserbasehq/mcp"],
"env": {
"BROWSERBASE_API_KEY": "",
"BROWSERBASE_PROJECT_ID": "",
"GEMINI_API_KEY": ""
}
}
}
}
Option 3: Docker
{
"mcpServers": {
"browserbase": {
"command": "docker",
"args": ["run", "--rm", "-i", "-e", "BROWSERBASE_API_KEY", "-e", "BROWSERBASE_PROJECT_ID", "-e", "GEMINI_API_KEY", "mcp-browserbase"],
"env": {
"BROWSERBASE_API_KEY": "",
"BROWSERBASE_PROJECT_ID": "",
"GEMINI_API_KEY": ""
}
}
}
}
Useful flags
Pass these in the args array for the self-hosted variants:
--proxies: route traffic through Browserbase proxies--verified: enable Verified Identity stealth (Scale Plan only)--keepAlive: keep sessions alive between tool calls--contextId <id>and--persist: reuse a persistent Browserbase Context--browserWidth/--browserHeight: viewport size--modelName/--modelApiKey: use a non-Gemini model for Stagehand
- Build AI web agents that complete multi-step tasks on real sites (logging in, filling forms, submitting orders) using natural-language
actcalls - Scrape structured data from JavaScript-heavy pages with
extract, without writing selectors - Run automated QA flows on staging sites and have the agent describe what it sees via
observe - Maintain authenticated sessions across runs using Browserbase Contexts plus
--contextId --persist - Operate against bot-protected sites using
--proxiesand--verifiedfor stealth and residential IPs
- "Open example.com, search for 'wireless headphones', and extract the top 5 product names with prices."
- "Navigate to my dashboard, observe the available export buttons, and click the one for CSV."
- "Log in to the staging site with the test account and confirm the checkout flow completes."
- "Extract all job listings from this careers page as a JSON array with title, location, and apply URL."
- "Go to this LinkedIn profile and tell me the person's current role and company."
- Official server maintained by the Browserbase team, with a hosted remote URL so no install is required
- Stagehand's
act/observe/extractprimitives accept natural language, which suits LLM agents better than raw Playwright - First-class support for stealth, proxies, persistent contexts, and keep-alive sessions
- Multiple deployment options: hosted SHTTP, npx, Docker
- Requires a paid Browserbase plan beyond free-tier usage, plus a model API key for Stagehand
- Small tool surface (6 tools): no built-in screenshot, cookie, or multi-tab tools exposed via MCP
- Verified Identity stealth mode is gated to the Scale Plan
- Playwright MCP by Microsoft for direct, local Playwright control
- Puppeteer MCP reference server for headless Chrome scripting
- Hyperbrowser MCP for an alternative managed cloud-browser provider