Stealth Browser MCP is a powerful browser automation tool that allows AI agents to access protected websites, bypass Cloudflare and antibot systems, and perform sophisticated web interactions—all through simple chat commands. It provides undetectable browser automation with a 98.7% success rate on sites that typically block automation.
# 1. Clone the repository
git clone https://github.com/vibheksoni/stealth-browser-mcp.git
cd stealth-browser-mcp
# 2. Create virtual environment
python -m venv venv
# 3. Activate virtual environment
# Windows:
venv\Scripts\activate
# Mac/Linux:
source venv/bin/activate
# 4. Install dependencies
pip install -r requirements.txt
Windows (Full Installation):
claude mcp add-json stealth-browser-mcp "{\"type\":\"stdio\",\"command\":\"C:\\path\\to\\stealth-browser-mcp\\venv\\Scripts\\python.exe\",\"args\":[\"C:\\path\\to\\stealth-browser-mcp\\src\\server.py\"]}"
Mac/Linux (Full Installation):
claude mcp add-json stealth-browser-mcp '{
"type": "stdio",
"command": "/path/to/stealth-browser-mcp/venv/bin/python",
"args": [
"/path/to/stealth-browser-mcp/src/server.py"
]
}'
You can run a minimal installation or disable specific features:
# Minimal installation (only core browser + element interaction)
python src/server.py --minimal
# Custom installation - disable specific sections
python src/server.py --disable-cdp-functions --disable-dynamic-hooks
# List all available tool sections
python src/server.py --list-sections
If you don't have Claude CLI, you can manually add to your MCP client configuration:
Claude Desktop - Windows (%APPDATA%\Claude\claude_desktop_config.json)
{
"mcpServers": {
"stealth-browser-full": {
"command": "C:\\path\\to\\stealth-browser-mcp\\venv\\Scripts\\python.exe",
"args": ["C:\\path\\to\\stealth-browser-mcp\\src\\server.py"],
"env": {}
},
"stealth-browser-minimal": {
"command": "C:\\path\\to\\stealth-browser-mcp\\venv\\Scripts\\python.exe",
"args": ["C:\\path\\to\\stealth-browser-mcp\\src\\server.py", "--minimal"],
"env": {}
}
}
}
Claude Desktop - Mac/Linux (~/Library/Application Support/Claude/claude_desktop_config.json)
{
"mcpServers": {
"stealth-browser-full": {
"command": "/path/to/stealth-browser-mcp/venv/bin/python",
"args": ["/path/to/stealth-browser-mcp/src/server.py"],
"env": {}
},
"stealth-browser-custom": {
"command": "/path/to/stealth-browser-mcp/venv/bin/python",
"args": [
"/path/to/stealth-browser-mcp/src/server.py",
"--disable-cdp-functions",
"--disable-dynamic-hooks"
],
"env": {}
}
}
}
Restart your MCP client and ask your agent:
"Use stealth-browser to navigate to https://example.com and extract the pricing table."
# Create a new browser instance
instance_id = await spawn_browser()
# Navigate to a URL
await navigate(instance_id, "https://example.com")
# Take a screenshot
screenshot_path = await take_screenshot(instance_id)
# Close the browser when done
await close_instance(instance_id)
# Find elements using CSS selectors
elements = await query_elements(instance_id, "button.submit")
# Click on an element
await click_element(instance_id, "button.submit")
# Type text with human-like behavior
await type_text(instance_id, "input#username", "myusername", typing_speed="human")
# Paste large text instantly
await paste_text(instance_id, "textarea", large_content, clear_first=True)
# Scroll the page
await scroll_page(instance_id, direction="down", amount=500)
# Extract a complete element with all styles
element_data = await extract_complete_element_cdp(instance_id, ".hero-section")
# Clone an element to a file
file_path = await clone_element_to_file(instance_id, ".pricing-table")
# Extract just the styles
styles = await extract_element_styles(instance_id, ".product-card")
# List recent network requests
requests = await list_network_requests(instance_id)
# Get details about a specific request
details = await get_request_details(instance_id, request_id)
# Get the response content
response = await get_response_content(instance_id, request_id)
# Create a dynamic hook to monitor or modify requests
hook_id = await create_dynamic_hook(instance_id, """
def process_request(request, hook_action):
# Log all API calls
if "/api/" in request.url:
print(f"API call: {request.url}")
# Block ad networks
if "ads" in request.url or "tracking" in request.url:
hook_action.block = True
return hook_action
""")
If you encounter problems, use the environment validation tool:
# Run the environment validator to check for issues
validation_results = await validate_browser_environment_tool()
# Human-like typing with newline support
await type_text(instance_id, "textarea", "Line 1\nLine 2", parse_newlines=True)
# Instant pasting for large content
await paste_text(instance_id, "#editor", large_code_snippet, clear_first=True)
# Create a hook that logs and modifies API calls
hook_id = await create_dynamic_hook(instance_id, """
def process_request(request, hook_action):
if "/api/login" in request.url:
# Log authentication requests
print(f"Auth attempt: {request.url}")
# Add custom headers
hook_action.request_headers["Custom-Auth"] = "value"
return hook_action
def process_response(response, hook_action):
if "/api/products" in response.url:
# Modify JSON responses
import json
body = json.loads(response.body)
body["premium_features"] = True
hook_action.response_body = json.dumps(body)
return hook_action
""")
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "stealth-browser-mcp" '{"type":"stdio","command":"python","args":["src/server.py"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"stealth-browser-mcp": {
"type": "stdio",
"command": "python",
"args": [
"src/server.py"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"stealth-browser-mcp": {
"type": "stdio",
"command": "python",
"args": [
"src/server.py"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect