Browser Use Server is a Model Context Protocol (MCP) server that enables browser automation tasks through Python scripts. It allows you to programmatically capture screenshots, retrieve HTML content, execute JavaScript, and get console logs from webpages, with support for custom interaction steps like clicking elements or scrolling after page load.
You'll need to install Xvfb for headless browser automation (optional but recommended):
# 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 creates a virtual display for browser automation without being detected as a bot.
conda create -n browser-use python=3.11
conda activate browser-use
pip install -r requirements.txt
Set up at least one API key for the LLM providers:
# 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
export BASE_URL=your_custom_url
export USE_VISION=false
To install automatically via Smithery:
npx -y @smithery/cli install @ztobs/cline-browser-use-mcp --client claude
/home/YOUR_HOME/Documents/Cline/
npm install
npm run build
Add this configuration to your Cline MCP settings:
"browser-use": {
"command": "node",
"args": [
"/home/YOUR_HOME/Documents/Cline/MCP/browser-use-server/build/index.js"
],
"env": {
"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",
"MODEL": "your_preferred_model",
"BASE_URL": "your_custom_url",
"USE_VISION": "false"
},
"disabled": false,
"autoApprove": []
}
Replace YOUR_HOME
with your actual home directory and add your API keys.
Start the server:
node build/index.js
Parameters:
Parameters:
Parameters:
Parameters:
Here's an example of modifying web page elements during development:
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 demonstrates:
The server supports multiple LLM providers with default configurations:
Enable vision capabilities with the USE_VISION
environment variable:
USE_VISION=true
to enable vision capabilitiesfalse
to optimize performanceThe default timeout is 5 minutes (300000 ms). Modify the TIMEOUT constant in build/index.js
to change this.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "browser-use" '{"command":"node","args":["/home/YOUR_HOME/Documents/Cline/MCP/browser-use-server/build/index.js"],"env":{"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","MODEL":"your_preferred_model","BASE_URL":"your_custom_url","USE_VISION":"false"},"disabled":false,"autoApprove":[]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"browser-use": {
"command": "node",
"args": [
"/home/YOUR_HOME/Documents/Cline/MCP/browser-use-server/build/index.js"
],
"env": {
"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",
"MODEL": "your_preferred_model",
"BASE_URL": "your_custom_url",
"USE_VISION": "false"
},
"disabled": false,
"autoApprove": []
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"browser-use": {
"command": "node",
"args": [
"/home/YOUR_HOME/Documents/Cline/MCP/browser-use-server/build/index.js"
],
"env": {
"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",
"MODEL": "your_preferred_model",
"BASE_URL": "your_custom_url",
"USE_VISION": "false"
},
"disabled": false,
"autoApprove": []
}
}
}
3. Restart Claude Desktop for the changes to take effect