Cover image
Try Now
2025-03-25

3 years

Works with Finder

1

Github Watches

1

Github Forks

1

Github Stars

Browser Use MCP

A powerful browser automation and control system that enables AI agents to interact with web browsers through the Model Context Protocol (MCP). This implementation is specifically designed to work with Ollama local models, providing a secure and efficient way to automate browser interactions using locally-hosted AI models.

Features

  • MCP Integration: Full support for Model Context Protocol, enabling structured communication between AI models and browser automation
  • Ollama Model Support: Optimized for local AI models running through Ollama
  • Browser Control: Direct browser manipulation and automation with screenshot capabilities
  • DOM Management: Advanced DOM tree building and processing
  • AI Agent System: Sophisticated message management and service orchestration
  • Telemetry: Built-in system monitoring and performance tracking
  • Extensible Architecture: Modular design supporting custom actions and features

Prerequisites

  • Ollama installed and running locally
  • Python 3.8 or higher
  • pip package manager

Installation

# Clone the repository
git clone https://github.com/yourusername/browser-use-mcp.git
cd browser-use-mcp

# Install dependencies
pip install -r requirements.txt

# Configure Ollama (ensure Ollama is running)
ollama pull qwen2.5-coder:7b # or your preferred model

Quick Start

from browser_use.agent import Agent
from browser_use.browser import Browser
from browser_use.mcp import MCPServer

# Initialize MCP server and Ollama model
mcp_server = MCPServer(model="qwen2.5-coder:7b")

# Initialize browser and agent
browser = Browser()
agent = Agent(browser, mcp_server)

# Execute browser actions through MCP
agent.execute("Navigate to https://example.com and click the first button")

Project Structure

browser_use/
├── agent/              # AI agent coordination
├── browser/           # Browser control and automation
├── dom/               # DOM tree management
├── controller/        # System coordination
└── telemetry/        # System monitoring

Documentation

Comprehensive documentation is available in the .context directory:

  • Project overview and goals in .context/index.md
  • System architecture in .context/docs/architecture.md
  • System flow diagrams in .context/diagrams/system-flow.md

Using with MCP Clients

Claude Desktop Integration

To use browser-use-mcp with Claude Desktop:

  1. Add the MCP server configuration to Claude Desktop's settings (claude_desktop_config.json):
{
  "mcpServers": {
    "browser-use": {
      "command": "/path/to/.venv/bin/python",
      "args": [
        "/path/to/server.py"
      ]
    }
  }
}
  1. Restart Claude Desktop to load the new MCP server

  2. The browser control tools will now be available to Claude through the MCP protocol:

    • browser_action: Control browser interactions
    • read_dom: Access page DOM information
    • get_screenshot: Capture browser state

Other MCP Clients

For other MCP-compatible clients, configure the server using these parameters:

  • Command: python
  • Arguments: ["-m", "browser_use.mcp_server"]
  • Environment Variables:
    • OLLAMA_HOST: Ollama API host (default: http://localhost:11434)
    • BROWSER_HEADLESS: Run browser in headless mode (default: false)
    • SCREENSHOT_DIR: Directory for saving screenshots (default: ./screenshots)

Examples

Check out the examples/ directory for various use cases:

  • Simple browser automation
  • Custom function integration
  • Multi-tab handling
  • Parallel agent operations
  • MCP client integration examples
  • And more!

Testing

# Run all tests
pytest

# Run specific test file
pytest tests/test_browser.py

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Lists Tailwind CSS classes in monospaced font

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

    Reviews

    2 (1)
    Avatar
    user_7CMVa0SI
    2025-04-18

    As a dedicated user of mcp-server-browser-use-ollama, I highly recommend it for its seamless integration and incredible performance. Developed by Cam10001110101, this tool has significantly optimized my server browsing experience. The intuitive design coupled with robust functionality makes it a must-have for anyone in need of efficient server management. Check it out on GitHub today!