The MCP server for browser-use enables AI-driven browser automation by implementing the Model Context Protocol, allowing natural language control of web browsers. It provides capabilities for page navigation, form filling, and visual interaction with web elements.
Set up the MCP server in Claude's configuration file:
MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
"mcpServers": {
"browser-use": {
"command": "uvx",
"args": [
"mcp-server-browser-use",
],
"env": {
"OPENROUTER_API_KEY": "",
"OPENROUTER_ENDPOINT": "https://openrouter.ai/api/v1",
"OPENAI_ENDPOINT": "https://api.openai.com/v1",
"OPENAI_API_KEY": "",
"ANTHROPIC_ENDPOINT": "https://api.anthropic.com",
"ANTHROPIC_API_KEY": "",
"GOOGLE_API_KEY": "",
"AZURE_OPENAI_ENDPOINT": "",
"AZURE_OPENAI_API_KEY": "",
"DEEPSEEK_ENDPOINT": "https://api.deepseek.com",
"DEEPSEEK_API_KEY": "",
"MISTRAL_API_KEY": "",
"MISTRAL_ENDPOINT": "https://api.mistral.ai/v1",
"OLLAMA_ENDPOINT": "http://localhost:11434",
"ANONYMIZED_TELEMETRY": "true",
"BROWSER_USE_LOGGING_LEVEL": "info",
"CHROME_PATH": "",
"CHROME_USER_DATA": "",
"CHROME_DEBUGGING_PORT": "9222",
"CHROME_DEBUGGING_HOST": "localhost",
"CHROME_PERSISTENT_SESSION": "false",
"BROWSER_HEADLESS": "false",
"BROWSER_DISABLE_SECURITY": "false",
"BROWSER_WINDOW_WIDTH": "1280",
"BROWSER_WINDOW_HEIGHT": "720",
"BROWSER_TRACE_PATH": "trace.json",
"BROWSER_RECORDING_PATH": "recording.mp4",
"RESOLUTION": "1920x1080x24",
"RESOLUTION_WIDTH": "1920",
"RESOLUTION_HEIGHT": "1080",
"VNC_PASSWORD": "youvncpassword",
"MCP_MODEL_PROVIDER": "anthropic",
"MCP_MODEL_NAME": "claude-3-5-sonnet-20241022",
"MCP_TEMPERATURE": "0.3",
"MCP_MAX_STEPS": "30",
"MCP_USE_VISION": "true",
"MCP_MAX_ACTIONS_PER_STEP": "5",
"MCP_TOOL_CALL_IN_CONTENT": "true"
}
}
}
"browser-use": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-browser-use",
"run",
"mcp-server-browser-use"
],
"env": {
// Environment variables as shown above
}
}
The server can be configured with different LLM providers using these environment variables:
| Provider | Value | Required Env Variables |
|---|---|---|
| Anthropic | anthropic |
ANTHROPIC_API_KEYANTHROPIC_ENDPOINT (optional) |
| OpenAI | openai |
OPENAI_API_KEYOPENAI_ENDPOINT (optional) |
| Azure OpenAI | azure_openai |
AZURE_OPENAI_API_KEYAZURE_OPENAI_ENDPOINT |
| DeepSeek | deepseek |
DEEPSEEK_API_KEYDEEPSEEK_ENDPOINT (optional) |
| Gemini | gemini |
GOOGLE_API_KEY |
| Mistral | mistral |
MISTRAL_API_KEYMISTRAL_ENDPOINT (optional) |
| Ollama | ollama |
OLLAMA_ENDPOINT (optional, defaults to localhost:11434) |
| OpenRouter | openrouter |
OPENROUTER_API_KEYOPENROUTER_ENDPOINT (optional) |
MCP_TEMPERATURE to control randomness (default: 0.3)MCP_MODEL_NAMEMCP_USE_VISION=trueBROWSER_WINDOW_WIDTH and BROWSER_WINDOW_HEIGHTBROWSER_HEADLESS to true for headless operation or false to see the browserMCP_USE_VISION=true for screenshot analysisCHROME_DEBUGGING_PORT and CHROME_DEBUGGING_HOST are correctFor Chrome configuration, you may need to specify:
CHROME_PATH: Path to Chrome executable (if not in system PATH)CHROME_USER_DATA: Path to Chrome user data directory (for profiles)CHROME_PERSISTENT_SESSION: Set to true to maintain state between sessionsTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "browser-use" '{"command":"uvx","args":["mcp-server-browser-use"],"env":{"OPENROUTER_API_KEY":"","OPENROUTER_ENDPOINT":"https://openrouter.ai/api/v1","OPENAI_ENDPOINT":"https://api.openai.com/v1","OPENAI_API_KEY":"","ANTHROPIC_ENDPOINT":"https://api.anthropic.com","ANTHROPIC_API_KEY":"","GOOGLE_API_KEY":"","AZURE_OPENAI_ENDPOINT":"","AZURE_OPENAI_API_KEY":"","DEEPSEEK_ENDPOINT":"https://api.deepseek.com","DEEPSEEK_API_KEY":"","MISTRAL_API_KEY":"","MISTRAL_ENDPOINT":"https://api.mistral.ai/v1","OLLAMA_ENDPOINT":"http://localhost:11434","ANONYMIZED_TELEMETRY":"true","BROWSER_USE_LOGGING_LEVEL":"info","CHROME_PATH":"","CHROME_USER_DATA":"","CHROME_DEBUGGING_PORT":"9222","CHROME_DEBUGGING_HOST":"localhost","CHROME_PERSISTENT_SESSION":"false","BROWSER_HEADLESS":"false","BROWSER_DISABLE_SECURITY":"false","BROWSER_WINDOW_WIDTH":"1280","BROWSER_WINDOW_HEIGHT":"720","BROWSER_TRACE_PATH":"trace.json","BROWSER_RECORDING_PATH":"recording.mp4","RESOLUTION":"1920x1080x24","RESOLUTION_WIDTH":"1920","RESOLUTION_HEIGHT":"1080","VNC_PASSWORD":"youvncpassword","MCP_MODEL_PROVIDER":"anthropic","MCP_MODEL_NAME":"claude-3-5-sonnet-20241022","MCP_TEMPERATURE":"0.3","MCP_MAX_STEPS":"30","MCP_USE_VISION":"true","MCP_MAX_ACTIONS_PER_STEP":"5","MCP_TOOL_CALL_IN_CONTENT":"true"}}'
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": "uvx",
"args": [
"mcp-server-browser-use"
],
"env": {
"OPENROUTER_API_KEY": "",
"OPENROUTER_ENDPOINT": "https://openrouter.ai/api/v1",
"OPENAI_ENDPOINT": "https://api.openai.com/v1",
"OPENAI_API_KEY": "",
"ANTHROPIC_ENDPOINT": "https://api.anthropic.com",
"ANTHROPIC_API_KEY": "",
"GOOGLE_API_KEY": "",
"AZURE_OPENAI_ENDPOINT": "",
"AZURE_OPENAI_API_KEY": "",
"DEEPSEEK_ENDPOINT": "https://api.deepseek.com",
"DEEPSEEK_API_KEY": "",
"MISTRAL_API_KEY": "",
"MISTRAL_ENDPOINT": "https://api.mistral.ai/v1",
"OLLAMA_ENDPOINT": "http://localhost:11434",
"ANONYMIZED_TELEMETRY": "true",
"BROWSER_USE_LOGGING_LEVEL": "info",
"CHROME_PATH": "",
"CHROME_USER_DATA": "",
"CHROME_DEBUGGING_PORT": "9222",
"CHROME_DEBUGGING_HOST": "localhost",
"CHROME_PERSISTENT_SESSION": "false",
"BROWSER_HEADLESS": "false",
"BROWSER_DISABLE_SECURITY": "false",
"BROWSER_WINDOW_WIDTH": "1280",
"BROWSER_WINDOW_HEIGHT": "720",
"BROWSER_TRACE_PATH": "trace.json",
"BROWSER_RECORDING_PATH": "recording.mp4",
"RESOLUTION": "1920x1080x24",
"RESOLUTION_WIDTH": "1920",
"RESOLUTION_HEIGHT": "1080",
"VNC_PASSWORD": "youvncpassword",
"MCP_MODEL_PROVIDER": "anthropic",
"MCP_MODEL_NAME": "claude-3-5-sonnet-20241022",
"MCP_TEMPERATURE": "0.3",
"MCP_MAX_STEPS": "30",
"MCP_USE_VISION": "true",
"MCP_MAX_ACTIONS_PER_STEP": "5",
"MCP_TOOL_CALL_IN_CONTENT": "true"
}
}
}
}
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.json2. Add this to your configuration file:
{
"mcpServers": {
"browser-use": {
"command": "uvx",
"args": [
"mcp-server-browser-use"
],
"env": {
"OPENROUTER_API_KEY": "",
"OPENROUTER_ENDPOINT": "https://openrouter.ai/api/v1",
"OPENAI_ENDPOINT": "https://api.openai.com/v1",
"OPENAI_API_KEY": "",
"ANTHROPIC_ENDPOINT": "https://api.anthropic.com",
"ANTHROPIC_API_KEY": "",
"GOOGLE_API_KEY": "",
"AZURE_OPENAI_ENDPOINT": "",
"AZURE_OPENAI_API_KEY": "",
"DEEPSEEK_ENDPOINT": "https://api.deepseek.com",
"DEEPSEEK_API_KEY": "",
"MISTRAL_API_KEY": "",
"MISTRAL_ENDPOINT": "https://api.mistral.ai/v1",
"OLLAMA_ENDPOINT": "http://localhost:11434",
"ANONYMIZED_TELEMETRY": "true",
"BROWSER_USE_LOGGING_LEVEL": "info",
"CHROME_PATH": "",
"CHROME_USER_DATA": "",
"CHROME_DEBUGGING_PORT": "9222",
"CHROME_DEBUGGING_HOST": "localhost",
"CHROME_PERSISTENT_SESSION": "false",
"BROWSER_HEADLESS": "false",
"BROWSER_DISABLE_SECURITY": "false",
"BROWSER_WINDOW_WIDTH": "1280",
"BROWSER_WINDOW_HEIGHT": "720",
"BROWSER_TRACE_PATH": "trace.json",
"BROWSER_RECORDING_PATH": "recording.mp4",
"RESOLUTION": "1920x1080x24",
"RESOLUTION_WIDTH": "1920",
"RESOLUTION_HEIGHT": "1080",
"VNC_PASSWORD": "youvncpassword",
"MCP_MODEL_PROVIDER": "anthropic",
"MCP_MODEL_NAME": "claude-3-5-sonnet-20241022",
"MCP_TEMPERATURE": "0.3",
"MCP_MAX_STEPS": "30",
"MCP_USE_VISION": "true",
"MCP_MAX_ACTIONS_PER_STEP": "5",
"MCP_TOOL_CALL_IN_CONTENT": "true"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect