Skip to main content
Glama
README.md
<p align="center">
  <img src="./assets/vanjar-logo.png" alt="VANJAR Logo" width="180" />
</p>

<h1 align="center">VANJAR</h1>

<p align="center">
  <strong>Universal, AI-Model-Independent Browser Automation MCP Server</strong><br />
  Local-first Playwright &amp; Native Chrome automation over STDIO and Streamable HTTP MCP, with durable SQLite persistence and a Chrome Extension Human Control Center.
</p>

---

## Universal MCP Compatibility Overview

VANJAR (`v0.8.1`) exposes **39 MCP tools** over both **STDIO** (for local AI clients) and **Streamable HTTP** (for authenticated remote-compatible MCP connections). Any MCP-compatible AI agent gets the exact same browser automation, session isolation, task memory, verification, and human-in-the-loop safety controls.

```text
AI Clients (Antigravity / Claude Desktop / Claude Code / Codex / Cursor / ChatGPT* / Generic MCP)
  │  MCP over STDIO (local)  OR  Streamable HTTP + Bearer Auth (/mcp)
  ▼
VANJAR Local Engine (Node.js + TypeScript)
  ├── TaskManager, Plans & Bounded Memory  ──▶  SQLite (~/.vanjar/data/vanjar.db)
  ├── ApprovalManager (Single-use, Hash-bound)
  ├── BrowserSessionManager (Isolated Contexts) ──▶ Playwright Chromium
  └── Local Bridge (127.0.0.1 HTTP + SSE)       ──▶ Chrome Extension Side Panel
```

### Supported Client Matrix

| Client | Transport | Setup Command | Auto-Configure | Guide |
| --- | --- | --- | --- | --- |
| **Google Antigravity** | STDIO | `vanjar setup --client antigravity` | Yes (`~/.gemini/config/mcp_config.json`) | [docs/ANTIGRAVITY.md](./docs/ANTIGRAVITY.md) |
| **Claude Desktop** | STDIO | `vanjar setup --client claude-desktop` | Yes (`claude_desktop_config.json`) | [docs/CLAUDE.md](./docs/CLAUDE.md) |
| **Claude Code** | STDIO | `vanjar setup --client claude-code` | Yes (`~/.claude.json`) | [docs/CLAUDE.md](./docs/CLAUDE.md) |
| **OpenAI Codex CLI** | STDIO | `vanjar setup --client codex` | Yes (`~/.codex/config.toml`) | [docs/CODEX.md](./docs/CODEX.md) |
| **Cursor** | STDIO | `vanjar setup --client cursor` | Yes (`.cursor/mcp.json`) | [docs/CURSOR.md](./docs/CURSOR.md) |
| **ChatGPT (Custom MCP)** | Streamable HTTP (HTTPS) | `vanjar setup --client chatgpt` | Template only (manual setup) | [docs/CHATGPT.md](./docs/CHATGPT.md) |
| **Generic MCP Client** | STDIO / Streamable HTTP | `vanjar setup --client generic` | Template only (manual setup) | [docs/CLIENT-COMPATIBILITY.md](./docs/CLIENT-COMPATIBILITY.md) |

> See [docs/CLIENT-COMPATIBILITY.md](./docs/CLIENT-COMPATIBILITY.md) for platform paths and `vanjar clients` / `vanjar compatibility` CLI commands.

---

## Installation

### Option 1: Install from npm (Recommended)

```bash
npm install -g @sivanesan90007/vanjar
npx playwright install chromium
vanjar --help
```

Or run directly with `npx`:

```bash
npx -y @sivanesan90007/vanjar doctor
```

### Option 2: Install from Source

```bash
git clone https://github.com/Sivanesanbalu/vanjar.git
cd vanjar
npm install
npx playwright install chromium
npm run package:release
npm link   # optional: exposes `vanjar` globally
```

Requires **Node.js `>= 22.5.0`** (for built-in `node:sqlite`).

---

## Client Setup Instructions

```bash
# Auto-configure a local STDIO client (creates a timestamped .bak-* backup first)
vanjar setup --client antigravity
vanjar setup --client claude-desktop
vanjar setup --client claude-code
vanjar setup --client codex
vanjar setup --client cursor

# Generate ready-to-copy templates for manual/remote clients
vanjar setup --client chatgpt
vanjar setup --client generic

# Inspect client status, compatibility matrix, and diagnostics
vanjar clients
vanjar compatibility
vanjar doctor
```

### Client Configuration Examples

<details>
<summary>STDIO JSON (Antigravity, Claude Desktop, Claude Code, Cursor)</summary>

```json
{
  "mcpServers": {
    "vanjar": {
      "command": "node",
      "args": ["/absolute/path/to/vanjar/dist/index.js"],
      "env": {
        "VANJAR_HEADLESS": "true",
        "VANJAR_ALLOW_LOCALHOST": "false",
        "VANJAR_BRIDGE_ENABLED": "true",
        "VANJAR_BRIDGE_PORT": "47821",
        "VANJAR_LOG_LEVEL": "info"
      }
    }
  }
}
```
</details>

<details>
<summary>OpenAI Codex CLI (<code>~/.codex/config.toml</code>)</summary>

```toml
[mcp_servers.vanjar]
command = "node"
args = ["/absolute/path/to/vanjar/dist/index.js"]

[mcp_servers.vanjar.env]
VANJAR_HEADLESS = "true"
VANJAR_ALLOW_LOCALHOST = "false"
VANJAR_BRIDGE_ENABLED = "true"
VANJAR_BRIDGE_PORT = "47821"
VANJAR_LOG_LEVEL = "info"
```
</details>

<details>
<summary>Streamable HTTP (Remote / ChatGPT / Custom HTTP MCP Clients)</summary>

```bash
# Start VANJAR in authenticated Streamable HTTP mode (binds to 127.0.0.1:47822 by default)
vanjar mcp --transport http --port 47822
```

- Endpoint: `http://127.0.0.1:47822/mcp` (health check: `GET /health`)
- Auth header: `Authorization: Bearer <token>` (auto-generated in `~/.vanjar/http-auth.json` with `0600` permissions if `VANJAR_HTTP_TOKEN` is not set)
</details>

---

## Local vs. Remote MCP Connection

- **Local STDIO (Recommended for desktop/CLI agents):** The AI client spawns `node dist/index.js` directly. Zero open MCP network ports, no Bearer token needed, lowest latency.
- **Streamable HTTP (`--transport http`):** Exposes `/mcp` over HTTP with **mandatory 256-bit Bearer authentication**, Host/Origin DNS-rebinding checks, and a 1 MB request cap. Keep bound to `127.0.0.1` and place behind an authenticated HTTPS reverse proxy or private tunnel (e.g., Cloudflare Tunnel, Tailscale Funnel, or nginx TLS) when connecting remote cloud clients like ChatGPT.

---

## 39 MCP Tool Categories

1. **Browser & Navigation (`browser_*`):** `browser_open`, `browser_back`, `browser_wait`, `browser_stop`, `browser_get_tabs`, `browser_switch_tab`
2. **Observation & Extraction:** `browser_observe`, `browser_read_page`, `browser_extract`, `browser_screenshot`
3. **Interaction:** `browser_action`, `browser_click`, `browser_type`, `browser_fill`, `browser_scroll`
4. **Verification:** `browser_verify`
5. **Session Management (`session_*`):** `session_create`, `session_list`, `session_switch`, `session_close`
6. **Task & Safety Engine (`task_*`):** `task_create`, `task_plan`, `task_next_step`, `task_status`, `task_history`, `task_control`, `task_propose_action`, `task_approve_action`, `task_reject_action`, `task_checkpoint`, `task_resume`, `task_summary`
7. **Native Chrome (`native_chrome_*`):** `native_chrome_tabs`, `native_chrome_select_tab`, `native_chrome_permissions`, `native_chrome_observe`, `native_chrome_action`, `native_chrome_verify`, `native_chrome_deselect`

Full schemas and parameters: [docs/TOOLS_REFERENCE.md](./docs/TOOLS_REFERENCE.md).

---

## Demo Workflow

Run the built-in self-test against an ephemeral local portal:

```bash
vanjar demo
```

See [docs/DEMO_WORKFLOW.md](./docs/DEMO_WORKFLOW.md) for a step-by-step agent workflow.

---

## Security Architecture

- **SSRF & Scheme Guard:** HTTP/HTTPS-only navigation, private-IP/localhost/DNS-rebinding protection (`VANJAR_ALLOW_LOCALHOST=false` by default).
- **Prompt-Injection Framing & Redaction:** Web content is wrapped in `<untrusted_webpage_content>` delimiters; password/secret fields are automatically redacted from logs and tool outputs.
- **Zero-Download Policy:** `acceptDownloads: false` in Playwright contexts.
- **Authenticated HTTP & Bridge:** Mandatory Bearer auth on Streamable HTTP `/mcp`; `127.0.0.1`-only extension bridge with 256-bit token, pairing code, and strict `chrome-extension://` origin validation.

Full security details: [docs/SECURITY.md](./docs/SECURITY.md), [docs/SECURITY_REVIEW.md](./docs/SECURITY_REVIEW.md), and [docs/NATIVE_CHROME_SECURITY.md](./docs/NATIVE_CHROME_SECURITY.md).

---

## Troubleshooting

- Run `vanjar doctor` to verify Node.js, SQLite schema, Playwright Chromium, extension build, and transport/security defaults.
- Run `vanjar clients` to inspect detected client config paths and status.
- See [docs/TROUBLESHOOTING.md](./docs/TROUBLESHOOTING.md) for common issues.

---

## Known Limitations

- **ChatGPT Web:** Does not support local STDIO; requires a remote HTTPS Streamable HTTP endpoint and a ChatGPT plan/workspace with custom MCP connector access.
- **Interactive Auth/CAPTCHA:** Login, MFA, and CAPTCHA require human takeover (`task_checkpoint` / `task_resume`); VANJAR never bypasses anti-bot protections.
- **Process Restarts:** Interrupted tasks are marked `failed`, pending approvals are invalidated, and prior Playwright sessions are marked `unavailable` on restart.

---

## Development

```bash
npm run typecheck
npm run package:release
npm test
```

TDQS

B3.2/5.0

Scored across 39 tools

Disambiguation3/5

Tools split cleanly by prefix into browser, task, session, and native-Chrome families, but several pairs overlap in practice—browser_action vs browser_click, browser_fill vs browser_type, and browser_verify vs native_chrome_verify. Descriptions use selector-vs-indexed-element distinctions to disambiguate, but an agent must read carefully to choose correctly.

Naming Consistency4/5

Nearly all names are snake_case with stable family prefixes (browser_, task_, session_, native_chrome_). A few names are noun-only or use get (browser_get_tabs, native_chrome_tabs, task_summary), but the pattern remains predictable.

Tool Count2/5

39 tools is well above the practical range for this server; many are fine-grained (browser_click, browser_fill, browser_type) or workflow variants (task_checkpoint, task_resume, task_control). The surface could be consolidated without losing capability.

Completeness4/5

Coverage is broad: navigation, observation, interaction, extraction, screenshots, tabs, sessions, task approvals/checkpoints, and native-Chrome consent flow. Minor gaps remain around advanced browser interactions (hover/drag, upload/download, cookies/storage), but core workflows are supported.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues