mcp -browserbase
Allow LLMs to control a browser with Browserbase and Stagehand
claude mcp add --transport stdio browserbase-mcp-server-browserbase node /path/to/mcp-server-browserbase/cli.js \ --env GEMINI_API_KEY="" \ --env BROWSERBASE_API_KEY="" \ --env BROWSERBASE_PROJECT_ID=""
How to use
The Browserbase MCP Server exposes cloud browser automation capabilities via Stagehand and Browserbase, enabling LLMs to control web pages, perform actions, take screenshots, and extract structured data with advanced selectors. This server supports multiple transport modes (STDIO and SHTTP) so you can run locally or connect through a remote endpoint. Use the STDIO setup to run the server locally in your MCP environment, or configure SHTTP to point to a remote hosted URL for scalable usage and predictable costs. With this server you can automate tasks such as navigating pages, clicking elements, filling forms, capturing screenshots, and extracting data from complex pages including iframes and shadow DOMs. It also exposes new primitives like page, locator, frameLocator, and deepLocator for simplified automation across browsers.
To use it, add a browserbase mcpServer entry to your MCP config as shown, then reload your MCP client. You can specify the model (e.g., Gemini) and API keys, and choose between direct local execution or a remote hosted endpoint. When using STDIO locally, you’ll configure the command (node) and the path to the CLI script, plus the required environment variables for authentication and project context.
How to install
Prerequisites:
- Node.js and npm/yarn installed
- Access to the repository or npm package @browserbasehq/mcp-server-browserbase
Option A: Run directly from source (local STDIO)
- Clone the repository: git clone https://github.com/browserbase/mcp-server-browserbase.git cd mcp-server-browserbase
- Install dependencies and build (if applicable): npm install npm run build
- Run the server locally (example): node /path/to/mcp-server-browserbase/cli.js
Option B: Use npm package (STDIO via npx or as a dependency in MCP config)
- Install or reference the package in your MCP config: In your MCP config, set: { "mcpServers": { "browserbase": { "command": "npx", "args": ["@browserbasehq/mcp-server-browserbase"] } } }
- If you need environment variables, provide them in the config: { "mcpServers": { "browserbase": { "command": "npx", "args": ["@browserbasehq/mcp-server-browserbase"], "env": { "BROWSERBASE_API_KEY": "", "BROWSERBASE_PROJECT_ID": "", "GEMINI_API_KEY": "" } } } }
Option C: Docker (optional)
- Build the image (from source): docker build -t mcp-browserbase .
- Run the image locally: docker run -it --rm -e BROWSERBASE_API_KEY="" -e BROWSERBASE_PROJECT_ID="" -e GEMINI_API_KEY="" mcp-browserbase
Prerequisites recap: ensure you have Node.js installed if running locally, or use the provided npm package/Docker workflow if you prefer containerized or remote operation.
Additional notes
Environment variables:
- BROWSERBASE_API_KEY: Your Browserbase API key
- BROWSERBASE_PROJECT_ID: Your Browserbase project ID
- GEMINI_API_KEY: API key for the Gemini/OpenAI-compatible model provider (if using Gemini via Stagehand)
Important flags for the server (exposed via CLI or MCP config):
- --proxies, --advancedStealth, --keepAlive, --contextId, --persist
- --port, --host to configure network binding
- --browserWidth, --browserHeight for viewport size
- --modelName, --modelApiKey to select and authenticate the model used by Stagehand
- --experimental to enable experimental features
If you switch between transport methods, ensure your MCP client supports the chosen format (STDIO vs. SHTTP). For SHTTP, you’ll typically point to a remote Smithery URL; for STDIO, you run the CLI locally and reference the local path in your MCP config.
Related MCP Servers
chrome-devtools
Chrome DevTools for coding agents
fetcher
MCP server for fetch web page content using Playwright headless browser.
CanvasMCPClient
Canvas MCP Client is an open-source, self-hostable dashboard application built around an infinite, zoomable, and pannable canvas. It provides a unified interface for interacting with multiple MCP (Model Context Protocol) servers through a flexible, widget-based system.
mcp-browser-agent
A Model Context Protocol (MCP) integration that provides Claude Desktop with autonomous browser automation capabilities. This agent enables Claude to interact with web content, manipulate DOM elements, execute JavaScript, and perform API requests.
docmole
Dig through any documentation with AI - MCP server for Claude, Cursor, and other AI assistants
mult-fetch
A versatile MCP-compliant web content fetching tool that supports multiple modes (browser/node), formats (HTML/JSON/Markdown/Text), and intelligent proxy detection, with bilingual interface (English/Chinese).