Metadata-Version: 2.4
Name: stealthmaven
Version: 0.1.3
Summary: Stealth Chromium for scraping and AI agents: a real browser whose timezone, language and WebRTC match its proxy exit. Python API, CDP and MCP.
Author: NodeMaven
License-Expression: MIT
Project-URL: Homepage, https://nodemaven.com/?utm_source=pypi&utm_medium=project&utm_campaign=stealthmaven
Project-URL: Documentation, https://github.com/nodemaven/stealthmaven#readme
Project-URL: Source, https://github.com/nodemaven/stealthmaven
Project-URL: Issues, https://github.com/nodemaven/stealthmaven/issues
Keywords: antidetect-browser,stealth-browser,playwright,patchright,chromium,web-scraping,proxy,residential-proxy,mcp,ai-agents
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: patchright==1.64.3
Requires-Dist: nodemaven>=0.1.7
Provides-Extra: camoufox
Requires-Dist: camoufox>=0.5.9; extra == "camoufox"
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: ruff>=0.6; extra == "dev"
Dynamic: license-file

<div align="center">

<h1><img src="https://raw.githubusercontent.com/nodemaven/stealthmaven/main/src/stealthmaven/assets/nodemaven-mark.svg" alt="" height="44" align="absmiddle"> stealthmaven</h1>

<p><b>A real Chromium for scraping and AI agents whose timezone, languages and WebRTC match its proxy exit.</b><br>
by <a href="https://nodemaven.com/?utm_source=github&utm_medium=readme&utm_campaign=stealthmaven&utm_content=header">NodeMaven</a></p>

[![python](https://img.shields.io/badge/python-3.10%2B-blue?style=flat-square)](https://www.python.org/)
[![license](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](https://github.com/nodemaven/stealthmaven/blob/main/LICENSE)
[![NodeMaven residential proxies](https://img.shields.io/badge/proxies-NodeMaven-1153FC?style=flat-square)](https://dashboard.nodemaven.com/accounts/signup/?utm_source=github&utm_medium=readme&utm_campaign=stealthmaven&utm_content=badge)

[Use](#use) · [Command line](#command-line) · [AI agents (MCP)](#ai-agents-mcp) · [CDP](#other-tools-over-cdp)

</div>

![stealthmaven check: timezone, languages and WebRTC match a German proxy exit, the screen is a full desktop, and public bot detectors read the browser as a human](https://raw.githubusercontent.com/nodemaven/stealthmaven/main/docs/demo.svg)

*Real output of `stealthmaven check`, sped up.*

Built on [patchright](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright-python);
you get an ordinary Playwright `BrowserContext` back. Works with any proxy that
takes a session id in its username, and with NodeMaven's gateway out of the box.

> Early release: the API may still change between minor versions.

<!-- mcp-name: io.github.nodemaven/stealthmaven -->

## Install

```bash
pip install stealthmaven
```

Or run it without installing, with [uv](https://docs.astral.sh/uv/):

```bash
uvx stealthmaven open https://example.com
```

The first launch downloads patchright's Chromium, once per machine.
`stealthmaven install` does that ahead of time (`--with-deps` on Linux also
installs the system libraries it needs); `STEALTHMAVEN_NO_DOWNLOAD=1` turns the
automatic download off.

## Use

```python
from stealthmaven import launch

# NodeMaven: NODEMAVEN_LOGIN and NODEMAVEN_PASSWORD in the environment
with launch(country="de") as browser:
    page = browser.new_page()
    page.goto("https://example.com")
    print(browser.identity.timezone, browser.identity.languages)
```

Any other provider takes a proxy URL with `{session}` where its session id goes,
as `proxy=` or in `STEALTHMAVEN_PROXY`:

```python
launch(proxy="http://user-session-{session}:pass@gate.example.com:7000")
```

Characters such as `#`, `/`, `?` or `@` in the password must be percent-encoded.
With no proxy configured at all, the browser uses this machine's own address and
`launch()` says so with a `NoProxyWarning`.
NodeMaven session ids start with `stealthmaven` (`stealthmavenmcp` for the
browser `stealthmaven mcp` drives), so the traffic can be told apart on the
account.

Before the browser starts, stealthmaven asks the exit where it is (ipinfo.io,
through the proxy; `IPINFO_TOKEN` is sent if set), then sets:

- the timezone to the exit's;
- the languages to the country's usual one, then English
  (`de-DE, de, en-US, en`), in `navigator.languages` and `Accept-Language`;
- WebRTC to proxied traffic only, so pages never see the machine's address;
- the geolocation the browser reports, if a page is given permission.

`timezone=` and `locale=` override the exit. `profile="name"` keeps the browser
profile and its exit's session between runs.

On a machine without a desktop - a server, a Windows service, or
`headless=True` - Chrome would see a screen with no taskbar (or 800x600 when
headless). There stealthmaven runs Chrome's own headless mode with a 1920x1080
screen, a taskbar-sized work area and a window that fills it. "Headless" is taken
out of the User-Agent everywhere - pages, workers and service workers - while the
client hints stay the browser's own. On a desktop the real screen is left alone.
`screen=(1600, 900)` gives that screen on any machine - and with it the
headless mode, so no window - and `screen=None` turns this off.

`engine="camoufox"` (Firefox, `pip install "stealthmaven[camoufox]"`; Camoufox
downloads its browser on first launch, or `stealthmaven install --camoufox`) uses the same proxy, lookup, timezone and languages;
Camoufox builds the rest of its fingerprint itself; its WebRTC candidates carry
the exit's address. It gets past more commercial anti-bot services than Chromium
on patchright - Kasada among them - so use it where the default engine is
refused.

An `http://` proxy is reached through a local relay that counts traffic
(`browser.traffic()`) and refuses Chrome's own update checks and background
downloads, which would otherwise be billed as proxy traffic. The relay, like
the CDP port below, listens on 127.0.0.1 without a password: other programs on
this machine can use it while the browser runs. An `https://` or `socks5://`
proxy goes to the browser directly, so it gets neither the counting nor the
refusals, and no lookup: pass `lookup=False` with `timezone=` and `locale=`.

## Command line

```bash
stealthmaven open https://example.com --country us
stealthmaven check --country us       # what public bot detectors say
stealthmaven serve --country us       # a browser other tools connect to over CDP
stealthmaven exit --country us        # where the exit is, no browser
stealthmaven profiles
stealthmaven install                  # download the browser now
```

`open` without a URL shows a start page with the identity the browser was given
and links to the bot detectors; it is local and makes no requests.

`--proxy` puts the URL, password included, in the process list and the shell
history; `STEALTHMAVEN_PROXY` keeps it out of both.

`check` opens a browser with the identity. On a page it serves itself from
127.0.0.1 it reads the User-Agent in a page, a worker and a service worker, the
client hints, the `Accept-Language` header against `navigator.languages`, and
whether WebRTC offers any candidate outside the proxy. Then it compares the
timezone, languages, screen and WebRTC candidates with the exit and reads
deviceandbrowserinfo.com, BrowserScan, CreepJS and bot.sannysoft.com. It prints
one line per check, never an address, and exits with 1 if any check failed
(`--json` for scripts):

```text
workers                ok      no Headless in page, worker or service worker
client hints           ok      platformVersion 10.0.0, 2 brands
accept-language        ok      header matches navigator.languages
webrtc policy          ok      no candidate outside the proxy
timezone               ok      Europe/Berlin, exit Europe/Berlin
languages              ok      de-DE,de,en-US,en
webrtc                 ok      no other address
screen                 ok      1920x1080, work area 1920x1040
user agent             ok      no Headless
deviceandbrowserinfo   ok      human
browserscan            ok      normal
creepjs headless       ok      0%
creepjs like-headless  info    25% (a desktop Chrome reads 19-25%)
sannysoft              ok      58 rows, none failed
```

## AI agents (MCP)

`stealthmaven mcp` is a Model Context Protocol server that drives one browser
with the identity: `open_page`, `snapshot` (the page's accessibility tree with
element refs), `click`, `type`, `press`, `scroll`, `back`, `extract_text`,
`screenshot`, `identity` and `new_identity`.

Over stdio, for Claude Code, Claude Desktop, Cursor and other local clients:

```json
{"command": "uvx", "args": ["stealthmaven", "mcp", "--country", "us"],
 "env": {"NODEMAVEN_LOGIN": "...", "NODEMAVEN_PASSWORD": "..."}}
```

```bash
claude mcp add stealthmaven -- uvx stealthmaven mcp --country us
```

With `pip install stealthmaven`, the command is `stealthmaven` and the arguments
start at `mcp`. The browser starts on the first tool call; on a machine without
Chromium that first call also downloads it.

Over Streamable HTTP, for clients that connect to a URL:

```bash
stealthmaven mcp --http --country us      # http://127.0.0.1:8931/mcp
```

It listens on 127.0.0.1 only and refuses requests whose `Host` or `Origin` is
not this machine, so a web page cannot reach it through your browser. To expose
it through a tunnel, set a token and name the tunnel's host; clients then send
`Authorization: Bearer <token>`:

```bash
export STEALTHMAVEN_MCP_TOKEN="$(python -c 'import secrets; print(secrets.token_urlsafe(32))')"
stealthmaven mcp --http --allow-host your-tunnel.example.com
```

Without the token anyone who finds the URL drives the browser through your
proxy, so `--allow-host` refuses to start without one. On 127.0.0.1 alone the
token is optional, and without it any program on this machine can connect; the
server keeps one session, and a new `initialize` replaces it. Set the token to
keep the browser to your client.

## Other tools over CDP

`stealthmaven serve` (or `launch(cdp_port=0)`) starts the browser with the
identity and prints a Chrome DevTools endpoint on 127.0.0.1:

```bash
stealthmaven serve --country us
# http://127.0.0.1:54321
```

```python
from patchright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.connect_over_cdp("http://127.0.0.1:54321")
    page = browser.contexts[0].new_page()
```

The client that connects decides how visible the automation is: patchright's
`connect_over_cdp` keeps it hidden, while stock Playwright and Puppeteer
announce themselves over CDP in ways detectors such as deviceandbrowserinfo.com
read. Tools built on them can still drive the browser.

## License

MIT. stealthmaven is made by [NodeMaven](https://nodemaven.com/?utm_source=github&utm_medium=readme&utm_campaign=stealthmaven&utm_content=footer),
which sells residential and mobile proxies; it works with any provider.
