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
73.7K stars

Browser-Use provides an AI-powered browser automation tool that lets you create agents to perform web-based tasks. This server allows you to automate browser interactions through a simple API, making it perfect for web scraping, form filling, and other browser-based workflows.

Installation

Environment Setup

First, create a Python environment using uv (requires Python 3.11 or higher):

uv init

Install the Package

Install the Browser-Use package using uv:

uv add browser-use
uv sync

API Key Configuration

Get your API key from Browser Use Cloud (new signups receive $10 free credits) and add it to your .env file:

# .env
BROWSER_USE_API_KEY=your-key

Install Chromium

Install the required Chromium browser:

uvx browser-use install

Basic Usage

Here's a simple example to get started with Browser-Use:

from browser_use import Agent, Browser, ChatBrowserUse
import asyncio

async def example():
    browser = Browser(
        # use_cloud=True,  # Uncomment to use a stealth browser on Browser Use Cloud
    )

    llm = ChatBrowserUse()

    agent = Agent(
        task="Find the number of stars of the browser-use repo",
        llm=llm,
        browser=browser,
    )

    history = await agent.run()
    return history

if __name__ == "__main__":
    history = asyncio.run(example())

Deployment with Sandboxes

Browser-Use provides a sandbox deployment mode that handles agents, browsers, persistence, authentication, and LLMs:

from browser_use import Browser, sandbox, ChatBrowserUse
from browser_use.agent.service import Agent
import asyncio

@sandbox()
async def my_task(browser: Browser):
    agent = Agent(task="Find the top HN post", browser=browser, llm=ChatBrowserUse())
    await agent.run()

# Just call it like any async function
asyncio.run(my_task())

Quick Templates

Generate a ready-to-run template to start even faster:

uvx browser-use init --template default

Available templates:

  • default - Minimal setup to get started quickly
  • advanced - All configuration options with detailed comments
  • tools - Examples of custom tools and extending the agent

Specify a custom output path:

uvx browser-use init --template default --output my_agent.py

Using Custom Tools

You can extend the agent's capabilities with custom tools:

from browser_use import Tools

tools = Tools()

@tools.action(description='Description of what this tool does.')
def custom_tool(param: str) -> str:
    return f"Result: {param}"

agent = Agent(
    task="Your task",
    llm=llm,
    browser=browser,
    tools=tools,
)

Handling Authentication

For sites requiring login, you can:

  1. Use real browser profiles to leverage your existing Chrome profile with saved logins
  2. Use temporary accounts with an email inbox
  3. Sync your auth profile with the remote browser

Advanced Features

CAPTCHA Handling

For handling CAPTCHAs, consider using Browser Use Cloud which provides stealth browsers designed to avoid detection and CAPTCHA challenges.

Production Deployment

For production use cases, Browser Use Cloud API handles:

  • Scalable browser infrastructure
  • Memory management
  • Proxy rotation
  • Stealth browser fingerprinting
  • High-performance parallel execution

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