$ show vibheksoni/stealth-browser-mcp
This repository provides a stealth browser automation MCP (Model Context Protocol) server that offers undetectable control over real browser instances (Chrome, Chromium, Edge) via the Chrome DevTools Protocol (CDP) and the `nodriver` library. It exposes 97 tools across 11 sections including navigation, DOM interaction, element extraction (styles, structure, events, animations), network interception and modification (including dynamic Python-powered hooks), CDP command execution, cookie management, tab control, and proxy forwarding with authentication. The architecture is a FastMCP-based server with singleton managers for browser instances, network interception, element cloning, and process cleanup. It supports stdio and HTTP transports, Docker deployment, and optional bearer auth. The system is designed to bypass anti-bot detection (Cloudflare, CreepJS, login walls) and is used for scraping, testing, and AI agent automation. While the codebase is well-structured and the functionality is comprehensive, there is some code duplication across multiple element cloner implementations and technical drift risk due to tight coupling with CDP APIs and the `py2js` transpiler dependency.
The LLM identified 3 files worth highlighting for reuse:
Provides thread‑safe tracking of browser process PIDs and temporary profile directories, automatic cleanup with multiple fallback kill strategies (process.terminate, subprocess.kill, os.kill), and orphan‑process recovery. This component is self‑contained and can be extracted into any system that needs to manage and clean up short‑lived browser or subprocess instances.
Detects installed browsers (Chrome, Chromium, Edge) across Windows, macOS, and Linux by checking common installation paths and executable names. Provides platform‑aware sandbox arguments (e.g., `--no-sandbox`, `--disable-dev-shm-usage`) and container/root detection. Also includes utility functions for composing browser arguments from environment variables. This module is reusable in any project that needs to launch browsers across platforms with correct sandbox configurations.
A thread‑safe debug logging system with ring‑buffer storage, level‑based filtering, and export to JSON, pickle, or gzip formats. Uses `threading.RLock` for safe concurrent access and exposes a simple `log(level, message)` interface. This can be extracted and used in any project requiring a lightweight, in‑memory debug log with export capabilities.