### 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 Augment Code Hero Recreation ``` -------------------------------- ### Add to Claude Code CLI (Mac/Linux) Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Command to add the stealth-browser-mcp to Claude Code CLI on Mac or Linux. Replace the path with your actual project location. ```bash 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"] } ``` -------------------------------- ### Restrict Local File Uploads Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Restrict local file uploads to specific directories by setting the BROWSER_FILE_UPLOAD_ALLOWED_DIRS environment variable. ```bash export BROWSER_FILE_UPLOAD_ALLOWED_DIRS="/path/to/allowed/uploads,/another/path" ``` -------------------------------- ### CDP Function Execution Tools Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Functions for direct interaction with the Chrome DevTools Protocol (CDP) and JavaScript execution. ```APIDOC ## CDP Function Execution Tools ### Description Functions for direct interaction with the Chrome DevTools Protocol (CDP) and JavaScript execution. ### Tools - `execute_cdp_command()`: Direct CDP commands (use snake_case). - `add_script_to_evaluate_on_new_document()`: Install pre-document scripts for API spoofing. - `discover_global_functions()`: Find JavaScript functions. - `discover_object_methods()`: Discover object methods (93+ methods). - `call_javascript_function()`: Execute any function. - `inject_and_execute_script()`: Run custom JS code. - `inspect_function_signature()`: Inspect function details. - `create_persistent_function()`: Functions that survive reloads. - `execute_function_sequence()`: Execute function sequences. - `create_python_binding()`: Create Python-JS bindings. - `execute_python_in_browser()`: Execute Python code via py2js. - `get_execution_contexts()`: Get JS execution contexts. - `list_cdp_commands()`: List available CDP commands. - `get_function_executor_info()`: Get executor state info. ``` -------------------------------- ### Map API Endpoints via Network Interception Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/examples/claude_prompts.md Use stealth-browser to navigate to a web app URL and monitor API calls using list_network_requests. Retrieve request details and response content to create an API map. ```prompt Use stealth-browser to navigate to [web app URL]. As I interact with the page, use list_network_requests to monitor all API calls. For each request, use get_request_details and get_response_content to show me the data flow. Create a complete API map with endpoints, auth methods, and data schemas. ``` -------------------------------- ### Add to Claude Code CLI (Windows) Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Command to add the stealth-browser-mcp to Claude Code CLI on Windows. Ensure the path to the Python executable is correct. ```bash 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\"]}" ``` -------------------------------- ### Set Debug Environment Variable Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Alternatively, set the STEALTH_BROWSER_DEBUG environment variable to 1 to enable debug logging. ```bash export STEALTH_BROWSER_DEBUG=1 ``` -------------------------------- ### Element Extraction (CDP-accurate) Tools Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Advanced tools for extracting detailed element information using CDP. ```APIDOC ## Element Extraction (CDP-accurate) Tools ### Description Advanced tools for extracting detailed element information using CDP. ### Tools - `extract_complete_element_cdp()`: Complete CDP-based element clone. - `clone_element_complete()`: Complete element cloning. - `extract_complete_element_to_file()`: Save complete extraction to file. - `extract_element_styles()`: 300+ CSS properties via CDP. - `extract_element_styles_cdp()`: Pure CDP styles extraction. - `extract_element_structure()`: Full DOM tree. - `extract_element_events()`: React/Vue/framework listeners. - `extract_element_animations()`: CSS animations/transitions. - `extract_element_assets()`: Images, fonts, videos. - `extract_related_files()`: Related CSS/JS files. ``` -------------------------------- ### File-Based Extraction Tools Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Functions for saving extracted element data to files. ```APIDOC ## File-Based Extraction Tools ### Description Functions for saving extracted element data to files. ### Tools - `extract_element_styles_to_file()`: Save styles to file. - `extract_element_structure_to_file()`: Save structure to file. - `extract_element_events_to_file()`: Save events to file. - `extract_element_animations_to_file()`: Save animations to file. - `extract_element_assets_to_file()`: Save assets to file. - `clone_element_to_file()`: Save complete clone to file. - `list_clone_files()`: List saved clone files. - `cleanup_clone_files()`: Clean up old clone files. ``` -------------------------------- ### Network Debugging and Interception Tools Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Tools for monitoring, intercepting, and modifying network requests. ```APIDOC ## Network Debugging and Interception Tools ### Description Tools for monitoring, intercepting, and modifying network requests. ### Tools - `list_network_requests()`: List captured network requests. - `get_request_details()`: Inspect headers and payload for a request. - `get_response_content()`: Get response data from a request. - `modify_headers()`: Add custom headers to requests. - `spawn_browser(block_resources=[...])`: Block tracking scripts, ads, etc. - `create_dynamic_hook()`: Create Python functions to intercept/modify requests. - `create_simple_dynamic_hook()`: Quick hook creation with presets. - `list_dynamic_hooks()`: List active hooks with statistics. - `get_dynamic_hook_details()`: Inspect hook source code. - `remove_dynamic_hook()`: Remove a hook. - `get_hook_documentation()`: Request object structure and HookAction types. - `get_hook_examples()`: 10 detailed examples: blockers, redirects, proxies. - `get_hook_requirements_documentation()`: Pattern matching and best practices. - `get_hook_common_patterns()`: Ad blocking, API proxying, auth injection. - `validate_hook_function()`: Validate hook code before deployment. ``` -------------------------------- ### Privacy Audit Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/examples/claude_prompts.md Navigate to a website, capture tracking requests via network interception, find analytics code, and generate a report on collected data. ```prompt Use stealth-browser to navigate to [website]. Use network interception to capture all tracking requests and extract_element_events to find analytics code. Generate a report of what data the site collects. ``` -------------------------------- ### Disable Specific Tool Sections Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md Selectively disable tool sections like CDP functions, dynamic hooks, or progressive cloning to customize the available tools. ```bash python src/server.py --disable-cdp-functions --disable-dynamic-hooks --disable-progressive-cloning ``` -------------------------------- ### Disable Idle Browser Reaping Source: https://github.com/vibheksoni/stealth-browser-mcp/blob/master/README.md To disable automatic reaping of idle browser instances and manual management of browser lifetimes, set BROWSER_IDLE_TIMEOUT to 0. ```bash export BROWSER_IDLE_TIMEOUT=0 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.