Stealth Browser MCP server

Provides undetectable browser automation through Chrome DevTools Protocol integration, enabling web scraping, testing, and form filling tasks without triggering anti-bot detection systems.
Back to servers
Setup instructions
Provider
Vibhek Soni
Release date
Aug 09, 2025
Language
JavaScript
Stats
75 stars

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.

Installation

Prerequisites

  • Python installed on your system
  • Git (to clone the repository)
  • A compatible MCP client (Claude, Claude Desktop, etc.)

Recommended Setup

# 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

Configure MCP Client

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"
  ]
}'

Customize Your Installation

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

Manual Configuration

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": {}
    }
  }
}

Usage

Quick Test

Restart your MCP client and ask your agent:

"Use stealth-browser to navigate to https://example.com and extract the pricing table."

Browser Management

# 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)

Element Interaction

# 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)

Element Extraction

# 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")

Network Debugging

# 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
""")

Troubleshooting Common Issues

Installation Problems

  • Module not found errors: Ensure your virtual environment is activated before running
  • Chrome/Browser issues: The server automatically downloads Chrome when first run
  • "Failed to connect to browser": Fixed in v0.2.4 with auto-detection of root/administrator
  • Windows path errors: Use double backslashes \ in JSON strings for Windows paths

Environment Issues

If you encounter problems, use the environment validation tool:

# Run the environment validator to check for issues
validation_results = await validate_browser_environment_tool()

Advanced Features

Custom Text Input

# 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)

Network Hook System

# 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
""")

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later