Browser Use MCP server

Integrates with web browsers to enable automated web scraping, form filling, and interaction with web applications.
Back to servers
Provider
Saik0s
Release date
Jan 18, 2025
Language
Python
Stats
592 stars

The browser-use MCP server is a powerful AI-driven browser automation tool that implements the Model Context Protocol (MCP) for natural language browser control and web research. It allows you to automate web tasks using natural language commands and provides both a server implementation for AI assistants and a CLI for direct interaction.

Installation

Basic Setup

  1. Install UV (the Python package installer):

    curl -LsSf https://astral.sh/uv/install.sh | sh
    
  2. Install Playwright browsers (required for automation):

    uvx --from mcp-server-browser-use@latest python -m playwright install
    

Configuration

The server is configured using environment variables. You can provide these variables directly in your system environment or through a .env file.

Key Configuration Variables

  • LLM Provider Settings:

    MCP_LLM_PROVIDER=openai|google|anthropic|azure_openai|mistral|ollama|etc.
    MCP_LLM_MODEL_NAME=gpt-4.1|gemini-2.5-flash-preview-04-17|claude-3.5-haiku|etc.
    MCP_LLM_TEMPERATURE=0.0-2.0
    MCP_LLM_<PROVIDER>_API_KEY=your_api_key_here
    
  • Browser Settings:

    MCP_BROWSER_HEADLESS=true|false
    MCP_BROWSER_WINDOW_WIDTH=1280
    MCP_BROWSER_WINDOW_HEIGHT=1080
    MCP_BROWSER_DISABLE_SECURITY=true|false
    MCP_BROWSER_BINARY_PATH=/path/to/chrome
    MCP_BROWSER_USER_DATA_DIR=/path/to/user/data
    
  • Tool Settings:

    MCP_AGENT_TOOL_USE_VISION=true|false
    MCP_AGENT_TOOL_HISTORY_PATH=/path/to/history
    MCP_RESEARCH_TOOL_SAVE_DIR=/path/to/research
    MCP_RESEARCH_TOOL_MAX_PARALLEL_BROWSERS=3
    

Using With MCP Clients

You can integrate the server with MCP clients like Claude Desktop by adding a server configuration:

Simple Configuration

"mcpServers": {
    "browser-use": {
      "command": "uvx",
      "args": ["mcp-server-browser-use@latest"],
      "env": {
        "MCP_LLM_GOOGLE_API_KEY": "YOUR_KEY_HERE_IF_USING_GOOGLE",
        "MCP_LLM_PROVIDER": "google",
        "MCP_LLM_MODEL_NAME": "gemini-2.5-flash-preview-04-17",
        "MCP_BROWSER_HEADLESS": "true"
      }
    }
}

Advanced Configuration with CDP Connection

To connect to your own browser using Chrome DevTools Protocol:

"mcpServers": {
    "browser-use": {
      "command": "uvx",
      "args": ["mcp-server-browser-use@latest"],
      "env": {
        "MCP_LLM_OPENROUTER_API_KEY": "YOUR_KEY_HERE",
        "MCP_LLM_PROVIDER": "openrouter",
        "MCP_LLM_MODEL_NAME": "anthropic/claude-3.5-haiku",
        "MCP_BROWSER_HEADLESS": "false",
        "MCP_BROWSER_USE_OWN_BROWSER": "true",
        "MCP_BROWSER_CDP_URL": "http://localhost:9222",
        "MCP_AGENT_TOOL_USE_VISION": "true",
        "MCP_RESEARCH_TOOL_SAVE_DIR": "/path/to/your/research"
      }
    }
}

Tools Available Through MCP

The server exposes two primary tools:

run_browser_agent

Executes a browser automation task based on natural language instructions.

Arguments:

  • task (string, required): The primary task or objective.

Example:

Run a task to find the current price of Bitcoin on CoinMarketCap.

run_deep_research

Performs in-depth web research on a topic and generates a report.

Arguments:

  • research_task (string, required): The topic or question for the research.
  • max_parallel_browsers (integer, optional): Overrides environment setting.

Example:

Research the environmental impact of electric vehicles compared to gas vehicles.

Command-line Usage

You can access the functionality directly from the command line:

Browser Agent

mcp-browser-cli run-browser-agent "Go to example.com and find the title." -e .env

Deep Research

mcp-browser-cli run-deep-research "What are the latest advancements in AI-driven browser automation?" --max-parallel-browsers 5 -e .env

Connecting to Your Own Browser

Instead of having the server launch its own browser instance, you can connect to an existing Chrome/Chromium browser:

  1. Launch Chrome with remote debugging enabled:

    google-chrome --remote-debugging-port=9222
    
  2. Configure the following environment variables:

    MCP_BROWSER_USE_OWN_BROWSER=true
    MCP_BROWSER_CDP_URL=http://localhost:9222
    

Troubleshooting

  • Configuration Errors: Ensure all mandatory environment variables are set correctly.
  • CDP Connection Issues: Verify Chrome was launched with remote debugging and the port matches your configuration.
  • API Errors: Double-check your API keys and endpoints.
  • File/Path Issues: Ensure that paths exist and have proper write permissions.
  • Logging: Set MCP_SERVER_LOGGING_LEVEL=DEBUG for detailed logs.

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