Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here
Browserbase MCP logo

Browserbase MCP

browserbase/mcp-server-browserbase
3,383 starsv2.1.1STDIORegistry activeApache-2.0Updated 2026-05-07Official

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

claude mcp add mcp-server-browserbase -- npx -y @browserbasehq/mcp-server-browserbase

Summary

Browserbase's MCP server gives an agent a cloud headless browser, so it can navigate sites, fill forms, and take actions on the web without running a local browser.

Connect from your MCP client

One-click install

Add this server to your editor with a single click. Fill in any required credentials afterward.

Claude Code

Run this once and Claude Code registers the server for you:

claude mcp add mcp-server-browserbase -- npx -y @browserbasehq/mcp-server-browserbase

Claude Desktop

Add this to claude_desktop_config.json under Settings → Developer → Edit Config:

{
  "mcpServers": {
    "mcp-server-browserbase": {
      "command": "npx",
      "args": [
        "-y",
        "@browserbasehq/mcp-server-browserbase"
      ],
      "env": {
        "BROWSERBASE_API_KEY": "<BROWSERBASE_API_KEY>",
        "BROWSERBASE_PROJECT_ID": "<BROWSERBASE_PROJECT_ID>",
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}

Cursor

Add this to .cursor/mcp.json in your project (or ~/.cursor/mcp.json for all projects):

{
  "mcpServers": {
    "mcp-server-browserbase": {
      "command": "npx",
      "args": [
        "-y",
        "@browserbasehq/mcp-server-browserbase"
      ],
      "env": {
        "BROWSERBASE_API_KEY": "<BROWSERBASE_API_KEY>",
        "BROWSERBASE_PROJECT_ID": "<BROWSERBASE_PROJECT_ID>",
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}

Cline and other MCP clients

Most MCP clients accept the standard mcpServers JSON block:

{
  "mcpServers": {
    "mcp-server-browserbase": {
      "command": "npx",
      "args": [
        "-y",
        "@browserbasehq/mcp-server-browserbase"
      ],
      "env": {
        "BROWSERBASE_API_KEY": "<BROWSERBASE_API_KEY>",
        "BROWSERBASE_PROJECT_ID": "<BROWSERBASE_PROJECT_ID>",
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}

Codex CLI

Register the server with OpenAI's Codex CLI — run this once, or add the equivalent block to ~/.codex/config.toml:

codex mcp add mcp-server-browserbase --env BROWSERBASE_API_KEY=<BROWSERBASE_API_KEY> --env BROWSERBASE_PROJECT_ID=<BROWSERBASE_PROJECT_ID> --env GEMINI_API_KEY=<GEMINI_API_KEY> -- npx -y @browserbasehq/mcp-server-browserbase

# or add to ~/.codex/config.toml:
[mcp_servers.mcp-server-browserbase]
command = "npx"
args = ["-y", "@browserbasehq/mcp-server-browserbase"]
[mcp_servers.mcp-server-browserbase.env]
BROWSERBASE_API_KEY = "<BROWSERBASE_API_KEY>"
BROWSERBASE_PROJECT_ID = "<BROWSERBASE_PROJECT_ID>"
GEMINI_API_KEY = "<GEMINI_API_KEY>"

OpenClaw

OpenClaw reads MCP servers from the mcp.servers section of ~/.openclaw/openclaw.json (managed via `openclaw mcp add` or the mcporter skill):

{
  "mcp": {
    "servers": {
      "mcp-server-browserbase": {
        "command": "npx",
        "args": [
          "-y",
          "@browserbasehq/mcp-server-browserbase"
        ],
        "env": {
          "BROWSERBASE_API_KEY": "<BROWSERBASE_API_KEY>",
          "BROWSERBASE_PROJECT_ID": "<BROWSERBASE_PROJECT_ID>",
          "GEMINI_API_KEY": "<GEMINI_API_KEY>"
        }
      }
    }
  }
}

Replace the <PLACEHOLDER> values with your own credentials — see the configuration table below.

Configuration

Browserbase MCP reads the following environment variables:

VariableRequired
BROWSERBASE_API_KEYRequired
BROWSERBASE_PROJECT_IDRequired
GEMINI_API_KEYRequired

README.md

Browserbase MCP Server

Archived

This repository is archived and no longer maintained.

It was originally published as a reference implementation and is retained for historical purposes. It should not be interpreted as representative of Browserbase's current production services or implementation.

!cover

The Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. Whether you're building an AI-powered IDE, enhancing a chat interface, or creating custom AI workflows, MCP provides a standardized way to connect LLMs with the context they need.

This server provides cloud browser automation capabilities using Browserbase and Stagehand. It enables LLMs to interact with web pages, extract information, and perform automated actions.

This is a self-hostable version of the Browserbase hosted MCP server with the same tools and functionality. We recommend using the hosted version for the easiest setup.

Tools

This server exposes 6 tools that match the hosted Browserbase MCP server:

| Tool | Description | Input | | ---------- | --------------------------------------- | -------------------------- | | start | Create or reuse a Browserbase session | _(none)_ | | end | Close the current Browserbase session | _(none)_ | | navigate | Navigate to a URL | { url: string } | | act | Perform an action on the page | { action: string } | | observe | Observe actionable elements on the page | { instruction: string } | | extract | Extract data from the page | { instruction?: string } |

How to Setup

We currently support 2 transports for our MCP server, STDIO and SHTTP. We recommend you use SHTTP with our hosted MCP server to take advantage of the server at full capacity.

SHTTP (Hosted MCP):

Use the Browserbase hosted MCP server at https://mcp.browserbase.com/mcp. This is the easiest way to get started -- we host the server and provide the LLM costs for Gemini, the best performing model in Stagehand.

For full setup instructions, see the Browserbase MCP documentation.

If your client supports SHTTP:

{
  "mcpServers": {
    "browserbase": {
      "type": "http",
      "url": "https://mcp.browserbase.com/mcp"
    }
  }
}

If your client doesn't support SHTTP:

{
  "mcpServers": {
    "browserbase": {
      "command": "npx",
      "args": ["mcp-remote", "https://mcp.browserbase.com/mcp"]
    }
  }
}

STDIO (Self-Hosted):

You can either use our server hosted on NPM or run it completely locally by cloning this repo.

Note: If you want to use a different model you have to add --modelName to the args and provide that respective key as an arg. More info below.

To run via NPM (Recommended)

Go into your MCP Config JSON and add the Browserbase Server:

{
  "mcpServers": {
    "browserbase": {
      "command": "npx",
      "args": ["@browserbasehq/mcp"],
      "env": {
        "BROWSERBASE_API_KEY": "",
        "BROWSERBASE_PROJECT_ID": "",
        "GEMINI_API_KEY": ""
      }
    }
  }
}

That's it! Reload your MCP client and you're ready to go.

To run 100% local:

Option 1: Direct installation

git clone https://github.com/browserbase/mcp-server-browserbase.git
cd mcp-server-browserbase
npm install && npm run build

Option 2: Docker

git clone https://github.com/browserbase/mcp-server-browserbase.git
cd mcp-server-browserbase
docker build -t mcp-browserbase .

Then in your MCP Config JSON run the server:

Using Direct Installation

{
  "mcpServers": {
    "browserbase": {
      "command": "node",
      "args": ["/path/to/mcp-server-browserbase/cli.js"],
      "env": {
        "BROWSERBASE_API_KEY": "",
        "BROWSERBASE_PROJECT_ID": "",
        "GEMINI_API_KEY": ""
      }
    }
  }
}

Using 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": ""
      }
    }
  }
}

Configuration

The Browserbase MCP server accepts the following command-line flags:

| Flag | Description | | -------------------------- | --------------------------------------------------------------------------- | | --proxies | Enable Browserbase proxies for the session | | --verified | Enable Browserbase Verified Identity (Only for Scale Plan Users) | | --advancedStealth | Deprecated alias for --verified | | --keepAlive | Enable Browserbase Keep Alive Session | | --contextId <contextId> | Specify a Browserbase Context ID to use | | --persist | Whether to persist the Browserbase context (default: true) | | --port <port> | Port to listen on for HTTP/SHTTP transport | | --host <host> | Host to bind server to (default: localhost, use 0.0.0.0 for all interfaces) | | --browserWidth <width> | Browser viewport width (default: 1024) | | --browserHeight <height> | Browser viewport height (default: 768) | | --modelName <model> | The model to use for Stagehand (default: google/gemini-2.5-flash-lite) | | --modelApiKey <key> | API key for the custom model provider (required when using custom models) | | --experimental | Enable experimental features (default: false) |

These flags can be passed directly to the CLI or configured in your MCP configuration file.

Note: These flags can only be used with the self-hosted server (npx @browserbasehq/mcp or Docker).

Model Configuration

Stagehand defaults to using Google's Gemini 2.5 Flash Lite model, but you can configure it to use other models like GPT-4o, Claude, or other providers.

Important: When using any custom model (non-default), you must provide your own API key for that model provider using the --modelApiKey flag.

{
  "mcpServers": {
    "browserbase": {
      "command": "npx",
      "args": [
        "@browserbasehq/mcp",
        "--modelName",
        "anthropic/claude-sonnet-4.5",
        "--modelApiKey",
        "your-anthropic-api-key"
      ],
      "env": {
        "BROWSERBASE_API_KEY": "",
        "BROWSERBASE_PROJECT_ID": ""
      }
    }
  }
}

_Note: The model must be supported in Stagehand. Check out the docs here._

Links

License

Licensed under the Apache 2.0 License.

Copyright 2025 Browserbase, Inc.

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Browser & Scraping servers.