BrowserTools MCP Server
April 1, 2025 ยท View on GitHub
A Model Context Protocol server for browser interactions. This server allows Claude to interact with web browsers for debugging and testing web applications.
Features
- Launch browsers (Chromium, Firefox, WebKit)
- Navigate to URLs
- Take screenshots
- Execute JavaScript code
- Extract content from pages
- Monitor console and network logs
- Run performance tests
Installation
Prerequisites
- Python 3.10+
- Virtual environment (recommended)
- Playwright for browser automation
Setup
- Clone this repository
- Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate - Install dependencies:
pip install -r requirements.txt playwright install # Install browser binaries
Running the Server
You can run the server directly:
./run_server.sh
This will start the server on port 8080.
Installation in Claude Desktop
To install the server in Claude Desktop:
./install_claude.sh
This will:
- Generate a configuration file
- Install the server in Claude Desktop
- Make it available as the "BrowserTools" server
After installation, restart Claude Desktop and you'll be able to use the BrowserTools server.
Claude Configuration Format
The installation script generates a claude_config.json file that points to your local installation. Here's an example of what this file looks like (with paths obfuscated):
{
"mcpServers": {
"BrowserTools": {
"command": "/path/to/venv/bin/python",
"args": [
"/path/to/BrowserTools/browser_tools.py"
]
}
}
}
You'll need to replace the paths with the actual locations on your system.
Integration with Cursor AI
To integrate the BrowserTools MCP server with Cursor AI:
-
Create or edit the
mcp.jsonfile in your Cursor configuration directory:- On macOS:
~/.cursor/mcp.json - On Windows:
%APPDATA%\Cursor\mcp.json - On Linux:
~/.config/Cursor/mcp.json
- On macOS:
-
Add the following configuration to the file:
{
"mcpServers": {
"BrowserTools": {
"command": "uv",
"args": [
"run",
"--with",
"mcp[cli]",
"--with",
"playwright",
"mcp",
"run",
"/path/to/BrowserTools/server.py"
]
}
}
}
-
Replace
/path/to/BrowserTools/server.pywith the actual path to the server.py file in your BrowserTools installation. -
Restart Cursor AI to apply the changes.
After restarting, the BrowserTools server will be available for Cursor AI to interact with web browsers.
Available Tools
The server provides the following tools to Claude:
browser_create- Create a new browser instancebrowser_close- Close a browser instancebrowser_navigate- Navigate to a URLbrowser_screenshot- Take a screenshotbrowser_execute_javascript- Execute JavaScript codebrowser_get_console_logs- Get console logsbrowser_performance_test- Run performance tests
License
MIT