The Browserbase MCP Server provides cloud browser automation capabilities, enabling LLMs to interact with web pages, take screenshots, extract data, and perform automated actions with atomic precision using Browserbase and Stagehand.
The simplest way to use Browserbase MCP Server is through the remote hosted URL:
For clients that support SHTTP:
{
"mcpServers": {
"browserbase": {
"url": "your-smithery-url.com"
}
}
}
For clients that don't support SHTTP:
{
"mcpServers": {
"browserbase": {
"command": "npx",
"args": ["mcp-remote", "your-smithery-url.com"]
}
}
}
You can run the server locally using NPM:
{
"mcpServers": {
"browserbase": {
"command": "npx",
"args": ["@browserbasehq/mcp-server-browserbase"],
"env": {
"BROWSERBASE_API_KEY": "your-api-key",
"BROWSERBASE_PROJECT_ID": "your-project-id",
"GEMINI_API_KEY": "your-gemini-key"
}
}
}
}
For a fully local setup:
# Clone the repository
git clone https://github.com/browserbase/mcp-server-browserbase.git
cd mcp-server-browserbase
# Install dependencies and build
pnpm install && pnpm build
Then add to your MCP configuration:
{
"mcpServers": {
"browserbase": {
"command": "node",
"args": ["/path/to/mcp-server-browserbase/cli.js"],
"env": {
"BROWSERBASE_API_KEY": "your-api-key",
"BROWSERBASE_PROJECT_ID": "your-project-id",
"GEMINI_API_KEY": "your-gemini-key"
}
}
}
}
The server supports various configuration flags:
Flag | Description |
---|---|
--proxies |
Enable Browserbase proxies for the session |
--advancedStealth |
Enable Browserbase Advanced Stealth (Only for Scale Plan Users) |
--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) |
--cookies [json] |
JSON array of cookies to inject into the browser |
--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.0-flash) |
--modelApiKey <key> |
API key for the custom model provider (required when using custom models) |
--experimental |
Enable experimental features (default: false) |
{
"mcpServers": {
"browserbase": {
"command": "npx",
"args": ["@browserbasehq/mcp-server-browserbase", "--proxies"],
"env": {
"BROWSERBASE_API_KEY": "your-api-key",
"BROWSERBASE_PROJECT_ID": "your-project-id",
"GEMINI_API_KEY": "your-gemini-key"
}
}
}
}
{
"mcpServers": {
"browserbase": {
"command": "npx",
"args": ["@browserbasehq/mcp-server-browserbase", "--advancedStealth"],
"env": {
"BROWSERBASE_API_KEY": "your-api-key",
"BROWSERBASE_PROJECT_ID": "your-project-id",
"GEMINI_API_KEY": "your-gemini-key"
}
}
}
}
{
"mcpServers": {
"browserbase": {
"command": "npx",
"args": [
"@browserbasehq/mcp-server-browserbase",
"--contextId",
"your-context-id"
],
"env": {
"BROWSERBASE_API_KEY": "your-api-key",
"BROWSERBASE_PROJECT_ID": "your-project-id",
"GEMINI_API_KEY": "your-gemini-key"
}
}
}
}
{
"mcpServers": {
"browserbase": {
"command": "npx",
"args": [
"@browserbasehq/mcp-server-browserbase",
"--browserHeight", "1080",
"--browserWidth", "1920"
],
"env": {
"BROWSERBASE_API_KEY": "your-api-key",
"BROWSERBASE_PROJECT_ID": "your-project-id",
"GEMINI_API_KEY": "your-gemini-key"
}
}
}
}
{
"mcpServers": {
"browserbase": {
"command": "npx",
"args": [
"@browserbasehq/mcp-server-browserbase",
"--modelName", "anthropic/claude-3-5-sonnet-latest",
"--modelApiKey", "your-anthropic-api-key"
],
"env": {
"BROWSERBASE_API_KEY": "your-api-key",
"BROWSERBASE_PROJECT_ID": "your-project-id"
}
}
}
}
The server provides access to screenshot resources that can be accessed using:
screenshot://<screenshot-name>
(PNG images of captured screenshots)To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "browserbase" '{"command":"npx","args":["-y","@browserbasehq/mcp-browserbase"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"browserbase": {
"command": "npx",
"args": [
"-y",
"@browserbasehq/mcp-browserbase"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"browserbase": {
"command": "npx",
"args": [
"-y",
"@browserbasehq/mcp-browserbase"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect