Skip to main content
Glama
README.md
<p align="center"><img src="extension/icons/icon128.png" width="96" alt="Nav logo"></p>

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

<p align="center">
  <b>A private, self-hosted browser MCP server.</b><br>
  Let Claude and other AI agents drive <i>your own</i> signed-in Chrome profiles, with no third-party extension or cloud relay.
</p>

<p align="center">
  <a href="LICENSE"><img alt="MIT license" src="https://img.shields.io/badge/license-MIT-8b5cf6"></a>
  <img alt="MCP server" src="https://img.shields.io/badge/MCP-server-14b8a6">
  <img alt="Chrome extension MV3" src="https://img.shields.io/badge/Chrome-MV3%20extension-4285F4">
  <img alt="Node 20+" src="https://img.shields.io/badge/node-%E2%89%A520-339933">
</p>

---

Nav is a [Model Context Protocol](https://modelcontextprotocol.io) server plus a small Chrome extension.
Together they give AI assistants (Claude Code, Claude Desktop, Cursor, VS Code, Antigravity, Windsurf and any
other MCP client) **40 tools** to browse, read pages, click, type, fill forms, inspect console and network,
emulate devices and more. Everything runs on your machine.

**Why another browser MCP?** Browser-automation extensions see every tab, cookie and site you're signed in to.
Nav is small and open, talks **only to `127.0.0.1`**, has **no telemetry**, and puts safety rails
(blocked sites, masked secrets, upload folder limits, an audit log and a pause switch) in front of the AI.

## Features

- 🧑‍💼 **Your real profiles.** Drive any Chrome profile by name ("use my Work profile"), with its logins. Several profiles can be connected at once.
- 🧪 **Isolated mode.** A throwaway Chrome with a blank temporary profile for anything you don't want near your accounts.
- 🖱️ **Real input.** Clicks and keystrokes go through Chrome DevTools, so pages see trusted events. Works inside **iframes**, including cross-origin ones.
- 🔎 **AI-friendly page snapshots.** Interactive elements listed with short refs (`e12`, `f2:e5`), grouped by page region.
- 🛠️ **DevTools.** Console and errors, network requests and response bodies, cookies and storage (secrets masked), device emulation, performance metrics, dialogs and file uploads.
- 👀 **You can see what it's doing, and stop it.** Controlled tabs go into a tab group named after the AI app (🔮 Claude, 🔮 Antigravity…). While it works, the page gets a soft glowing frame and a **"🔮 Claude is working · Stop"** pill. A labelled pointer glides naturally to each element, outlines it and rings on click.
- 🤝 **Take over any time, hand back with one click.** Click or type on the page (or press **Take over**) and Nav steps back, with an amber *"You're in control"* banner. Press **Done** to give it back. The AI can also ask you, for a CAPTCHA, login, 2FA code or payment. While you're in control, the AI can't act on, read or screenshot the page, and console/network recording on that tab is switched off.
- ⚡ **Smooth and quick.** It waits only as long as the page needs (about 0.15 s for a simple click, longer only when a page loads), queues actions one at a time per profile, and stays attached while working so Chrome's debugging bar doesn't flicker.
- 👥 **Many sessions, many tools.** A shared local service lets several Claude sessions and other AI tools use Nav at the same time.
- 🛡️ **Safety first.** Blocked-site list (banking and password managers by default), `eval_js` off by default, cookie and token values hidden by default, uploads only from folders you allow, per-action audit log, and a pause button in the extension.

## How it works

```
Claude Code / Desktop ┐                                          ┌─ Nav extension (profile "Work")
Cursor / VS Code      ├─ stdio ─ MCP server ─┐                   ├─ Nav extension (profile "Personal")
Antigravity / …       ┘                      └─ Nav service (127.0.0.1:47821) ─┘
                                                (shared, starts on demand)
Isolated mode: an MCP server can also launch its own throwaway Chrome (no extension needed).
```

- **One shared service per PC** owns the port and the extensions' connections. Each MCP server (one per AI
  session) connects to it. The first one starts it, it exits 10 minutes after the last session closes, and it
  restarts by itself if it crashes.
- Extensions are accepted only from Nav's fixed extension ID, using that profile's pairing token. Sessions
  are accepted only from local programs holding the client key in your config. Web pages can reach neither.
- Each profile **pairs once**, then reconnects automatically whenever Chrome and an AI session are running.

## Quick start

**Requirements:** Google Chrome 116+ · Node.js 20+ · tested on Windows 11 (macOS and Linux paths are built in but not yet tested)

```bash
git clone https://github.com/semsadekul/nav-mcp.git
cd nav-mcp
npm install
npm run build
```

### 1. Load the extension in each Chrome profile you want to use

1. In that profile's window, open `chrome://extensions`
2. Turn on **Developer mode** (top right)
3. Click **Load unpacked** and choose the `extension` folder of this repo
4. Pin the 🔮 icon. The badge shows **ON** when connected and **II** when paused.

### 2. Add Nav to your AI tool

Use the absolute path to `server/dist/index.js` in your clone.

**Claude Code**

```bash
claude mcp add nav --scope user -- node /path/to/nav-mcp/server/dist/index.js
```

**Any other MCP client** (Claude Desktop, Cursor, VS Code, Antigravity, Windsurf…): add this to its MCP settings:

```json
{
  "mcpServers": {
    "nav": {
      "command": "node",
      "args": ["/path/to/nav-mcp/server/dist/index.js"]
    }
  }
}
```

On Windows use forward slashes, e.g. `"C:/Users/you/nav-mcp/server/dist/index.js"`. If the app can't
find `node`, give its full path, e.g. `"C:/Program Files/nodejs/node.exe"`.

### 3. Pair a profile

Ask your assistant: *"List my Chrome profiles with Nav, then open the Work profile."*
The first time, a pairing page opens in that profile. The extension pairs on its own and the page shows
**✓ Paired**. After that, the profile reconnects automatically.

## Tools

| Group | Tools |
|---|---|
| Profiles | `status`, `profiles_list`, `profile_open`, `profile_use`, `profile_alias` |
| Tabs | `tabs_list`, `tab_new`, `tab_select`, `tab_close`, `navigate`, `go_back`, `go_forward`, `reload` |
| Reading | `snapshot`, `find`, `get_text`, `screenshot` |
| Actions | `click`, `hover`, `type`, `press_key`, `select_option`, `check`, `scroll`, `wait_for` |
| DevTools | `devtools_watch`, `console_logs`, `network_requests`, `network_response`, `cookies_get`, `storage_get`, `emulate`, `performance_metrics`, `eval_js` (off by default) |
| Pages | `handle_dialog` (alert/confirm/prompt), `upload_file` |
| Hand-over | `wait_for_user` (you take over for CAPTCHAs, logins, payments… and click Done) |
| Isolated mode | `isolated_start`, `isolated_stop`, or `profile: "isolated"` on any tool |
| Utility | `batch` (several steps in one call), `extension_reload` |

- Every tool takes an optional `profile`: a folder like `Profile 3`, a nickname (`profile_alias`), a unique display name, or `isolated`.
- Actions target an element by `ref` from `snapshot`/`find` (best), its visible text (`element`), or a CSS `selector`.
- Calls without a `tabId` go to the **working tab**: the tab Nav last opened or used, not whichever window you clicked last.
- **Which tab is controlled?** Every tab Nav works in joins a purple tab group named `🔮 <AI app>`. The name comes from the connected MCP client, so several apps at once get separate groups.
- **Where is it clicking?** A pointer labelled with the app's name glides to each target first: travel time grows with distance, on a gentle curve. It outlines the target and rings on click. It ignores the mouse, lives in a closed shadow DOM, fades when idle, respects "reduce motion", and can be turned off with `"showCursor": false`.
- **Is it working right now? Stop it.** A soft glowing frame and a *"🔮 Claude is working · Take over · Stop"* pill show on the AI's tab while its session is active (5 minutes after the last command), and come back after page loads. **Stop** pauses Nav in that profile, and you resume from the 🔮 icon. Turn the frame off with `"showWorkingFrame": false`.
- **Take over / give back.** While the AI session is active, clicking or typing on its tab (or pressing **Take over**) switches to an amber *"You're in control"* banner. The AI can also ask with `wait_for_user` ("Please solve the CAPTCHA, then click Done"). Until you press **Done – give back** (on the page or in the 🔮 popup), every tool on that profile is refused except harmless bookkeeping. That tab's console and network recording is switched off and cleared, so the AI never sees what you typed. The banner survives page changes, and closing the tab also hands back. Each `wait_for_user` call waits up to 50 s (most MCP apps cancel tool calls after 60 s) and says "still waiting" so the AI can call again.
- Screenshots hide Nav's own pointer and frame, so the AI sees the page as it is (pass `showOverlay: true` to include them). Background tabs are captured without switching to them.
- While Nav is working, Chrome shows a *"Nav started debugging this browser"* bar. It stays steady instead of flickering, and goes away 5 minutes after the last action, when you pause, or a minute after the AI app disconnects.

### Isolated mode

`isolated_start` launches your installed Chrome with a fresh temporary profile, so there are no sign-ins, cookies or history.
It needs no extension and no browser download (it uses `playwright-core`). Every tool works with `profile: "isolated"`,
and console and network are recorded from the start. `isolated_stop`, or closing the AI session, deletes everything.
Pass `headless: true` to run it without a window.

## Configuration

Nav creates its config on first run:

- Windows: `%APPDATA%\nav\config.json`
- macOS/Linux: `~/.nav/config.json`

| Key | Meaning |
|---|---|
| `port` | Local port (default `47821`, or the `NAV_PORT` env var) |
| `defaultProfile` | Profile used when none is named |
| `aliases` | Nicknames, e.g. `{ "work": "Profile 3" }` |
| `blockedSites` | Hosts (optionally with a path) Nav refuses to open, read or act on |
| `allowedSites` | If set, only these hosts are allowed |
| `allowEval` | Enables `eval_js` (default `false`) |
| `allowCookieValues` | `cookies_get` returns cookie values (default `false`: names and flags only) |
| `allowSecretValues` | `storage_get` reveals token/auth/session-looking keys (default `false`) |
| `showCursor` | Show the on-page pointer, element outline and click ring (default `true`) |
| `showWorkingFrame` | Show the glowing "working" frame and the Stop pill (default `true`) |
| `uploadFolders` | `upload_file` only sends files from these folders (default Downloads, Desktop, Documents, Pictures) |
| `chromePath`, `userDataDir` | Override where Chrome and its profiles live |
| `tokens`, `clientToken` | Pairing and session secrets. Delete a profile's token to force re-pairing. |

Logs live next to the config: `logs/YYYY-MM-DD.jsonl` (every action, typed text masked) and `service.log`.

## Safety and privacy

- Nothing leaves your machine except what your AI assistant reads as part of its conversation. Page text and screenshots go to the model you're using, as with any browser tool.
- Page content is labelled as untrusted data, so the assistant treats it as information, not instructions.
- **Pause:** click the 🔮 icon → *Pause control*. Every command is refused in that profile until you resume.
- **Forget pairing:** 🔮 popup → *Forget pairing*.
- The default blocked list covers password managers, the Chrome Web Store and payment sites. Add your bank in `blockedSites`.

## Development

```bash
npm run watch        # rebuild on change
npm run typecheck
npm test             # server tests against a simulated extension (no Chrome needed)

# live tests: pass a profile name, folder ("Profile 3") or "isolated"
node test/live-phase3.mjs "My Profile"   # fills a local test form
node test/live-phase4.mjs isolated       # iframes, console, network, dialogs, upload, emulation
node test/live-shared.mjs "My Profile"   # two sessions at once + service restart
node test/timing.mjs "My Profile"        # how long each step takes
node test/try-takeover.mjs "My Profile"  # hands-on: you take over, give back, then Claude asks you
```

After changing extension code, run `npm run build` and ask the assistant to call `extension_reload`, or click ↻ in `chrome://extensions`.
See [PLAN.md](PLAN.md) for the design notes and roadmap.

## License

[MIT](LICENSE)

TDQS

B3.2/5.0

Scored across 41 tools

Disambiguation4/5

Most tools map to a distinct action on a distinct resource (navigate vs scroll vs snapshot vs click), and the descriptions actively disambiguate tricky pairs like find/snapshot and profile_open/profile_use. A few boundaries are fuzzy: tab_new vs navigate both load a URL, and devtools_watch vs the auto-starting console_logs/network_requests overlap in purpose.

Naming Consistency3/5

Conventions are mixed: verb_noun (press_key, select_option, get_text, upload_file), noun_verb (profiles_list, tabs_list, cookies_get, storage_get, network_response), and bare verbs/nouns (click, type, find, status, reload, snapshot). The domain prefixes (tab_, profile_, isolated_) help readability, but there is no single predictable pattern.

Tool Count2/5

41 tools is well beyond the comfortable range, and while the browser-automation domain is broad, several clusters (profiles, devtools/capture, cookies/storage) could be consolidated into option-bearing tools. The surface is large enough to burden tool selection and inflate context.

Completeness4/5

Coverage is unusually thorough: navigation, interaction, tab/profile lifecycle, uploads, dialogs, emulation, performance, storage/cookies, batching, and user handoff are all present. Gaps remain around frame/iframe switching, right-click/double-click/drag-and-drop, and download handling, which are notable omissions for a browser driver.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues