redhand-mcp
# π΄ redhand
> **The agent's hand inside your browser.**
> Give AI agents production-operator-grade browser control β over *your* real browser, with *your* sessions, *your* fingerprint, and input that behaves like a human β through MCP.


-8B93A5)
**Status: v0.1.0 released.**
**License: BSL 1.1** (free for personal use, security research, and bug bounty work β see [License](#license) for plain-English terms).

*Live capture β the banner, the humanized cursor mid-path, ghost typing with a typo-and-correct, all while the user watches from another tab.*
---
## What is redhand?
redhand is a **local tool + MCP server** that lets AI agents (Claude, Cursor, ZCode, any MCP client β or your own scripts) operate a real browser with production-operator precision:
- **Element-index addressing, not vision.** The agent reads an indexed list of interactive elements and acts by index β no screenshotβcoordinateβmiss loops.
- **Your real browser.** Not a disposable automation instance. Your profile, your cookies, your logged-in sessions, your genuine TLS/fingerprint.
- **Raw CDP, no middlemen.** redhand speaks the Chrome DevTools Protocol directly β the same protocol Chrome DevTools itself uses, delivered as a local tool with zero automation-framework abstraction between us and the browser.
- **Humanized input.** Mouse curves with acceleration/deceleration, dwell before clicks, overshoot-and-correct, cadence typing β because automation that moves like a robot gets treated like one.
The engine implements operator patterns proven in production β element-index addressing, trusted input dispatch, state-after-every-action loops β with the precision layer (element discovery, overlap pruning, live-rect targeting) built and tuned by us, in our own code.
---
## How it works
```
βββββββββββββββββββ MCP (stdio / HTTP) ββββββββββββββββββββββββββββ
β AI agent β ββββββββββββββββββββββββββββΊ β redhand β
β (Claude/Cursor β β ββββββββββββββββββββββ β
β /ZCode/script) β β β MCP server β β
βββββββββββββββββββ β β β snapshot/click/ β β
β β β type/press/β¦ β β
β β β index layer β β
β β β humanize engine β β
β β β network capture β β
β β β CDP client βββββββΌββ€
β ββββββββββββββββββββββ β
ββββββββββββββββ¬ββββββββββββ
β CDP over WebSocket
ββββββββββββββββΌββββββββββββ
β YOUR browser β
β (real profile/sessions) β
ββββββββββββββββββββββββββββ
```
Three ways to connect (all v1):
| Mode | How | Relaunch needed? |
|---|---|---|
| **Companion bridge** (default) | Tiny `redhand-bridge` extension (loaded once) talks `chrome.debugger` β WebSocket loopback β redhand. No native-host registration, works the same on Windows/macOS/Linux. Attach to your browser **while it's already running**. | β none |
| **Debug-port attach** | Browser already launched with `--remote-debugging-port` β `redhand attach` connects. | β if port is open |
| **Launcher** | `redhand setup` creates a desktop shortcut that starts your real profile CDP-ready. | β
once, by design |
---
## Feature set (v1)
- **`browser_snapshot`** β indexed interactive elements: clickability heuristics, overlap pruning (nested dupes dropped), viewport filter, tag/role/text/aria/rect per element. JSON for code + compact text for LLM prompts.
- **Actions, all with state-after** β every call returns the fresh snapshot diff + url/title. One round-trip per decideβactβsee:
`click(i)` Β· `type(i, text)` (bulk fill) Β· `press(k)` β including **modifier combos** (`ctrl+a`, `ctrl+shift+t`, `f5`) Β· `scroll` Β· `select(i, v)` Β· `hover(i)` Β· `evaluate(js)` Β· `screenshot()` Β· `wait_settled()`
- **`humanize` dial** β session-level, per-action override:
- `ghost` β full curves, dwell, cadence typing with typo-and-correct
- `natural` (default) β curves + dwell, fast typing
- `fast` β teleport + bulk insertText (for your own admin panels)
- **Works on background tabs** β the operated tab never needs focus. You keep working; the agent keeps driving. Measured: click landed + verified while the operated tab was `visibilityState: hidden`.
- **Visibility system** β you always know what's happening:
- banner on the operated tab: *"redhand is operating: \<tab name\>"*
- when you're watching the operated tab: *"redhand agent is seeing your current tab"* + an "agent viewed this page" card on first view
- toast on the tab you're looking at: *"clicking 'Sign in' β in: \<other tab\>"* while the agent works elsewhere
- branded red cursor tracing the agent's path + click ripples
- **Secret redaction** β credential-field values (passwords, API keys, tokens, PEM blocks, opaque blobs) never reach the agent's context: snapshots redact values but keep labels (the agent can still type into them β it just can't read them). Screenshots mask credential fields. Network capture scrubs credential query params. Evaluate results are scanned for secret-shaped values.
- **Tamper protection** β pages that lock/poison the executor API, reassign element indices mid-operation, or flood the candidate set are detected and surfaced as typed `TAMPERING` errors instead of silently clicked.
- **`browser_network`** β request capture while you drive (recon gold: watch the XHRs behind the page you're operating; credential query params scrubbed)
- **Multi-tab** β list/attach/switch tabs; per-tab attach indicator
- **MCP server** β stdio (Claude Desktop/Cursor/ZCode) + streamable HTTP for remote agents
- **Evaluate & screenshot** β full JS access and pixel capture for verification loops
**Measured, not marketed:** snapshot **69 ms** Β· evaluate roundtrip **6 ms** Β· humanized click **1.1 s** Β· fast click **460 ms** on a real browser. Full methodology + comparison: [`docs/benchmarks.md`](docs/benchmarks.md).
---
## What it's for
redhand is a general-purpose browser operator β anywhere an agent needs **speed, accuracy, and a real session**. The headline use cases:
- **Repetitive browser work** β the daily form, the dashboard check, the report download, the data entry you do every single day. Agent does it in seconds, zero typos, zero missed fields, while you do something else.
- **Speed-and-accuracy-critical flows** β anything where a human is too slow or too error-prone: 40-field forms, multi-step verification flows, comparing ten tabs, extracting structured data from behind logins.
- **Security research** β drive a logged-in session behind auth, capture the network traffic your actions fire, probe surfaces on authorized targets. The niche it was born for.
- **Testing your own apps** β QA loops with real sessions, real state, screenshots at every step.
- **Playing browser games** β yes, really. DOM-based games are fully operable; canvas games work through `evaluate` (reading game state) + dispatched input. Great for fun, better as the world's most entertaining test suite.
The security-research angle gets special treatment in the docs because it's where redhand's combination (real sessions + humanized input + network capture) is hardest to replace β but nothing about the tool is security-specific. It's a browser operator. Point it at whatever a browser can do.
### What redhand deliberately is
- β
Local-only. The MCP server binds localhost; the browser never leaves your machine.
- β
Transparent. The browser shows its "started debugging" banner while attached β we don't hide that you're being driven, we make it precise.
- β
Minimal-dependency. ~3 runtime dependencies total (ws, zod, MCP SDK), lockfile-pinned, audit + provenance in CI. The in-page executor ships as a single zero-dependency file.
- β
Thin CDP client, isolated in its own package, using auto-regenerated protocol types β the stable core automation domains (Input, Runtime, Page, DOM) have been protocol-stable for years, and the adapter boundary keeps a BiDi swap non-invasive.
### What redhand deliberately is not
- β Not a cloud service. Nothing phones home.
- β Not a fingerprint-spoofing browser. We drive the *genuine* browser and fight detection on the **behavior layer** (humanized dynamics), not by patching the environment.
- β Not an anti-bot-evasion product. The honest claim: your own automation on your own accounts and authorized targets won't behave like a bot. It is not a promise to defeat the hardest anti-bot stacks, and we won't market it as one.
---
## Why it's different
| Capability | redhand | Playwright MCP | Browser MCP | stealth-browser-mcp | browser-use | ghost-cursor |
|---|---|---|---|---|---|---|
| Your real browser + sessions | β
| via extension | β
via extension | β
| π‘ fresh/cloud | β |
| No extension required | β
(bridge optional) | β | β | β
| β
| β
|
| Attach to running browser | β
(bridge, v1) | β
(extension) | β
| π‘ | β | β |
| Element-index precision API | β
core | π‘ a11y refs | π‘ basic | π‘ | β
| β |
| State-after every action | β
| β | β | β | π‘ | β |
| Humanized mouse + typing | β
first-class dial | β | β | β | β | π‘ mouse only |
| Network capture | β
| β
| β | β
| π‘ | β |
| Single self-contained package (tool + MCP) | β
| β
| β
| β
| β own API | β |
| Security-research workflow as a first-class use case | β
| β | β | π‘ scraping | β | β |
Full receipts: [`docs/comparison.md`](docs/comparison.md).
---
## Quickstart
```bash
# MCP clients (Claude Desktop / Cursor / ZCode / Codex):
npx redhand-mcp
# or a standalone binary β no Node required:
redhand-mcp.exe serve
# one-time setup: pick browser + profile, create launcher, load the bridge extension
redhand setup
```
Agent-side, the tools are self-explanatory:
```
browser_snapshot() β 1 <button class="cta"> "Sign in" (312,48,120,36)
2 <input type="email" placeholder="you@x.com"> (β¦)
3 <input type="password"> (β¦)
browser_type(2, "me@x.com")
browser_type(3, "β’β’β’β’β’β’", humanize="ghost")
browser_click(1) β returns post-click state (URL changed, new elements 1-14)
```
### For AI agents: install the operator skill
Agents drive redhand best with the operating discipline loaded β the loop,
index rules, humanize selection, error recovery, and the security lines that
keep you out of trouble:
```bash
# Claude Code / ZCode-style skill directories:
cp skills/redhand/SKILL.md ~/.zcode/skills/redhand/SKILL.md
```
The skill is short, opinionated, and exists for one reason: agents that follow
it are precise and safe; agents that don't guess.
---
## Architecture & roadmap
```
redhand/
βββ packages/
β βββ core/ # CDP client (raw WebSocket, own implementation) + index layer
β βββ executor/ # in-page engine (TS β built to zero-dep JS, injected per page)
β βββ humanize/ # curves, dwell, cadence typing, event hygiene
β βββ mcp/ # MCP server (stdio + streamable HTTP)
β βββ cli/ # setup wizard, attach, serve
βββ bridge/ # redhand-bridge companion extension (chrome.debugger β WS loopback)
βββ skills/redhand/ # SKILL.md β the operating manual agents load
βββ docs/ # architecture Β· comparison Β· security Β· benchmarks Β· build-order Β· test-plan
βββ examples/ # snapshot-click Β· form-fill Β· bounty-recon Β· live scout Β· benchmarks
```
**v1:** everything above.
**Phase 2:** WebDriver BiDi adapter (Firefox/Safari β the protocol layer is adapter-ready by design), WebMCP site-tools passthrough, recording β replay, HAR export.
**Maybe later:** Go/Rust rewrite of the daemon (the MCP contract hides the language; nothing locks in).
---
## Security notes
- The bridge extension holds only `debugger` + `storage` + `tabs`, and talks over a localhost WebSocket β no native messaging, no per-OS host registration, no cookies permission, no storage of page data.
- Pairing token: the popup shows a token the local server must present β random local processes can't attach.
- Session visibility: badge + banner while a tab is attached; `stop()` kills control instantly.
- While attached, the controlling agent can read the attached tab's DOM β same trust level as handing the agent the page yourself. Attach deliberately.
---
## Author
Built by [**theredhacker0345**](https://github.com/theredhacker0345) β security researcher. All code is original.
## License
**BSL 1.1 (modified)** β battle-tested against three independent adversarial reviews. In plain English:
- **Individuals: free, period.** One person running any number of agents on any number of machines, earning unlimited bounties β free, forever, as long as every operation is performed or personally directed by you, findings go out under your own identity and accounts, and nobody else operates the tool for your benefit. The "Individual Operation" rule is stated verbatim in the license so no future reading can tax a real solo hunter.
- **Solo client work is NOT covered** β paid pentest engagements, client testing, and employer-directed work are commercial, even when a natural person does the clicking. Attribution of use rules catch employer capture, contractor swarms, and agency laundering.
- **Organizations: free for internal security research** on owned/authorized systems β but results can't be sold or productized, entity bounty crews (LLCs, DAOs, shared pools) don't ride the individual grant, and "internal" stops at the legal-entity boundary.
- **Not free:** embedding/orchestrating in any offering (even via install scripts or free tiers), testing-as-a-service, paid training/certification/config-pack offerings premised on the work, reselling, attribution-washing, or license tampering. The anti-loophole clause: *the free grant follows the user and the offering, not the label of the activity.* Commercial inquiries: [ubaid0345@proton.me](mailto:ubaid0345@proton.me) β see [Commercial licensing](#commercial-licensing).
- **Lawful use only + automatic termination on breach**, trademark reservation, patent grant with retaliation, AS-IS disclaimer with liability cap, Karachi/Pakistan governing law.
- **Converts to Apache 2.0** at the Change Date (2030-11-21 for v0.1.0; each version carries its own).
The full binding text is in [`LICENSE`](LICENSE) β including Section 0, the definitions, and the anti-tamper/termination machinery.
---
## Commercial licensing
The BSL structure exists so the tool can stay **free for the people it was built for** β individuals, researchers, bounty hunters β while remaining **sustainable to maintain**. If redhand makes money inside your product or service, that's the line where it funds its own development.
### Who needs a commercial license
- **Product builders** β you're embedding, bundling, or orchestrating redhand inside something you offer to third parties (an agent platform, an RPA product, a QA tool, a browser-automation feature). Free tier or paid tier of *your* product doesn't matter β the embedding is the commercial use.
- **Service providers** β you're offering automated testing, scanning, or browser-automation capabilities to clients: pentest firms, automation agencies, MSPs, managed-testing platforms.
- **Client-facing operators** β you run redhand as part of paid engagements for clients, even if each individual operator holds their own free copy.
### Who doesn't
- Individuals doing personal security research or bug bounty work β **even when earning bounties** (see the Individual Operation rule in the License).
- Organizations doing **internal** security research on systems they own or are authorized to test β results stay in-house, nothing resold or productized.
- Anyone automating non-commercial workflows on their own systems.
If you're unsure which side you're on: **email and ask** β honest questions get straight answers, and nobody gets surprise-invoiced.
### What a commercial license gets you
- **Written certainty** β a signed license naming your entity, use case, and term. No reliance on fair-use arguments or goodwill.
- **Direct access to the author** β bugs you hit get fixed on your timeline, not the public queue.
- **Priority feature work** β the humanize profiles, redaction hints, and integrations you need.
- **Optional services** β custom integration builds, deployment help, and security review of your redhand setup, quoted separately.
### How it works
1. **Email** [ubaid0345@proton.me](mailto:ubaid0345@proton.me) with: your company, what you're building or running, scale (seats / volume / deployments), and timeline.
2. **Quote back** β usually within a couple of days, with a plain-terms license addendum (no 40-page negotiations for standard cases).
3. **Sign and ship** β you get a countersigned license; you're covered.
Licensing tiers are quote-based (single-project, team, and OEM/embedded structures exist) because the right shape depends on what you're building. Nothing is priced to punish honest use β the goal is that commercial beneficiaries fund the tool's future instead of riding on it.
### Why BSL and not open source?
Because "free forever for researchers" and "paid by commercial beneficiaries" is exactly what BSL 1.1 makes possible β and because every version **converts to Apache 2.0** four years after publication, no commercial buyer is ever buying something that could later be yanked into a stricter license. The deal is fixed and public: free where it should be, funded where it should be, open eventually, permanently.
TDQS
Scored across 13 tools
Each tool targets a distinct action on the page: snapshot reads, click/type/press/select/hover mutate, scroll moves the viewport, and the tab/network/screenshot tools each cover their own concern. The one potential overlap β browser_wait_settled versus the implicit settle that every action already performs β is explicitly addressed in its description ('usually unnecessary'), and browser_select vs browser_click on custom comboboxes is spelled out with a fallback path.
Every tool follows the same browser_<verb> or browser_<noun> snake_case pattern with no deviations, and the suffix is the meaningful verb (click, type, press, scroll, select, hover, evaluate). browser_switch_tab and browser_wait_settled are the only multi-word forms and they read naturally as compound verbs.
13 tools sit squarely in the well-scoped range for a browser-automation server. Each one covers a genuinely separate capability an operator needs (observe, interact, navigate tabs, inspect network, escape hatch), and nothing looks like filler or a duplicate of another entry.
Core observe-and-act coverage is strong, but there is no direct navigation tool β no browser_navigate/goto URL, no back/forward, and no open/close-tab operation, so the agent must click links or fall back to browser_evaluate with window.location. Those are workable via the evaluate escape hatch, but they are conspicuous gaps in an otherwise full browser control surface.