Documentation Index
Fetch the complete documentation index at: https://mintlify.com/browserbase/stagehand/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Browserbase MCP Server brings powerful browser automation capabilities to AI assistants through the Model Context Protocol (MCP). Built on Stagehand, this integration provides AI-powered web automation using natural language commands.This server enables AI assistants like Claude to control browsers, navigate websites, interact with web elements, and extract data—all through simple conversational commands.
Key Features
Natural Language Automation
Control browsers using plain English commands like “click the login button” or “fill out the contact form”
Web Interaction
Navigate, click, and fill forms with ease
Data Extraction
Extract structured data from any website automatically
Screenshot Capture
Capture and analyze webpage screenshots programmatically
Installation Methods
Choose the installation method that best fits your needs:Remote URL (SHTTP) - Recommended
Go to smithery.ai and enter your API keys to get a remote hosted URL:NPM Package (STDIO)
The easiest way to get started locally:Local Development
For customization or local testing:Quick Start
Prerequisites
- Get your Browserbase API key and project ID from the Browserbase Dashboard
- Get your LLM provider API key (Gemini, OpenAI, or Claude)
Basic Setup
- Add the server to your MCP client configuration (see installation methods above)
- Restart your MCP client
- Verify the tools are available (look for the 🔨 icon)
Test the Integration
Try asking your AI assistant:Using MCP Servers with Stagehand
You can connect external MCP servers to your Stagehand agents for enhanced capabilities:Connect to an MCP Server
Use with Stagehand Agent
Example: Exa Search Integration
Example: Supabase Integration
Configuration Options
Command-Line Flags
| Flag | Description |
|---|---|
--proxies | Enable Browserbase proxies |
--advancedStealth | Enable Advanced Stealth mode (Scale Plan) |
--keepAlive | Keep browser session alive |
--contextId <id> | Use specific Browserbase context |
--persist [boolean] | Persist context (default: true) |
--port <port> | Port for SHTTP transport |
--host <host> | Host to bind server (default: localhost) |
--browserWidth <width> | Viewport width (default: 1024) |
--browserHeight <height> | Viewport height (default: 768) |
--modelName <model> | AI model to use (default: gemini-2.0-flash) |
--modelApiKey <key> | API key for custom model |
--experimental | Enable experimental features |
Advanced Configuration Example
Available Models
Google Gemini (Default):gemini-2.0-flash(default)gemini-2.5-progemini-2.5-flash
gpt-4ogpt-4o-minigpt-4-turbo
claude-sonnet-4-5claude-haiku-4-5
Use Cases
- Web Scraping
- Testing
- Workflow Automation
- Track product prices and availability
- Monitor competitor information
- Aggregate content from multiple sources
- Extract contact information and business data
Best Practices
Performance
- Use appropriate viewport sizes for your use case
- Enable proxies only when needed
- Choose efficient models (Gemini Flash for speed, GPT-4o for accuracy)
- Reuse contexts for authentication persistence
Security
- Store API keys securely in environment variables
- Use Advanced Stealth for sensitive operations
- Implement proper session management
- Rotate cookies and contexts regularly
Development
- Enable debug mode during development
- Use context persistence for faster iteration
- Test with different viewport sizes
- Monitor session usage and quotas
Resources
MCP Protocol Docs
Learn about Model Context Protocol
Browserbase Docs
Explore Browserbase features
Stagehand Docs
AI-powered browser automation
MCP Server GitHub
View source code and examples
Agent Reference
Learn about Stagehand’s Agent API
Support
Get help from our team