Control web browsers with AI using MCP server for automation and real-time VNC streaming
Browser-use-MCP-Server is an advanced MCP server designed to empower AI applications, such as Claude Desktop, Continue, Cursor, and others, to control web browsers through a standardized protocol. This server leverages the versatile browser-control framework from browser-use
and integrates with Model Context Protocol (MCP) clients for seamless communication between AI applications and web browsers. By adopting MCP, developers can ensure compatibility across various AI tools while maintaining robust performance.
Browser-use-MCP-Server offers a range of powerful features tailored to meet the demands of AI application development:
Dual Transport Protocols: Supports both Server-Sent Events (SSE) and stdio modes, enabling clients to communicate flexibly based on their requirements.
VNC Streaming: Provides real-time visualization of browser actions for debugging and monitoring purposes, ensuring transparency in complex operations.
Async Tasks Execution: Allows asynchronous execution of tasks within web browsers, improving efficiency and responsiveness during AI-driven interactions.
Envoy Compatibility: Integrates seamlessly with mcp-proxy
, facilitating stdio mode communication between the server and clients.
Customizable Environments: Enables users to define custom environments through .env
files for setting up specific configurations like API keys and browser paths.
The architecture of Browser-use-MCP-Server is meticulously designed to align with MCP standards, ensuring robust and scalable integration with various AI clients. The core protocol flow diagram outlines the communication process between an AI application, a server, and data sources/tools:
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
This protocol flow demonstrates how data and instructions are transmitted from an AI application to a web browser, facilitated by the MCP server. Key components include:
To get started, follow these steps to install the necessary dependencies and set up your environment:
Prerequisites:
Environment Variables Setup:
echo "OPENAI_API_KEY=your-api-key" > .env
echo "CHROME_PATH=optional/path/to/chrome" >> .env
echo "PATIENT=false" >> .env # Set to true for waiting on API calls
Install Dependencies:
uv sync
uv pip install playwright
uv run playwright install --with-deps --no-shell chromium
Run the Server:
uv run server --port 8000
uv build
uv tool uninstall browser-use-mcp-server 2>/dev/null || true
uv tool install dist/browser_use_mcp_server-*.whl
# 2. Run with stdio transport
browser-use-mcp-server run server --port 8000 --stdio --proxy-port 9000
SSE Mode Client Configuration:
{
"mcpServers": {
"browser-use-mcp-server": {
"url": "http://localhost:8000/sse"
}
}
}
stdio Mode Client Configuration:
{
"mcpServers": {
"browser-server": {
"command": "browser-use-mcp-server",
"args": [
"run",
"server",
"--port",
"8000",
"--stdio",
"--proxy-port",
"9000"
],
"env": {
"OPENAI_API_KEY": "your-api-key"
}
}
}
}
Config Paths Across Different Clients:
./.cursor/mcp.json
~/.codeium/windsurf/mcp_config.json
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
When integrating with Claude Desktop, users can request complex web interactions, such as navigating to a specific URL and extracting data. Below is an example of how this might work:
As Claude, open https://news.ycombinator.com and provide the top-ranked article.
This command utilizes the Browser-use-MCP-Server to trigger actions in Claude Desktop, ensuring accurate and efficient execution.
For tasks requiring background processing, Continue can leverage the async capabilities of Browser-use-MCP-Server. For example:
Log into your email client at https://mail.google.com/, check for unread messages, and mark them as read asynchronously.
This operation would initiate a browser session via the MCP server, perform necessary actions, and return to an idle state until all tasks are completed.
The table below outlines compatibility between different AI clients and their support within Browser-use-MCP-Server:
MCP Client | Resources | Tools | Prompts |
---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ |
Continue | ✅ | ✅ | ✅ |
Cursor | ❌ | ✅ | ❌ |
This section details the performance and compatibility of Browser-use-MCP-Server across various environments:
{
"mcpServers": {
"browser-use-mcp-server": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-browser-use"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
To develop and test the package locally:
Build a distributable wheel:
uv build
Install it as a global tool:
uv tool uninstall browser-use-mcp-server 2>/dev/null || true
uv tool install dist/browser_use_mcp_server-*.whl
# Set your OpenAI API key for the current session:
export OPENAI_API_KEY=your-api-key-here
# Run from any directory:
Browser-use-MCP-Server run server --port 8000 --stdio --proxy-port 9000
Implement environment security checks by verifying API keys and enabling patient mode:
echo "PATIENT=false" > .env # Set to true for waiting on API calls before proceeding.
Monitor server connections using SSL/TLS encryption.
MCP Client | Resources | Tools | Prompts |
---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ |
Continue | ✅ | ✅ | ✅ |
Cursor | ❌ | ✅ | ❌ |
{
"mcpServers": {
"[server-name]": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-[name]"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
This comprehensive documentation positions Browser-use-MCP-Server as a robust solution for AI application development, ensuring seamless integration and efficient web browser control.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration