Official Browserbase MCP server with Stagehand
## Browserbase MCP Server: Cloud Browser Infrastructure The **Browserbase MCP Server** integrates cloud browser infrastructure into Google Antigravity, enabling developers to run headless browsers at scale for web scraping, testing, and automation without managing browser instances. ### Why Browserbase MCP? - **Cloud browsers** - Managed headless browser instances - **Scalable** - Run hundreds of browsers in parallel - **Anti-detection** - Built-in fingerprint protection - **Session management** - Persistent browser sessions - **Debugging** - Live browser debugging and recording ### Key Features #### 1. Browser Sessions ```python # Create browser session session = await mcp.call("browserbase", "create_session", { "project_id": "proj_xxx", "browser": "chromium", "proxy": True }) print(f"Session ID: {session[\"id\"]}") print(f"WebSocket URL: {session[\"ws_url\"]}") ``` #### 2. Page Navigation ```python # Navigate to URL page = await mcp.call("browserbase", "navigate", { "session_id": session["id"], "url": "https://example.com" }) # Get page content content = await mcp.call("browserbase", "get_content", { "session_id": session["id"] }) print(f"Title: {content[\"title\"]}") ``` #### 3. Element Interaction ```python # Click element await mcp.call("browserbase", "click", { "session_id": session["id"], "selector": "button.submit" }) # Type text await mcp.call("browserbase", "type", { "session_id": session["id"], "selector": "input[name=email]", "text": "user@example.com" }) ``` #### 4. Session Recording ```python # Get session recording recording = await mcp.call("browserbase", "get_recording", { "session_id": session["id"] }) print(f"Recording URL: {recording[\"url\"]}") # Get session logs logs = await mcp.call("browserbase", "get_logs", { "session_id": session["id"] }) ``` ### Configuration ```json { "mcpServers": { "browserbase": { "command": "npx", "args": ["-y", "@anthropic/mcp-browserbase"], "env": { "BROWSERBASE_API_KEY": "your-api-key", "BROWSERBASE_PROJECT_ID": "proj_xxx" } } } } ``` ### Use Cases **Web Scraping**: Scale data extraction from websites. **E2E Testing**: Run browser tests in the cloud. **Automation**: Automate web workflows reliably. **Monitoring**: Monitor websites for changes. The Browserbase MCP Server enables cloud browser automation.
{
"mcpServers": {
"browserbase": {
"mcpServers": {
"browserbase": {
"env": {
"BROWSERBASE_API_KEY": "YOUR_BROWSERBASE_API_KEY",
"BROWSERBASE_PROJECT_ID": "YOUR_PROJECT_ID"
},
"args": [
"-y",
"@browserbasehq/mcp-server-browserbase"
],
"command": "npx"
}
}
}
}
}