Browser Use MCP server

Enables LLMs, agents, and apps to access, search, and extract web data in real-time using the browser-use.com API.
Back to servers
Setup instructions
Provider
Browser Use
Release date
Jul 28, 2025
Language
JavaScript
Stats
68.6K stars

Browser-Use is a powerful tool that enables AI agents to control web browsers, automate tasks, and interact with websites just like a human would. It provides a seamless way to create AI agents that can navigate the web, fill forms, extract information, and perform complex sequences of actions.

Installation

To install Browser-Use, you'll need Python 3.11 or higher:

pip install browser-use

If you don't already have Chrome or Chromium installed, you can download the latest Chromium using playwright's install shortcut:

uvx playwright install chromium --with-deps --no-shell

Getting Started

Basic Setup

First, create a .env file in your project directory and add your API key:

OPENAI_API_KEY=your_openai_api_key_here

Creating a Simple Agent

Here's a basic example to create an agent that finds the number of stars on the Browser-Use repository:

import asyncio
from dotenv import load_dotenv
load_dotenv()
from browser_use import Agent, ChatOpenAI

async def main():
    agent = Agent(
        task="Find the number of stars of the browser-use repo",
        llm=ChatOpenAI(model="gpt-4.1-mini"),
    )
    await agent.run()

asyncio.run(main())

Advanced Usage

Using MCP Server with Claude Desktop

Browser-Use supports the Model Context Protocol (MCP), allowing integration with Claude Desktop and other MCP-compatible clients.

Add Browser-Use to your Claude Desktop configuration:

{
  "mcpServers": {
    "browser-use": {
      "command": "uvx",
      "args": ["browser-use[cli]", "--mcp"],
      "env": {
        "OPENAI_API_KEY": "sk-..."
      }
    }
  }
}

Connecting to External MCP Servers

You can extend your agent's capabilities by connecting to multiple external MCP servers:

import asyncio
from browser_use import Agent, Controller, ChatOpenAI
from browser_use.mcp.client import MCPClient

async def main():
    # Initialize controller
    controller = Controller()

    # Connect to multiple MCP servers
    filesystem_client = MCPClient(
        server_name="filesystem",
        command="npx",
        args=["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/documents"]
    )

    github_client = MCPClient(
        server_name="github",
        command="npx",
        args=["-y", "@modelcontextprotocol/server-github"],
        env={"GITHUB_TOKEN": "your-github-token"}
    )

    # Connect and register tools from both servers
    await filesystem_client.connect()
    await filesystem_client.register_to_controller(controller)

    await github_client.connect()
    await github_client.register_to_controller(controller)

    # Create agent with MCP-enabled controller
    agent = Agent(
        task="Find the latest pdf report in my documents and create a GitHub issue about it",
        llm=ChatOpenAI(model="gpt-4.1-mini"),
        controller=controller  # Controller has tools from both MCP servers
    )

    # Run the agent
    await agent.run()

    # Cleanup
    await filesystem_client.disconnect()
    await github_client.disconnect()

asyncio.run(main())

Example Use Cases

Browser-Use can handle various automation tasks, such as:

  • Shopping: Adding items to cart and checking out
  • Professional networking: Adding LinkedIn followers to Salesforce leads
  • Job hunting: Finding and applying to jobs based on your CV
  • Document creation: Writing and saving Google Docs
  • Research: Scraping data from websites and saving results

For more detailed examples and inspiration, you can check out the examples folder in the repository or visit the official documentation.

Cloud Option

If you prefer to skip the local setup, you can use the Browser-Use Cloud for faster, scalable, and stealth-enabled browser automation.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "browser-use" '{"command":"uvx","args":["browser-use[cli]","--mcp"],"env":{"OPENAI_API_KEY":"sk-..."}}'

See the official Claude Code MCP documentation for more details.

For 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 > 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": [
                "browser-use[cli]",
                "--mcp"
            ],
            "env": {
                "OPENAI_API_KEY": "sk-..."
            }
        }
    }
}

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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "browser-use": {
            "command": "uvx",
            "args": [
                "browser-use[cli]",
                "--mcp"
            ],
            "env": {
                "OPENAI_API_KEY": "sk-..."
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

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