browser-use is both an executable binary that can be run, and a library that can be used in Rust programs.
Installing the mcp-server executable
Assuming you have Rust/Cargo installed , run this command in a terminal:
cargo install browser-use
It will make the mcp-server command available in your PATH if you've allowed the PATH to be modified when installing Rust . cargo uninstall browser-use uninstalls.
Adding browser_use library as a dependency
Run this command in a terminal, in your project's directory:
cargo add browser-use
To add it manually, edit your project's Cargo.toml file and add to the [dependencies] section:
browser-use = "0.2.3"
The browser_use library will be automatically available globally.
Read the browser_use library documentation .
Back to the crate overview .
Readme
browser-use
中文文档
A lightweight Rust library for browser automation via Chrome DevTools Protocol (CDP).
✨ Highlights
Zero Node.js dependency - Pure Rust implementation directly controlling browsers via CDP
Lightweight & Fast - No heavy runtime, minimal overhead
MCP Integration - Built-in Model Context Protocol server for AI-driven automation
Simple API - Easy-to-use tools for common browser operations
Installation
Add to your Cargo.toml :
[ dependencies ]
browser-use = " 0.1.0"
Quick Start
use browser_use:: browser:: BrowserSession;
// Launch browser and navigate
let session = BrowserSession:: launch( Default :: default( ) ) ? ;
session. navigate ( " https://example.com" , None ) ? ;
// Extract DOM with indexed interactive elements
let dom = session. extract_dom ( ) ? ;
MCP Server
Run the built-in MCP server for AI-driven automation:
# Headless mode
cargo run --bin mcp-server
# Visible browser
cargo run --bin mcp-server -- --headed
Features
Navigate, click, input, screenshot, extract content
DOM extraction with indexed interactive elements
CSS selector or numeric index-based element targeting
Thread-safe browser session management
Requirements
Rust 1.70+
Chrome or Chromium installed
Acknowledgments
This project was inspired by and references agent-infra/mcp-server-browser .
License
MIT