Browser Use MCP server

Enables AI assistants to interact with web browsers through a FastAPI server for web browsing, content extraction, and automation tasks with configurable LLM providers and browser modes.
Back to servers
Provider
Deploya Labs
Release date
Mar 17, 2025
Language
Python
Package
Stats
1 star

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.

Installation Prerequisites

  • Python 3.11 or higher
  • uv (fast Python package installer)
  • Chrome/Chromium browser

Configuration

For Claude Desktop

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"
      }
    }
}

For Local Development

"browser-use": {
  "command": "uv",
  "args": [
    "--directory",
    "/path/to/mcp-browser-use",
    "run",
    "mcp-server-browser-use"
  ],
  "env": {
    // Environment variables as shown above
  }
}

Key Features

  • MCP Integration: Full protocol implementation for AI agent communication
  • Browser Automation: Navigate pages, fill forms, and interact with elements
  • Visual Understanding: Analyze screenshots and perform vision-based interactions
  • State Persistence: Maintain browser sessions between tasks
  • Multi-LLM Support: Compatible with OpenAI, Anthropic, Azure, DeepSeek, and others

LLM Provider Configuration

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)

Additional Configuration Options

  • Set MCP_TEMPERATURE to control randomness (default: 0.3)
  • Specify model with MCP_MODEL_NAME
  • Enable visual capabilities with MCP_USE_VISION=true
  • Control browser window size with BROWSER_WINDOW_WIDTH and BROWSER_WINDOW_HEIGHT
  • Set BROWSER_HEADLESS to true for headless operation or false to see the browser

Troubleshooting

  • Browser Conflicts: Close all Chrome instances before starting the server
  • API Errors: Verify API keys in environment variables match your LLM provider
  • Vision Problems: Ensure MCP_USE_VISION=true for screenshot analysis
  • Browser Connectivity: Check that CHROME_DEBUGGING_PORT and CHROME_DEBUGGING_HOST are correct

For 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 sessions

How to add this MCP server to Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later