Browserbase MCP
Browserbase MCP Server enables LLMs to control cloud browsers for automation, data extraction, and screenshots. It supports multi-models, proxies, stealth mode, and session management for seamless web interaction.
How to Install and Use Browserbase MCP
Browserbase MCP is a tool that lets AI models control a web browser for tasks like navigation, clicking, and taking screenshots. If you want to use Browserbase MCP, this guide will walk you through the simplest way to install and run it, with practical code examples.
Step 1: Choose How to Run Browserbase MCP
You can run Browserbase MCP in two ways: using the NPM package (recommended) or running it fully on your own computer (locally) either by direct install or using Docker. Let's look at both options.
Step 2: Using Browserbase MCP with NPM (Recommended)
The easiest way is to run Browserbase MCP through NPM. This means you won't have to set up everything by yourself.
To do this, add this block to your MCP configuration file (usually a JSON file):
{
"mcpServers": {
"browserbase": {
"command": "npx",
"args": ["@browserbasehq/mcp-server-browserbase"],
"env": {
"BROWSERBASE_API_KEY": "",
"BROWSERBASE_PROJECT_ID": "",
"GEMINI_API_KEY": ""
}
}
}
}
Fill in your API keys where the empty quotes are. Once you save this and reload your MCP client, Browserbase MCP will be ready to use.
Step 3: Installing and Running Browserbase MCP Locally
If you want to run Browserbase MCP entirely on your local machine, you have two options: install it directly or use Docker.
Option 3a: Direct Installation
First, clone the repository and install its dependencies:
git clone https://github.com/browserbase/mcp-server-browserbase.git
cd mcp-server-browserbase
npm install && npm run build
After that, update your MCP config like this to run the server:
{
"mcpServers": {
"browserbase": {
"command": "node",
"args": ["./cli.js"],
"env": {
"BROWSERBASE_API_KEY": "",
"BROWSERBASE_PROJECT_ID": "",
"GEMINI_API_KEY": ""
}
}
}
}
Make sure to replace ./cli.js with the correct path if you are not in the root of the cloned repo.
Option 3b: Using Docker
To run from a Docker image, first build it:
git clone https://github.com/browserbase/mcp-server-browserbase.git
cd mcp-server-browserbase
docker build -t mcp-browserbase .
Then, update your MCP config to run the Docker container:
{
"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": ""
}
}
}
}
Then reload your MCP client, and it will connect to the Docker-based Browserbase MCP.
Step 4: Adding Optional Configuration Flags
Browserbase MCP supports some useful command-line flags to change how the browser behaves. For example, if you want to enable proxies, you can add the --proxies flag like this:
{
"mcpServers": {
"browserbase": {
"command": "npx",
"args": ["@browserbasehq/mcp-server-browserbase", "--proxies"],
"env": {
"BROWSERBASE_API_KEY": "",
"BROWSERBASE_PROJECT_ID": "",
"GEMINI_API_KEY": ""
}
}
}
}
You can add other flags like --advancedStealth or --experimental depending on your needs.
Step 5: Using Different Models
By default, Browserbase MCP uses Google’s Gemini 2.0 Flash model. If you want to use a different model, like Claude, you must provide that model's name and its API key.
Here’s how to set it in your config:
{
"mcpServers": {
"browserbase": {
"command": "npx",
"args": [
"@browserbasehq/mcp-server-browserbase",
"--modelName",
"anthropic/claude-sonnet-4.5",
"--modelApiKey",
"your-anthropic-api-key"
],
"env": {
"BROWSERBASE_API_KEY": "",
"BROWSERBASE_PROJECT_ID": ""
}
}
}
}
Replace "your-anthropic-api-key" with your actual API key.
By following these steps and examples, you can quickly install and run Browserbase MCP to enable AI models to control browsers and automate web tasks easily.