Browser-Use MCP
Browser-Use automates browser tasks with stealth, scalable agents powered by ChatBrowserUse LLM for fast, accurate results.
How to Install and Use Browser-Use MCP
If you want to automate browser tasks easily, Browser-Use MCP is a great tool to try. It helps you control a browser using AI to do jobs like filling forms, shopping, or looking up information. Here’s a simple guide to get Browser-Use MCP up and running and see it in action.
Setting Up Your Environment
Before using Browser-Use MCP, you need to prepare your computer. This is the first step to make sure everything runs smoothly.
Start by creating your environment with a tool called “uv” which works with Python 3.11 or higher. Open your terminal or command line and run:
uv init
This command gets everything ready for installing Browser-Use MCP and other tools you’ll need.
Installing Browser-Use MCP
Once your environment is ready, you can install the Browser-Use package.
Run these two commands in your terminal. They make sure you have the latest version because Browser-Use updates every day:
uv add browser-use
uv sync
Now Browser-Use MCP is installed and ready to use.
Adding Your API Key
Browser-Use MCP requires an API key for access. This key connects your computer to the Browser-Use Cloud service.
Go to Browser Use Cloud and create your API key. New users get $10 in free credits to start.
After you get your key, add it to a file called .env in your project folder like this:
# .env
BROWSER_USE_API_KEY=your-key
Replace your-key with the actual key you copied. This step is important for the tool to work.
Installing Chromium Browser
Browser-Use MCP needs a browser to control. You can install the Chromium browser by running this command:
uvx browser-use install
This sets up the actual browser software that Browser-Use MCP will automate.
Running Your First Agent
Now that you have everything installed, let’s run your first simple script with Browser-Use MCP.
Here’s the example code you can use:
from browser_use import Agent, Browser, ChatBrowserUse
import asyncio
async def example():
browser = Browser(
# use_cloud=True, # Uncomment this line 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())
print(history)
This script creates a browser and an AI agent that will look up how many stars the Browser-Use GitHub repo has. You can run it in your Python environment.
Extra Tips and Examples
Browser-Use MCP also offers ready-to-run templates to get started faster. You can generate one by typing:
uvx browser-use init --template default
This creates a file with a working example. Other templates like advanced or tools are also available for more features.
If you want to explore more sample projects, check the official examples page here.
By following these steps, you’ll quickly install Browser-Use MCP and start automating browser tasks in no time! It’s a powerful yet easy-to-use tool for both beginners and developers.