Cline Browser Automation
STDIOModel Context Protocol server for browser automation using Python scripts.
Model Context Protocol server for browser automation using Python scripts.
A Model Context Protocol server for browser automation using Python scripts. For use with Cline
screenshot
: Capture a screenshot of a webpage (full page or viewport)get_html
: Retrieve the HTML content of a webpageexecute_js
: Execute JavaScript on a webpageget_console_logs
: Get console logs from a webpageAll operations support custom interaction steps (e.g., clicking elements, scrolling) after page load.
# Ubuntu/Debian sudo apt-get install xvfb # CentOS/RHEL sudo yum install xorg-x11-server-Xvfb # Arch Linux sudo pacman -S xorg-server-xvfb
Xvfb (X Virtual Frame Buffer) creates a virtual display, allowing browser automation without detection as a bot. Learn more about Xvfb here.
conda create -n browser-use python=3.11 conda activate browser-use pip install -r requirements.txt
The server supports multiple LLM providers. You can use any of the following API keys:
# Required: Set at least one of these API keys export GLHF_API_KEY=your_api_key export GROQ_API_KEY=your_api_key export OPENAI_API_KEY=your_api_key export OPENROUTER_API_KEY=your_api_key export GITHUB_API_KEY=your_api_key export DEEPSEEK_API_KEY=your_api_key export GEMINI_API_KEY=your_api_key export OLLAMA_API_KEY=your_api_key # Optional: Override default configuration export MODEL=your_preferred_model # Override the default model export BASE_URL=your_custom_url # Override the default API endpoint export USE_VISION=false # Enable/disable vision capabilities (default: false)
The server will automatically use the first available API key it finds. You can optionally customize the model and base URL for any provider using the environment variables.
To install Browser Use Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @ztobs/cline-browser-use-mcp --client claude
/home/YOUR_HOME/Documents/Cline/
directorynpm install
npm run build
Add the following configuration to your Cline MCP settings:
"browser-use": { "command": "node", "args": [ "/home/YOUR_HOME/Documents/Cline/MCP/browser-use-server/build/index.js" ], "env": { // Required: Set at least one API key "GLHF_API_KEY": "your_api_key", "GROQ_API_KEY": "your_api_key", "OPENAI_API_KEY": "your_api_key", "OPENROUTER_API_KEY": "your_api_key", "GITHUB_API_KEY": "your_api_key", "DEEPSEEK_API_KEY": "your_api_key", "GEMINI_API_KEY": "your_api_key", "OLLAMA_API_KEY": "your_api_key", // Optional: Configuration overrides "MODEL": "your_preferred_model", "BASE_URL": "your_custom_url", "USE_VISION": "false" }, "disabled": false, "autoApprove": [] }
Replace:
YOUR_HOME
with your actual home directory nameyour_api_key
with your actual API keysRun the server:
node build/index.js
The server will be available on stdio and supports the following operations:
Parameters:
Parameters:
Parameters:
Parameters:
Here are some example tasks you can accomplish using the browser-use server with Cline:
To change the color of a heading on a page that requires authentication:
Change the colour of the headline with the text "Alle Foren im Überblick." to deep blue on https://localhost:3000/foren/ page
To check/see the page, use browser-use MCP server to:
Open https://localhost:3000/auth,
Login with ztobs:Password123,
Navigate to https://localhost:3000/foren/,
Accept cookies if required
hint: execute all browser actions in one command with multiple comma-separated steps
This task demonstrates:
The server will execute these steps sequentially, handling any required interactions along the way.
The server supports multiple LLM providers with their default configurations:
You can override these defaults using environment variables:
MODEL
: Set a custom model name for any providerBASE_URL
: Set a custom API endpoint URL (if the provider supports it)The server supports vision capabilities through the USE_VISION environment variable:
The server automatically detects if Xvfb is installed and:
Default timeout is 5 minutes (300000 ms). Modify the TIMEOUT constant in build/index.js
to change this.
The server provides detailed error messages for:
Use the MCP Inspector for debugging:
npm run inspector
MIT