Overview
The MCP (Model Context Protocol) Server allows you to expose browser-use’s browser automation capabilities to AI assistants like Claude Desktop, Cline, and other MCP-compatible clients. This enables AI assistants to perform web automation tasks directly through browser-use.Quick Start
Start MCP Server
Claude Desktop Integration
The most common use case is integrating with Claude Desktop. Add this configuration to your Claude Desktop config file:macOS
Edit~/Library/Application Support/Claude/claude_desktop_config.json
:
Windows
Edit%APPDATA%\Claude\claude_desktop_config.json
:
Environment Variables
You can configure browser-use through environment variables:OPENAI_API_KEY
- Your OpenAI API key (required)ANTHROPIC_API_KEY
- Your Anthropic API key (alternative to OpenAI)BROWSER_USE_HEADLESS
- Set tofalse
to show browser windowBROWSER_USE_DISABLE_SECURITY
- Set totrue
to disable browser security features
Available Tools
The MCP server exposes these browser automation tools:Autonomous Agent Tools
retry_with_browser_use_agent
- Run a complete browser automation task with an AI agent (use as last resort when direct control fails)
Direct Browser Control
browser_navigate
- Navigate to a URLbrowser_click
- Click on an element by indexbrowser_type
- Type text into an elementbrowser_get_state
- Get current page state and interactive elementsbrowser_scroll
- Scroll the pagebrowser_go_back
- Go back in browser history
Tab Management
browser_list_tabs
- List all open browser tabsbrowser_switch_tab
- Switch to a specific tabbrowser_close_tab
- Close a tab
Content Extraction
browser_extract_content
- Extract structured content from the current page
Session Management
browser_list_sessions
- List all active browser sessions with detailsbrowser_close_session
- Close a specific browser session by IDbrowser_close_all
- Close all active browser sessions
Example Usage
Once configured with Claude Desktop, you can ask Claude to perform browser automation tasks:Programmatic Usage
You can also connect to the MCP server programmatically:Troubleshooting
Common Issues
“MCP SDK is required” Error- Check that you have Chrome/Chromium installed
- Try setting
BROWSER_USE_HEADLESS=false
to see browser window - Ensure no other browser instances are using the same profile
- Verify your
OPENAI_API_KEY
is set correctly - Check API key permissions and billing status
- Try using
ANTHROPIC_API_KEY
as an alternative
- Restart Claude Desktop after config changes
- Check the config file syntax is valid JSON
- Verify the file path is correct for your OS
Debug Mode
Enable debug logging by setting:Security Considerations
- The MCP server has access to your browser and file system
- Only connect trusted MCP clients
- Be cautious with sensitive websites and data
- Consider running in a sandboxed environment for untrusted automation
Next Steps
- Explore the examples directory for more usage patterns
- Check out MCP documentation to learn more about the protocol
- Join our Discord for support and discussions