@browserbasehq/mcp-server-browserbase

中文文档
2.4.3发布于 2026/01/24Apache-2.0ES Module近 30 天下载 5128

MCP server for AI web browser automation using Browserbase and Stagehand

此软件包已被标记为弃用

This package has moved to @browserbasehq/mcp

原始使用文档
文档目录22 节
  1. What's New in Stagehand v3
  2. Features
  3. How to Setup
  4. Quickstarts:
  5. SHTTP:
  6. STDIO:
  7. To run on NPM (Recommended)
  8. To run 100% local:
  9. STDIO:
  10. Configuration
  11. NOTE:
  12. Using Configuration Flags with Docker
  13. Configuration Examples
  14. Proxies
  15. Advanced Stealth
  16. Contexts
  17. Browser Viewport Sizing
  18. Experimental Features
  19. Model Configuration
  20. Resources
  21. Key Features
  22. License

Browserbase MCP Server

smithery badge

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, take screenshots, extract information, and perform automated actions with atomic precision.

What's New in Stagehand v3

Powered by Stagehand v3.0, this MCP server now includes:

  • 20-40% Faster Performance: Speed improvements across all core operations (act, extract, observe) through automatic caching
  • Enhanced Extraction: Targeted extraction and observation across iframes and shadow roots
  • Improved Schemas: Streamlined extract schemas for more intuitive data extraction
  • Advanced Selector Support: CSS selector support with improved element targeting
  • Multi-Browser Support: Compatible with Playwright, Puppeteer, and Patchright
  • New Primitives: Built-in page, locator, frameLocator, and deepLocator for simplified automation
  • Experimental Features: Enable cutting-edge capabilities with the --experimental flag

For more details, visit the Stagehand v3 documentation.

Features

FeatureDescription
Browser AutomationControl and orchestrate cloud browsers via Browserbase
Data ExtractionExtract structured data from any webpage
Web InteractionNavigate, click, and fill forms with ease
ScreenshotsCapture full-page and element screenshots
Model FlexibilitySupports multiple models (OpenAI, Claude, Gemini, and more)
Vision SupportUse annotated screenshots for complex DOMs
Session ManagementCreate, manage, and close browser sessions
High Performance20-40% faster operations with automatic caching (v3)
Advanced SelectorsEnhanced CSS selector support for precise element targeting

How to Setup

Quickstarts:

Add to Cursor

Copy and Paste this link in your Browser:

cursor://anysphere.cursor-deeplink/mcp/install?name=browserbase&config=eyJjb21tYW5kIjoibnB4IEBicm93c2VyYmFzZWhxL21jcCIsImVudiI6eyJCUk9XU0VSQkFTRV9BUElfS0VZIjoiIiwiQlJPV1NFUkJBU0VfUFJPSkVDVF9JRCI6IiIsIkdFTUlOSV9BUElfS0VZIjoiIn19

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

SHTTP:

To use the Browserbase MCP Server through our remote hosted URL, add the following to your configuration.

Go to smithery.ai and enter your API keys and configuration to get a remote hosted URL. When using our remote hosted server, we provide the LLM costs for Gemini, the best performing model in Stagehand.

Smithery Image

If your client supports SHTTP:

{
  "mcpServers": {
    "browserbase": {
      "type": "http",
      "url": "your-smithery-url.com"
    }
  }
}

If your client doesn't support SHTTP:

{
  "mcpServers": {
    "browserbase": {
      "command": "npx",
      "args": ["mcp-remote", "your-smithery-url.com"]
    }
  }
}

STDIO:

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

❗️ Important: 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.

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

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

That's it! Reload your MCP client and Claude will be able to use Browserbase.

To run 100% local:

Option 1: Direct installation

# Clone the Repo
git clone https://github.com/browserbase/mcp-server-browserbase.git
cd mcp-server-browserbase

# Install the dependencies and build the project
npm install && npm run build

Option 2: Docker

# Clone the Repo
git clone https://github.com/browserbase/mcp-server-browserbase.git
cd mcp-server-browserbase

# Build the Docker image
docker build -t mcp-browserbase .

Then in your MCP Config JSON run the server. To run locally we can use STDIO or self-host SHTTP.

STDIO:

Using Direct Installation

To your MCP Config JSON file add the following:

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

Using Docker

To your MCP Config JSON file add the following:

{
  "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 you should be good to go!

Configuration

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

FlagDescription
--proxiesEnable Browserbase proxies for the session
--advancedStealthEnable Browserbase Advanced Stealth (Only for Scale Plan Users)
--keepAliveEnable Browserbase Keep Alive Session
--contextId <contextId>Specify a Browserbase Context ID to use
--persistWhether 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: gemini-2.0-flash)
--modelApiKey <key>API key for the custom model provider (required when using custom models)
--experimentalEnable experimental features (default: false)

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

NOTE:

Currently, these flags can only be used with the local server (npx @browserbasehq/mcp-server-browserbase or Docker).

Using Configuration Flags with Docker

When using Docker, you can pass configuration flags as additional arguments after the image name. Here's an example with the --proxies flag:

{
  "mcpServers": {
    "browserbase": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e",
        "BROWSERBASE_API_KEY",
        "-e",
        "BROWSERBASE_PROJECT_ID",
        "-e",
        "GEMINI_API_KEY",
        "mcp-browserbase",
        "--proxies"
      ],
      "env": {
        "BROWSERBASE_API_KEY": "",
        "BROWSERBASE_PROJECT_ID": "",
        "GEMINI_API_KEY": ""
      }
    }
  }
}

You can also run the Docker container directly from the command line:

docker run --rm -i \
  -e BROWSERBASE_API_KEY=your_api_key \
  -e BROWSERBASE_PROJECT_ID=your_project_id \
  -e GEMINI_API_KEY=your_gemini_key \
  mcp-browserbase --proxies

Configuration Examples

Proxies

Here are our docs on Proxies.

To use proxies, set the --proxies flag in your MCP Config:

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

Advanced Stealth

Here are our docs on Advanced Stealth.

To use advanced stealth, set the --advancedStealth flag in your MCP Config:

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

Contexts

Here are our docs on Contexts

To use contexts, set the --contextId flag in your MCP Config:

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

Browser Viewport Sizing

The default viewport sizing for a browser session is 1024 x 768. You can adjust the Browser viewport sizing with browserWidth and browserHeight flags.

Here's how to use it for custom browser sizing. We recommend to stick with 16:9 aspect ratios (ie: 1920 x 1080, 1280 x 720, 1024 x 768)

{
  "mcpServers": {
    "browserbase": {
      "command": "npx",
      "args": [
        "@browserbasehq/mcp-server-browserbase",
        "--browserHeight 1080",
        "--browserWidth 1920"
      ],
      "env": {
        "BROWSERBASE_API_KEY": "",
        "BROWSERBASE_PROJECT_ID": "",
        "GEMINI_API_KEY": ""
      }
    }
  }
}

Experimental Features

Stagehand v3 includes experimental features that can be enabled with the --experimental flag. These features provide cutting-edge capabilities that are actively being developed and refined.

To enable experimental features:

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

Note: Experimental features may change or be removed in future releases. Use them at your own discretion.

Model Configuration

Stagehand defaults to using Google's Gemini 2.0 Flash 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.

Here's how to configure different models:

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

Note: The model must be supported in Stagehand. Check out the docs here. When using any custom model, you must provide your own API key for that provider.

Resources

The server provides access to screenshot resources:

  1. Screenshots (screenshot://<screenshot-name>)
    • PNG images of captured screenshots

Key Features

  • AI-Powered Automation: Natural language commands for web interactions
  • Multi-Model Support: Works with OpenAI, Claude, Gemini, and more
  • Screenshot Capture: Full-page and element-specific screenshots
  • Data Extraction: Intelligent content extraction from web pages
  • Proxy Support: Enterprise-grade proxy capabilities
  • Stealth Mode: Advanced anti-detection features
  • Context Persistence: Maintain authentication and state across sessions

For more information about the Model Context Protocol, visit:

For the official MCP Docs:

License

Licensed under the Apache 2.0 License.

Copyright 2025 Browserbase, Inc.

版本与发布记录

@browserbasehq/mcp-server-browserbase 共发布 14 个版本,首次发布于 2025/07/28;过去 12 个月发布了 5 个版本。

版本发布日期距今
2.4.3latest2026/01/249 个月前
2.4.22025/11/2411 个月前
2.4.12025/11/1811 个月前
2.4.02025/11/1211 个月前
2.3.02025/11/1111 个月前
2.2.02025/10/171.1 年前

关于 @browserbasehq/mcp-server-browserbase 的常见问题

@browserbasehq/mcp-server-browserbase 是什么?

MCP server for AI web browser automation using Browserbase and Stagehand注意:该包已被作者标记为弃用——This package has moved to @browserbasehq/mcp

如何安装 @browserbasehq/mcp-server-browserbase?

在项目目录运行 npm install @browserbasehq/mcp-server-browserbase,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 mcp-server-browserbase,可以用 npx mcp-server-browserbase 直接运行。

@browserbasehq/mcp-server-browserbase 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/browserbasehq__mcp-server-browserbase 是否存在。

@browserbasehq/mcp-server-browserbase 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@browserbasehq/mcp-server-browserbase 可以商用吗?

@browserbasehq/mcp-server-browserbase 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@browserbasehq/mcp-server-browserbase 的下载量有多少?

根据 npm 官方下载统计,@browserbasehq/mcp-server-browserbase 在 2026/10/09 – 2026/11/07 这 30 天内被下载 5,128 次,日均约 171 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@browserbasehq/mcp-server-browserbase 还在维护吗?

最新版本 2.4.3 发布于 2026/01/24(9 个月前);至今共发布 14 个版本,其中过去 12 个月发布了 5 个;首次发布于 2025/07/28。作者已将其标记为弃用,新项目建议寻找替代方案。