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_KEY ANTHROPIC_ENDPOINT (optional) |
OpenAI | openai |
OPENAI_API_KEY OPENAI_ENDPOINT (optional) |
Azure OpenAI | azure_openai |
AZURE_OPENAI_API_KEY AZURE_OPENAI_ENDPOINT |
DeepSeek | deepseek |
DEEPSEEK_API_KEY DEEPSEEK_ENDPOINT (optional) |
Gemini | gemini |
GOOGLE_API_KEY |
Mistral | mistral |
MISTRAL_API_KEY MISTRAL_ENDPOINT (optional) |
Ollama | ollama |
OLLAMA_ENDPOINT (optional, defaults to localhost:11434) |
OpenRouter | openrouter |
OPENROUTER_API_KEY OPENROUTER_ENDPOINT (optional) |
MCP_TEMPERATURE
to control randomness (default: 0.3)MCP_MODEL_NAME
MCP_USE_VISION=true
BROWSER_WINDOW_WIDTH
and BROWSER_WINDOW_HEIGHT
BROWSER_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 sessionsThere 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 > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.