### Clone and Install Project Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Steps to clone the repository, set up a virtual environment, and install project dependencies. ```bash git clone https://github.com/vibheksoni/stealth-browser-mcp.git cd stealth-browser-mcp python -m venv venv # Activate virtual environment # Windows: venv\Scripts\activate # Mac/Linux: source venv/bin/activate pip install -r requirements.txt ``` -------------------------------- ### Install Dependencies Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Ensure all project dependencies are installed by activating the virtual environment and running the pip install command. ```bash pip install -r requirements.txt ``` -------------------------------- ### Stealth Browser MCP Setup vs. Others Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/COMPARISON.md Compares the setup time for Stealth Browser MCP with other automation tools. Stealth Browser MCP requires significantly less time for setup and integration. ```bash # Stealth Browser MCP (30 seconds) git clone && pip install && add to claude_desktop_config.json # Others (2+ hours) pip install → write custom integration → fight bot detection → give up ``` -------------------------------- ### Install Dependencies (Windows) Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/CONTRIBUTING.md Sets up the development environment on Windows by creating a virtual environment, activating it, and installing dependencies from requirements.txt. ```bash python -m venv venv virtualenv\Scripts\activate pip install -r requirements.txt ``` -------------------------------- ### Manual JSON Configuration (Windows) Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md JSON configuration for manual setup in Claude Desktop or similar clients on Windows. Update the paths to match your installation. ```json { "mcpServers": { "stealth-browser-mcp": { "command": "C:\\path\\to\\stealth-browser-mcp\\venv\\Scripts\\python.exe", "args": ["C:\\path\\to\\stealth-browser-mcp\\src\\server.py"], "env": {} } } } ``` -------------------------------- ### Install Dependencies (Mac/Linux) Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/CONTRIBUTING.md Sets up the development environment on macOS or Linux by creating a virtual environment, activating it, and installing dependencies from requirements.txt. ```bash python -m venv venv source venv/bin/activate pip install -r requirements.txt ``` -------------------------------- ### Manual JSON Configuration (Mac/Linux) Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md JSON configuration for manual setup in Claude Desktop or similar clients on Mac/Linux. Ensure the command and args paths are correct. ```json { "mcpServers": { "stealth-browser-mcp": { "command": "/path/to/stealth-browser-mcp/venv/bin/python", "args": ["/path/to/stealth-browser-mcp/src/server.py"], "env": {} } } } ``` -------------------------------- ### FastMCP CLI Installation Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Commands to install stealth-browser-mcp using FastMCP CLI for different clients. This is an untested method. ```bash pip install fastmcp fastmcp install claude-desktop src/server.py --with-requirements requirements.txt # OR fastmcp install claude-code src/server.py --with-requirements requirements.txt # OR fastmcp install cursor src/server.py --with-requirements requirements.txt ``` -------------------------------- ### Clone Stealth Browser MCP Repository Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/demo/augment-hero-clone.md Clone the Stealth Browser MCP project from GitHub to get started. Ensure to follow the installation instructions in the main README. ```bash git clone https://github.com/vibheksoni/stealth-browser-mcp.git # Follow installation instructions in main README ``` -------------------------------- ### Run Docker Container with Environment Variables Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Example of running a Docker container for Stealth Browser MCP and setting environment variables using the -e flag. ```bash docker run --rm -p 8000:8000 \ -e STEALTH_BROWSER_MCP_AUTH_TOKEN="replace-with-a-long-random-token" \ stealth-browser-mcp ``` -------------------------------- ### Set Environment Variables for systemd Service Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Example of configuring server environment variables for a systemd service using the Environment directive. ```ini [Service] Environment="STEALTH_BROWSER_MCP_AUTH_TOKEN=replace-with-a-long-random-token" Environment="BROWSER_IDLE_TIMEOUT=900" Environment="BROWSER_IDLE_REAPER_INTERVAL=30" Environment="BROWSER_ORPHAN_PROFILE_MAX_AGE=43200" Environment="BROWSER_FILE_UPLOAD_ALLOWED_DIRS=/srv/stealth-browser/uploads:/srv/stealth-browser/shared" ExecStart=/path/to/venv/bin/python /path/to/stealth-browser-mcp/src/server.py --transport http --host 0.0.0.0 ``` -------------------------------- ### Set Environment Variables in Shell (macOS/Linux) Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Example of setting server environment variables using export commands in a macOS or Linux shell before launching the server. ```bash export STEALTH_BROWSER_MCP_AUTH_TOKEN="replace-with-a-long-random-token" export BROWSER_IDLE_TIMEOUT=900 export BROWSER_IDLE_REAPER_INTERVAL=30 export BROWSER_ORPHAN_PROFILE_MAX_AGE=43200 export BROWSER_FILE_UPLOAD_ALLOWED_DIRS="/Users/me/uploads:/Users/me/Documents" python src/server.py ``` -------------------------------- ### Set Environment Variables in Shell (Windows PowerShell) Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Example of setting server environment variables using $env: commands in Windows PowerShell before launching the server. ```powershell $env:STEALTH_BROWSER_MCP_AUTH_TOKEN='replace-with-a-long-random-token' $env:BROWSER_IDLE_TIMEOUT='900' $env:BROWSER_IDLE_REAPER_INTERVAL='30' $env:BROWSER_ORPHAN_PROFILE_MAX_AGE='43200' $env:BROWSER_FILE_UPLOAD_ALLOWED_DIRS='C:\Users\me\uploads;C:\Users\me\Documents' python src/server.py ``` -------------------------------- ### Validate Browser Environment Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Run this tool to diagnose issues with browser detection. Ensure Chrome, Chromium, or Microsoft Edge is installed. ```python validate_browser_environment_tool() ``` -------------------------------- ### Configure Server Environment Variables in MCP Client Config Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Example of setting server environment variables within the 'env' block of an MCP client configuration file. ```json { "mcpServers": { "stealth-browser-mcp": { "command": "C:\\path\\to\\stealth-browser-mcp\\venv\\Scripts\\python.exe", "args": ["C:\\path\\to\\stealth-browser-mcp\\src\\server.py"], "env": { "STEALTH_BROWSER_MCP_AUTH_TOKEN": "replace-with-a-long-random-token", "BROWSER_IDLE_TIMEOUT": "900", "BROWSER_IDLE_REAPER_INTERVAL": "30", "BROWSER_ORPHAN_PROFILE_MAX_AGE": "43200", "BROWSER_FILE_UPLOAD_ALLOWED_DIRS": "C:\\Users\\me\\uploads;C:\\Users\\me\\Documents" } } } } ``` -------------------------------- ### Clone Website with Single Command Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/demo/README.md This command initiates a browser to clone a specified website, extracting CSS properties and generating production-ready HTML and CSS. It aims for a pixel-perfect recreation with enhanced animations and responsive design improvements. ```bash User: "hey spawn a browser and clone the hero of the site https://www.augmentcode.com/" Claude: *Spawns browser → Extracts 2,838 CSS properties → Generates production HTML* ``` -------------------------------- ### Run Stealth Browser MCP in Minimal Mode Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Use the --minimal flag to run the MCP with only 20 core tools for essential browser automation. ```bash python src/server.py --minimal ``` -------------------------------- ### Price Monitoring Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/examples/claude_prompts.md Navigate to a product page, identify the price element, read the current price, compare it against a threshold, and take a screenshot of the result. ```prompt Use stealth-browser to navigate to [product page]. Use extract_element_structure to identify the price element. Use execute_script to read the current price and compare it against a threshold. Take a screenshot of the result. ``` -------------------------------- ### Configure Browser Reaper Cadence and Profile Cleanup Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Tune the background reaper cadence with BROWSER_IDLE_REAPER_INTERVAL and startup cleanup of abandoned temp profiles with BROWSER_ORPHAN_PROFILE_MAX_AGE. ```bash export BROWSER_IDLE_REAPER_INTERVAL=60 export BROWSER_ORPHAN_PROFILE_MAX_AGE=3600 ``` -------------------------------- ### Run Stealth Browser MCP with Custom Tool Selection Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Disable specific sections using --disable-* flags to create a custom toolset for the MCP. ```bash python src/server.py --disable-cdp-functions --disable-dynamic-hooks ``` -------------------------------- ### Dynamic Pricing Analysis Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/examples/claude_prompts.md Navigate to an e-commerce site and use network interception with execute_python_in_browser to observe price changes based on request headers, cookies, and session state. ```prompt Use stealth-browser to navigate to an e-commerce site. Use network interception and execute_python_in_browser to observe how prices change based on request headers, cookies, and session state. ``` -------------------------------- ### User Prompt for Hero Section Cloning Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/demo/augment-hero-clone.md This is the user's command to initiate the browser and clone a specific website's hero section. ```text hey spawn a browser and clone the hero of the site https://www.augmentcode.com/ ``` -------------------------------- ### Browser Management Tools Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Functions for creating, managing, and interacting with browser instances. ```APIDOC ## Browser Management Tools ### Description Functions for creating, managing, and interacting with browser instances. ### Tools - `spawn_browser()`: Create undetectable browser instance. - `navigate()`: Navigate to URLs. - `close_instance()`: Clean shutdown of browser. - `list_instances()`: Manage multiple sessions. - `get_instance_state()`: Full browser state information. - `go_back()`: Navigate back in history. - `go_forward()`: Navigate forward in history. - `reload_page()`: Reload current page. ``` -------------------------------- ### List Available Sections in Stealth Browser MCP Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Use the --list-sections flag to see all available functionality sections within the MCP. ```bash python src/server.py --list-sections ``` -------------------------------- ### Competitor Analysis Across Tabs Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/examples/claude_prompts.md Open multiple tabs for competitor sites, navigate to their pricing pages, capture pricing sections, and compile a comparison of features and pricing. ```prompt Use stealth-browser to open tabs for 5 competitor sites. In each tab, navigate to their pricing page and use extract_complete_element_cdp to capture the pricing section. Compile a comparison of features and pricing. ``` -------------------------------- ### Run Python Inside Browser Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/examples/claude_prompts.md Navigate to a page with a complex form and use execute_python_in_browser to programmatically analyze the page structure and fill out form fields. ```prompt Use stealth-browser to navigate to a page with a complex form. Use execute_python_in_browser to write Python code that analyzes the page structure and fills out the form fields programmatically. ``` -------------------------------- ### Clone UI Element with Full Fidelity Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/examples/claude_prompts.md Use stealth-browser to navigate to a specific URL and clone a UI element, including all associated CSS, fonts, images, and animations, generating working local HTML. ```prompt Use stealth-browser to navigate to stripe.com/pricing. Use extract_complete_element_cdp to clone their pricing table. Extract all CSS, fonts, images, and animations. Generate working HTML I can use locally. ``` -------------------------------- ### Instantiate Stealth Browser MCP Client with Bearer Token Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Python code snippet demonstrating how to instantiate the Stealth Browser MCP client using a BearerAuth object with a token. ```python from fastmcp import Client from fastmcp.client.auth import BearerAuth client = Client( "http://localhost:8000/mcp/", auth=BearerAuth("replace-with-a-long-random-token"), ) ``` -------------------------------- ### Disable Browser Sandboxing Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Run the server with sandboxing disabled if browser crashes occur on Linux, Docker, or CI environments. The server adjusts automatically for root and container detection. ```bash python src/server.py --sandbox=false ``` -------------------------------- ### Configure HTTP Transport Security with Auth Token Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Enable bearer-token authentication for HTTP transport by setting the STEALTH_BROWSER_MCP_AUTH_TOKEN environment variable. Clients must then include an Authorization header. ```bash # Set environment variable export STEALTH_BROWSER_MCP_AUTH_TOKEN="your_secret_token" # Client request header # Authorization: Bearer your_secret_token ``` -------------------------------- ### Bypass Anti-bot and Extract Content Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/examples/claude_prompts.md Use stealth-browser to navigate to a Cloudflare-protected site. Extract the main content area and its HTML structure. ```prompt Use stealth-browser to navigate to a Cloudflare-protected site. Take a screenshot proving access, then extract the main content area using extract_complete_element_cdp and show me the HTML structure. ``` -------------------------------- ### Enable Debug Mode in Stealth Browser MCP Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Enable verbose server diagnostics by running with the --debug flag or setting the STEALTH_BROWSER_DEBUG environment variable. ```bash python src/server.py --debug ``` -------------------------------- ### Configure Browser Idle Timeout Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Override the default idle browser instance timeout per instance using spawn_browser or globally with the BROWSER_IDLE_TIMEOUT environment variable. ```python # Override per instance spawn_browser(idle_timeout_seconds=300) # Disable global reaping export BROWSER_IDLE_TIMEOUT=0 ``` -------------------------------- ### Element Interaction Tools Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Functions for querying, interacting with, and extracting information from DOM elements. ```APIDOC ## Element Interaction Tools ### Description Functions for querying, interacting with, and extracting information from DOM elements. ### Tools - `query_elements()`: Find elements by CSS/XPath. - `click_element()`: Natural clicking. - `type_text()`: Human-like typing with newline support. - `paste_text()`: Instant text pasting via CDP. - `file_upload()`: Upload allowlisted local files to file inputs. - `scroll_page()`: Natural scrolling. - `wait_for_element()`: Smart waiting. - `execute_script()`: Run JavaScript. - `select_option()`: Dropdown selection. - `get_element_state()`: Element properties. - `get_page_content()`: Full page HTML and text. - `take_screenshot()`: Optimized page screenshots. ``` -------------------------------- ### Create Dynamic Network Hook Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/examples/claude_prompts.md Utilize stealth-browser's dynamic hook system to create a Python function that blocks specific tracking requests and logs API calls with full details. ```prompt Use stealth-browser's dynamic hook system to create a Python function that blocks all tracking requests matching *.analytics.* and logs every API call to /api/* with full headers and payloads. ``` -------------------------------- ### Generated HTML Structure Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/demo/augment-hero-clone.md This snippet shows the basic HTML structure generated by the Augment Hero Clone project. It includes meta tags, a title, and a placeholder for CSS and body content. ```html