Description
### 1. Basic Configuration
This is a minimal, usable configuration that assumes you already have a Browserbase API key and a simple command to launch the Browserbase MCP server (e.g., via `npx` or a local script).
```json
{
"mcpServers": {
"browserbase-cloud-browser-automation": {
"command": "npx",
"args": [
"browserbase-mcp-server"
],
"env": {
"BROWSERBASE_API_KEY": "YOUR_BROWSERBASE_API_KEY_HERE"
},
"category": "automation"
}
}
}
```
**Explanation (not part of JSON):**
- `mcpServers`: Top-level key under `~/.claude/settings.json` where all MCP servers are defined.
- `"browserbase-cloud-browser-automation"`: The MCP server name as it will appear in Claude Code.
- `"command": "npx"`: Uses `npx` to run the Browserbase MCP server without global install.
- `"args": ["browserbase-mcp-server"]`: The package/CLI that starts the Browserbase Cloud Browser Automation MCP server.
- `"env".BROWSERBASE_API_KEY`: Your secret API key from Browserbase; required for authentication.
- `"category": "automation"`: Matches the MCP details category; helps organize tools in Claude Code.
### 2. Advanced Configuration
This example shows a more complete setup: using a locally installed script, specifying a working directory, timeouts, and extra environment variables for session behavior.
```json
{
"mcpServers": {
"browserbase-cloud-browser-automation": {
"command": "node",
"args": [
"/usr/local/bin/browserbase-mcp-server.js",
"--log-level",
"info",
"--max-concurrent-sessions",
"3"
],
"env": {
"BROWSERBASE_API_KEY": "YOUR_BROWSERBASE_API_KEY_HERE",
"BROWSERBASE_DEFAULT_REGION": "us-east-1",
"BROWSERBASE_DEFAULT_BROWSER": "chromium",
"BROWSERBASE_HEADLESS": "true",
"BROWSERBASE_SESSION_TIMEOUT_SECONDS": "300",
"BROWSERBASE_NAVIGATION_TIMEOUT_MS": "45000"
},
"cwd": "/opt/browserbase-mcp",
"category": "automation",
"disabled": false,
"timeoutSeconds": 120
}
}
}
```
**Explanation (not part of JSON):**
- `"command": "node"`: Directly runs a local Node.js script that implements the MCP server.
- `"args"`:
- `"/usr/local/bin/browserbase-mcp-server.js"`: Absolute path to the Browserbase MCP server entrypoint.
- `"--log-level", "info"`: Example CLI option to control logging verbosity.
- `"--max-concurrent-sessions", "3"`: Example CLI option to cap concurrent browser sessions.
- `"env"`:
- `BROWSERBASE_API_KEY`: Required for Browserbase API access.
- `BROWSERBASE_DEFAULT_REGION`: Preferred region for browser instances (example value).
- `BROWSERBASE_DEFAULT_BROWSER`: Default browser engine (e.g., `chromium`, `firefox` if supported).
- `BROWSERBASE_HEADLESS`: `"true"` to run browsers in headless mode.
- `BROWSERBASE_SESSION_TIMEOUT_SECONDS`: Auto-close idle sessions after this many seconds.
- `BROWSERBASE_NAVIGATION_TIMEOUT_MS`: Max time to wait for page navigation.
- `"cwd"`: Working directory for the server process (where configs/logs might live).
- `"category": "automation"`: Categorizes this server in Claude Code.
- `"disabled": false`: Explicitly enabled (you can set `true` to temporarily disable).
- `"timeoutSeconds": 120`: Maximum time Claude waits for a single MCP request before timing out.
### 3. Use Case Specific Configuration β Production Web Testing Pipeline
This configuration is tailored for a production-like setup where Claude Code is used to drive automated browser-based regression checks against a staging environment. It emphasizes stability, rate limiting, and environment scoping.
```json
{
"mcpServers": {
"browserbase-cloud-browser-automation-staging-tests": {
"command": "npx",
"args": [
"browserbase-mcp-server",
"--log-level",
"warn",
"--max-concurrent-sessions",
"5",
"--allow-url-prefix",
"https://staging.example.com"
],
"env": {
"BROWSERBASE_API_KEY": "YOUR_PRODUCTION_BROWSERBASE_API_KEY",
"BROWSERBASE_ENV": "staging",
"BROWSERBASE_DEFAULT_REGION": "us-west-2",
"BROWSERBASE_DEFAULT_BROWSER": "chromium",
"BROWSERBASE_HEADLESS": "true",
"BROWSERBASE_SESSION_TIMEOUT_SECONDS": "180",
"BROWSERBASE_NAVIGATION_TIMEOUT_MS": "30000",
"BROWSERBASE_MAX_STEPS_PER_SESSION": "50",
"BROWSERBASE_THROTTLE_MS_BETWEEN_ACTIONS": "500"
},
"cwd": "/srv/browserbase-mcp",
"category": "automation",
"timeoutSeconds": 180,
"disabled": false
}
}
}
```
**Explanation (not part of JSON):**
- MCP name `"browserbase-cloud-browser-automation-staging-tests"`: Distinct name to clearly mark this as the staging testing server.
- `"command": "npx"` + `"args"`:
- `"browserbase-mcp-server"`: CLI entry.
- `"--log-level", "warn"`: Less noisy logs for production-like use.
- `"--max-concurrent-sessions", "5"`: Allow more parallel test sessions.
- `"--allow-url-prefix", "https://staging.example.com"`: Example CLI guard to restrict browsing to your staging domain.
- `"env"`:
- `BROWSERBASE_API_KEY`: Production/staging API key with appropriate permissions.
- `BROWSERBASE_ENV`: Custom flag for your own logging/monitoring (e.g., `staging` vs `prod`).
- `BROWSERBASE_DEFAULT_REGION`: Region closest to your staging infra.
- `BROWSERBASE_DEFAULT_BROWSER`: Chosen browser for regression parity.
- `BROWSERBASE_HEADLESS`: Headless mode for CI/automation.
- `BROWSERBASE_SESSION_TIMEOUT_SECONDS`: Shorter timeout to avoid runaway sessions.
- `BROWSERBASE_NAVIGATION_TIMEOUT_MS`: Stricter navigation timeout to detect slow pages.
- `BROWSERBASE_MAX_STEPS_PER_SESSION`: Guardrail to avoid unbounded, long-running test flows.
- `BROWSERBASE_THROTTLE_MS_BETWEEN_ACTIONS`: Adds delay between actions to reduce flakiness and load.
- `"cwd"`: Production directory where logs/configs live.
- `"category": "automation"`: Groups this under automation tools in Claude Code.
- `"timeoutSeconds": 180`: Allows more time per request for longer test flows.
- `"disabled": false`: Enabled and ready for use in your staging testing workflows.