Skip to content

MCP setupTesting

Browserbase MCP Server

Run browser sessions in the Browserbase cloud from your agent to open pages, act on them in plain language and extract data, via the self-hosted server.

npx workspacetemplates add browserbase-mcp --tool claude-code

Writes 1 file to your project root

.mcp.jsonmerge into your file15 lines · 320 BFile
{
  "mcpServers": {
    "browserbase": {
      "command": "npx",
      "args": [
        "@browserbasehq/mcp"
      ],
      "env": {
        "BROWSERBASE_API_KEY": "${BROWSERBASE_API_KEY}",
        "BROWSERBASE_PROJECT_ID": "${BROWSERBASE_PROJECT_ID}",
        "GEMINI_API_KEY": "${GEMINI_API_KEY}"
      }
    }
  }
}

What it does

Browserbase hosts headless browsers, and this server connects an agent to them through Stagehand. The tools are start, end, navigate, act, observe and extract, so the agent can describe a click in words and read structured data back.

This setup uses the self-hosted stdio package, @browserbasehq/mcp. It needs a Browserbase API key and project ID, plus a Gemini key for the default Stagehand model. You can pass --modelName and --modelApiKey to use another supported model.

Note that the repository is now archived and no longer maintained, and Browserbase points to a hosted endpoint instead. Check their docs if you want that route.

Example

you › Open https://example.com/pricing and extract the plan names with their monthly prices.

agent › Started a session, navigated to the pricing page and extracted three plans: Free at 0, Team at 20 per seat, Business at 45 per seat. Session ended.

Questions

Why do I need a Gemini key?
Stagehand uses a model to interpret act, observe and extract. The default is a Gemini model; pass --modelName and --modelApiKey to choose another one it supports.
Will sessions bill my account?
Sessions run on Browserbase infrastructure under your project, so usage follows your Browserbase plan. Call the end tool when you finish.
  • Chrome DevTools MCP Server

    MCP setupTesting

    Free
  • Playwright MCP Server

    MCP setupTesting

    Free
  • Contract Testing

    SkillTesting

    Free
  • E2E Test Design

    SkillTesting

    Free