Configuration Overview
The Browserbase MCP server supports extensive configuration options through command-line flags and environment variables. Configure browser behavior, proxy settings, stealth modes, model selection, and more to customize your browser automation workflows.Command-line flags are only available when running the server locally (
npx @browserbasehq/mcp with flags or local development setup).Environment Variables
Configure the essential Browserbase credentials and optional debugging settings:BROWSERBASE_API_KEY
Your Browserbase API key for authentication
Command-Line Flags
Available Flags
Configuration Examples
Basic Configuration
- Remote URL (SHTTP)
- NPM Package
- Local STDIO
- Local SHTTP
Advanced Features
- Proxies
- Advanced Stealth
- Contexts
Enable Browserbase proxies for IP rotation and geo-location testing.
Browser Customization
- Viewport Sizing
Customize browser window dimensions. Default is 1288x711. Recommended aspect ratios: 16:9.Common Resolutions:
- Desktop: 1920x1080, 1280x720, 1024x768
- Mobile: 375x667 (iPhone), 360x640 (Android)
- Tablet: 768x1024 (iPad)
Model Configuration
Configure AI models for enhanced browser automation. Stagehand defaults to Google’s Gemini 2.5 Flash Lite but supports multiple providers.- Available Models
- Configuration Examples
Google Gemini (Default)
google/gemini-2.5-flash-lite(default)google/gemini-2.5-progoogle/gemini-2.5-flash
gpt-5-2025-08-07gpt-4.1-2025-04-14gpt-4ogpt-4o-mini
claude-sonnet-4-5claude-haiku-4-5
Development Configuration
- Custom Host/Port
Configure custom host and port for SHTTP transport.
Best Practices
Performance - How can I optimize browser automation performance?
Performance - How can I optimize browser automation performance?
- Use appropriate viewport sizes for your use case
- Enable proxies only when needed for geo-location
- Choose efficient models (Gemini Flash for speed, GPT-4o for accuracy)
- Reuse contexts for authentication persistence
Security - What security measures should I implement?
Security - What security measures should I implement?
- Store API keys securely in environment variables
- Use Advanced Stealth for sensitive operations
- Implement proper session management
- Rotate cookies and contexts regularly
Development - What are the recommended development practices?
Development - What are the recommended development practices?
- Enable debug mode during development
- Use context persistence for faster iteration
- Test with different viewport sizes
- Monitor session usage and quotas
Production - How should I configure for production environments?
Production - How should I configure for production environments?
- Use NPM installation for reliability
- Configure appropriate timeouts
- Implement error handling and retries
- Monitor performance and resource usage
Further Reading
Browserbase Documentation
Complete platform documentation
Stagehand Docs
AI-powered browser automation
Support
Get help from our team

