# Browser Use — AI Agent Browser Automation > Let AI agents control web browsers with natural language. Browser Use provides vision-based element detection, multi-tab support, and works with any LLM provider. ## Install Merge the JSON below into your `.mcp.json`: ## Quick Use ```bash pip install browser-use playwright install ``` ```python from browser_use import Agent from langchain_anthropic import ChatAnthropic agent = Agent( task="Go to GitHub trending and find the top Python repo", llm=ChatAnthropic(model="claude-sonnet-4-20250514"), ) result = await agent.run() print(result) ``` ## What is Browser Use? Browser Use is a Python library that gives AI agents the ability to control web browsers. It uses vision-based element detection to understand page layout, supports multi-tab browsing, and works with any LLM — enabling agents to complete real web tasks autonomously. **Answer-Ready**: Browser Use is an AI agent browser automation library that enables LLMs to control web browsers with vision-based element detection, multi-tab support, and natural language task execution. 50k+ GitHub stars. **Best for**: AI agent developers who need web browsing capabilities. **Works with**: Claude, GPT-4o, Gemini, any LangChain-compatible model. **Setup time**: Under 3 minutes. ## Core Features ### 1. Vision-Based Interaction Browser Use screenshots the page and identifies interactive elements: ```python agent = Agent( task="Search for 'AI tools' on Google and click the first result", llm=llm, ) # Agent sees the page, identifies search box, types, clicks results ``` ### 2. Multi-Tab Support ```python agent = Agent( task="Open three tabs: GitHub, HN, and Reddit. Find the top AI post on each.", llm=llm, ) ``` ### 3. Custom Actions ```python from browser_use import Agent, Controller controller = Controller() @controller.action("Save data to file") def save_data(data: str, filename: str): with open(filename, 'w') as f: f.write(data) agent = Agent( task="Scrape product prices and save to prices.csv", llm=llm, controller=controller, ) ``` ### 4. Persistent Sessions ```python from browser_use import BrowserConfig config = BrowserConfig( headless=False, # Watch it work keep_open=True, # Keep browser open after task cookies_file="cookies.json", # Persist login ) agent = Agent(task="...", llm=llm, browser_config=config) ``` ### 5. MCP Server Mode ```json { "mcpServers": { "browser-use": { "command": "uvx", "args": ["browser-use-mcp-server"] } } } ``` Use Browser Use as an MCP server in Claude Code or other MCP-compatible tools. ## Use Cases | Use Case | Example | |----------|---------| | Research | Gather data from multiple websites | | Testing | E2E test web applications | | Automation | Fill forms, submit applications | | Monitoring | Check prices, track changes | ## FAQ **Q: How does it compare to Playwright MCP?** A: Playwright MCP provides low-level browser control. Browser Use adds AI vision and autonomous task execution on top of Playwright. **Q: Does it work with Claude Code?** A: Yes, via MCP server mode. Install the browser-use-mcp-server package. **Q: Can it handle login-protected pages?** A: Yes, with persistent cookies or by letting the agent perform the login flow. ## Source & Thanks > Created by [Browser Use Team](https://github.com/browser-use). Licensed under MIT. > > [browser-use/browser-use](https://github.com/browser-use/browser-use) — 50k+ stars ## 快速使用 ```bash pip install browser-use playwright install ``` 三行代码让 AI 代理控制浏览器完成网页任务。 ## 什么是 Browser Use? Browser Use 是 Python 库,让 AI 代理控制网页浏览器。使用视觉检测理解页面布局,支持多标签页浏览,兼容任何 LLM。 **一句话总结**:Browser Use 是 AI 代理浏览器自动化库,支持视觉元素检测、多标签页和自然语言任务执行,5 万+ GitHub stars。 **适合人群**:需要网页浏览能力的 AI 代理开发者。**支持模型**:Claude、GPT-4o、Gemini。 ## 核心功能 ### 1. 视觉交互 截图页面,识别可交互元素,自主操作。 ### 2. 多标签页 同时打开多个标签页并行工作。 ### 3. 自定义动作 注册自定义函数,代理自动调用。 ### 4. MCP 服务器模式 作为 MCP Server 接入 Claude Code 等工具。 ## 常见问题 **Q: 和 Playwright MCP 比较?** A: Playwright MCP 是低级浏览器控制,Browser Use 增加了 AI 视觉和自主任务执行。 **Q: 支持 Claude Code 吗?** A: 支持,通过 MCP 服务器模式。 ## 来源与致谢 > [browser-use/browser-use](https://github.com/browser-use/browser-use) — 50k+ stars, MIT --- Source: https://tokrepo.com/en/workflows/3d04e209-6c1a-4608-8e43-95b2cd7316d5 Author: MCP Hub