Weavetab MCP Documentation — Weavetab Docs — Weavetab Docs

Official Weavetab documentation guide for Documentation. Official documentation and technical reference for Weavetab MCP Documentation from Weavetab, th...

Weavetab MCP Documentation — Weavetab Docs

Official Weavetab documentation guide for Documentation. Official documentation and technical reference for Weavetab MCP Documentation from Weavetab, th...

# Weavetab MCP Documentation

> **Package:** `@weavetab/mcp` | **Version:** 2.6.4 | **License:** AGPLv3 | **Author:** Weavetab (owned by fy2ne)

---

## Overview

Weavetab is an in-process MCP (Model Context Protocol) server providing AI agents with direct control across Chromium browsers and Electron desktop applications. It communicates directly over the Chrome DevTools Protocol (CDP) WebSocket — no WebDriver process, no browser binary download, no cloud middleware.

### Core Capabilities

- **40 Built-in MCP Tools** across functional categories (Vision, Navigation, Input, Tabs, Mission Execution, Dialog, Wait, Storage, Device, Network, Canvas, Output, Evaluation, Office Documents)
- **Direct CDP WebSocket** — Local in-process transport, zero external driver overhead
- **Semantic Delta Engine** — Per-tab snapshot diffing returning only added, modified, or removed elements
- **Ghost Cursor** — Bézier curve click engine with human acceleration and jitter
- **Human Typing Engine** — burst-pattern profiling, per-character jitter, natural pauses
- **Blind Injection** — host-isolated credential injection via `secrets.json` with domain scoping, Shadow DOM isolation, and JS property hardening
- **Self-Learning** — per-domain session memory, knowledge hints, automatic framework detection
- **Security Stack** — domain blacklist, RBAC (5 roles), rate limiter, loop detection, input filter, root guard
- **Burst Mode** — chain N actions in 1 MCP call via `browser_burst`
- **Plugin System** — Extensible plugin ecosystem supporting tool additions, `/` commands (MCP prompts), `@` mentions (MCP resources & URI templates), overrides (with originalHandler wrapping), and tool removals across 3 trust tiers (Official, Verified, Unverified)
- **Built-in `/` Commands & `@` Mentions** — `/page_context`, `/agent`, and `@active-tab` (`weavetab://active-tab`) for zero-tool-call context injection
- **GitHub Automation (Plugin)** — Repo analysis, file reading, issues, and PRs are provided by the official `@weavetab/plugin-github` plugin, not built in

### Weavetab Skills

**Weavetab Skills** is an optional companion package (`@weavetab/skills`) that provides pre-built workflow patterns and mission templates for AI agents. These skills help agents understand complex Weavetab workflows and execute multi-step missions more effectively.

**Installation:**
```bash
npm install -g @weavetab/skills
```

**Available Skills:**
- **Multi-step Form Automation** — Complex form filling with validation handling
- **E-commerce Checkout** — Shopping cart navigation and payment processing
- **Data Extraction Pipelines** — Structured data scraping and export
- **Content Management Systems** — WordPress, Drupal, and CMS-specific workflows
- **API Testing & Validation** — Endpoint testing and response verification

Skills are automatically discovered by compatible MCP clients and provide context-aware guidance for mission planning.

---

## Architecture

```
MCP Client → stdio/WebSocket → WithSecurity Pipeline → CDP WebSocket → Chromium
                                 (RateLimit → DomainPolicy → RBAC)
```

### Five Architectural Layers

| Layer | Components | Responsibility |
|-------|-----------|----------------|
| **Transport** | stdio (JSON-RPC), WebSocket (port 3000) | MCP client communication |
| **Security & Governance** | Domain blacklist, Rate limiter, RBAC, Root guard, Storage blocker | Pre-flight checks |
| **Intelligence** | Session memory, Delta engine, DOM pruner, Trail/loop detection, Knowledge hints, Vision fallback | Token optimization, self-learning |
| **Sensor Systems** | Network telemetry, DOM mutations, Human pacing, Agent state machine, Thought HUD | Runtime awareness |
| **CDP Bridge** | DOM walker, Ghost cursor, Keystroke engine, Pruner, Shadow DOM injector, Tab manager, Browser launcher | Browser control |

---

## Tool Reference (40 Tools)

All tools share: Zod schema validation, `withSecurity()` pipeline (rate limiting + specificity-ordered domain policy + fail-closed RBAC + per-tool timeout budgets), and structured audit logging.

### Vision & Reading (7 tools)

| Tool | Description |
|------|-------------|
| `browser_map` | DOM enumeration with volatile `w:NN` ref IDs, cached map reuse, `depth: 0` DOM init, Set-of-Marks visual grounding (`visual: true` / `"auto"`), container binding, modal hoisting, nav cluster collapsing, delta diffing, and scope filtering. |
| `browser_find` | Native CDP text search with single and multi-match (`all: true`, `limit: N`), null-body safety, and secret redaction on matched labels without a full DOM walk |
| `browser_scrape` | CSS/XPath structured data extraction in 1 CDP call with unified retry preserving `multiple: false`, live `.value`, and secret redaction |
| `browser_inspect` | Parallel CDP inspection returning computed styles, inline styles, box model, and event listener types with Shadow DOM fallback |
| `browser_snapshot` | MHTML capture/restore of DOM state + resources with non-destructive CSS capture masking, MHTML secret redaction, verified restore paths, and `pathToFileURL()` |
| `browser_screenshot` | PNG/JPEG capture via CDP with non-destructive CSS secret masking and accurate scaled dimensions on >1280px viewports (base64 data URL, zero disk I/O) |
| `browser_console` | Read/clear buffered console logs and exceptions (`0`/`false` preserved, noise filtered across all paths, secrets redacted, 1,000-char entry cap) |

### Navigation (1 tool)

| Tool | Description |
|------|-------------|
| `browser_navigate` | Direct CDP navigation with domain blocklist enforcement, Electron-safe defaults (skips web cookie auto-click), guaranteed non-empty title fallback, and `weavetab://` protocol |

### Input (9 tools)

| Tool | Description |
|------|-------------|
| `browser_click` | Ghost Cursor (Bézier) click with visual mark targeting (`mark: N`), intent memory, opt-in `include_map`, Electron URL safety, and stuck-loop detection |
| `browser_type` | Human keystroke engine with zero-target `document.activeElement` typing, exact ref/selector targeting, anti-unfocus guard, jitter, and burst patterns |
| `browser_type_secret` | Blind Injection from `secrets.json` — strict domain check blocking empty-hostname URLs (`file://`, `about:blank`), exact ref matching, `target: "focused"`, and DOM property hardening |
| `browser_key` | Native keyboard dispatch with combo hotkeys (`"Ctrl+A"`, `"Cmd+K"`), printable text payloads, and Electron-safe `Enter` handling |
| `browser_pointer` | Hover, double-click, drag-and-drop (`buttons: 1`, `end_ref` coordinate verification), and multi-level flyout menu traversal via `hover_chain` |
| `browser_select` | Native `<select>` and custom ARIA/Radix/Shadcn dropdown selection (single `value` or multi-select `values`) plus text range highlighting (`mode: "text"`, `start`/`end`) |
| `browser_fill` | Smart multi-field form batch completion with input discovery scanner (`scan: true`), flexible field selectors, and Google Sheets `grid_data` (`AA`+ columns) |
| `browser_upload` | Bypass file dialogs via CDP `DOM.setFileInputFiles` with cached ActionMap reuse |
| `browser_scroll` | Fast non-blocking directional + element-relative scroll (auto-scrolls off-screen targets into view) |

### Tabs & Windows (2 tools)

| Tool | Description |
|------|-------------|
| `browser_tabs` | Open/switch/close/list/consolidate (Tab Armor-aware dedup with URL normalization)/heal (recover crash). Also list/focus windows |
| `browser_detect` | Detect installed browsers + configured desktop apps (case-insensitive `app` match) and CDP feature coverage per engine |

### Mission Execution (2 tools)

| Tool | Description |
|------|-------------|
| `browser_burst` | Chain N actions in 1 MCP call. Supports 5 macro steps: `type_and_send`, `navigate_and_read`, `click_and_wait`, `scroll_and_read`, `fill_form` |
| `browser_automation` | Inject persistent self-running scripts with clean new-document teardown on `stop`, 100-entry mailbox cap, and recursive redaction on `poll` |

### Dialog & User Interaction (3 tools)

| Tool | Description |
|------|-------------|
| `browser_dialog` | Accept/dismiss JavaScript alert/confirm/prompt dialogs with safe toast escaping and deduplicated listeners |
| `browser_thoughts` | Agent-to-user HUD cards: feedback (one-way) or question with input (sentence/paragraph, 120s default timeout, bridge cleanup on cancel/timeout) |
| `browser_clipboard` | System clipboard R/W (text, images, or both in one write), native OS write priority, macOS `Cmd+V` paste, and secret redaction on read |

### Wait & Timing (2 tools)

| Tool | Description |
|------|-------------|
| `browser_wait` | Wait for element/text/URL/stable/network/auto — accurate timeout status (`success: false` on network timeout) and optional loop counter reset |
| `browser_captcha` | Autonomous zero-API detection and solving for Cloudflare Turnstile, reCAPTCHA v2/v3, GeeTest, and hCaptcha via CDP mouse physics |

### Storage & Cookies (2 tools)

| Tool | Description |
|------|-------------|
| `browser_storage` | Validated `localStorage` & `sessionStorage` get/set/remove/list/clear with secret redaction and 2,000-char value cap on `list` |
| `browser_cookies` | Cookies get/list/set/delete with secret redaction on read and real CDP delete error reporting |

### Device & Environment (2 tools)

| Tool | Description |
|------|-------------|
| `browser_viewport` | Viewport, device emulation, real CDP touch emulation, geolocation, timezone, color scheme (`no-preference` clear), and Electron-safe reset |
| `browser_emulate` | Validated network throttling presets (3G/4G/offline), CPU slowdown (`>= 1`), geolocation, timezone, color scheme, and User-Agent override |

### Network (1 tool)

| Tool | Description |
|------|-------------|
| `browser_network_intercept` | Escaped glob API mocking, tracking blocks, Response-stage passthrough, clean listener teardown, and raw protocol telemetry (TLS/SSL, timing, OS failures) |

### Canvas & Visual (2 tools)

| Tool | Description |
|------|-------------|
| `browser_canvas` | Get image data (base64 PNG) or draw coordinate drag paths (`buttons: 1`) on canvas |
| `browser_highlight` | Visual CDP overlay highlight with `textContent` XSS safety and color allowlisting — zero token cost |

### Output (2 tools)

| Tool | Description |
|------|-------------|
| `browser_pdf` | Print page to PDF — landscape, scale, page ranges, basename traversal guard, auto `.pdf` suffix, and secret masking |
| `browser_recording` | Compile browser screencast frames into video (`.webp`, `.gif`, `.mp4`, `.webm`) with `sessionId` traversal validation |

### Evaluation (1 tool)

| Tool | Description |
|------|-------------|
| `browser_eval` | Run JS via CDP `Runtime.evaluate`, auto-invoke bare zero-arg functions (`() => ...`), and recursively redact secrets across objects/arrays. On `weavetab://` pages, supports `wt-dashboard-command` events |

### Performance (1 tool)

| Tool | Description |
|------|-------------|
| `browser_performance` | CDP metrics (`Performance.enable()`), parallel Core Web Vitals (FCP/LCP/CLS) with observer teardown, and single-eval memory/navigation/resource timings |

### GitHub Automation (Plugin)

GitHub support is no longer a built-in tool. It is provided by the official `@weavetab/plugin-github` plugin, which registers a single `github` tool (actions: `analyze`, `read`, `issues`, `pr`). Install it with `weavetab plugin add @weavetab/plugin-github`.

### Utility (3 tools)

| Tool | Description |
|------|-------------|
| `browser_checkpoint` | Snapshot and restore browser state (cookies, storage, scroll/URL) into `mode: 0o600` checkpoints with bounded restore load wait |
| `browser_pattern_learn` | Read, register, and update named workflow patterns and site quirks per origin |