local-browser-mcp
# local-browser-mcp
[English](./README.md) | [简体中文](./README.zh-CN.md)
[](https://www.npmjs.com/package/local-browser-mcp)
[](./LICENSE)
**Zero-terminal, one-click MCP server & native DeepSeek Harness (DSH) bundle** that connects your AI agents — **DeepSeek Harness (DSH), OpenAI Codex, Antigravity, Doubao / Trae, Claude Code, Claude Desktop, Cursor** — directly to your **real local Chrome, Edge, or Brave browser** via CDP.
Bypass **Cloudflare 403** on RSC, Wiley, ACS, Elsevier, and Springer by reusing your **real browser fingerprint, cookies, campus/institutional login, and persistent profile** — with built-in **human-in-the-loop CAPTCHA waiting** and **authenticated PDF / Supporting Information (SI) downloading**.

---
## Easiest Setup (No Manual Config Editing!)
### Option 1: DeepSeek Harness (DSH) — 1 Step
`local-browser-mcp` is a native DSH bundle. Simply tell DSH in chat:
> "Install plugin `local-browser-mcp`"
(Or search & install `local-browser-mcp` in DSH Plugin Manager.) Done — no terminal or config editing required.
### Option 2: Visual One-Click Setup Wizard (All Other Agents)
Don't want to edit JSON/TOML files by hand?
- **Windows**: Download [`一键安装配置.cmd`](https://github.com/yangdw2024/local-browser-mcp/releases/latest) and **double-click** it.
- **macOS**: Download [`install-macos.command`](https://github.com/yangdw2024/local-browser-mcp/releases/latest) and **double-click** it.
- **Or run one command**:
```bash
npx -y local-browser-mcp ui
```
A visual setup page opens in your browser automatically:
1. Click **"Open Dedicated Browser"** → log in once to your university library / WebVPN / publisher accounts (saved permanently).
2. Click **"One-Click Enable All"** → automatically detects Codex, Antigravity, Trae / Trae CN (Doubao IDE), Claude, and Cursor, backs up existing configs, and enables `local-browser-mcp` with `--auto-launch`.
### Option 3: One-Line Auto-Install (Let Your AI Run It)
```bash
npx -y local-browser-mcp install
```
Automatically detects installed agents, backs up existing files, and merges the MCP config safely. To remove later:
```bash
npx -y local-browser-mcp uninstall
```
---
## Why `local-browser-mcp`?
| Problem | Headless / `web_fetch` | `local-browser-mcp` |
|---|---|---|
| Cloudflare 403 / TLS fingerprinting | Blocked immediately | Uses your real Chrome/Edge/Brave binary & TLS stack |
| Campus VPN / Institutional SSO / Cookies | No login state | Persistent local profile keeps all logins & cookies |
| Cloudflare Turnstile / CAPTCHA | Stuck forever | Auto-detects challenge + `browser_wait_for_human` resumes automatically once you click |
| Downloading PDFs / SI files behind auth | Fails with 403 / HTML login page | `browser_download` fetches inside the real authenticated page context |
| Multi-agent compatibility | Locked to one app | Visual one-click wizard + native DSH bundle + standard MCP (`stdio` & `Streamable HTTP`) |
| Heavy browser downloads (300 MB+) | Playwright downloads its own Chromium | Zero browser binaries downloaded — uses the Chrome/Edge you already have |
---
## Available MCP Tools (16)
| Tool | Description |
|---|---|
| `browser_status` | Check CDP connection, browser version, open tabs, and detected local browsers |
| `browser_tabs` | List open page tabs (`tab_id`, `title`, `url`) |
| `browser_navigate` | Navigate to a URL (optionally in a new tab) and auto-detect Cloudflare / CAPTCHA challenges |
| `browser_snapshot` | Compact numbered DOM snapshot of visible & interactive elements with `ref` IDs and bounding boxes |
| `browser_extract_text` | Extract clean visible text from the page or a CSS selector |
| `browser_click` | Click by `ref`, CSS `selector`, or viewport `x`/`y` |
| `browser_type` | Insert text into focused element or target (`ref` / `selector` / `x,y`) |
| `browser_press` | Press a keyboard key (`Enter`, `Tab`, `Escape`, arrows, etc.) |
| `browser_scroll` | Scroll page with real mouse-wheel events |
| `browser_screenshot` | Capture viewport or clipped region as PNG/JPEG image |
| `browser_download` | **Authenticated file download** inside the real browser session (ideal for PDFs, SI zips/docx, datasets) |
| `browser_wait_for_human` | Focuses the tab and waits for you to click a Cloudflare Turnstile / CAPTCHA / SSO login, resuming automatically |
| `browser_evaluate` | Run async JavaScript in the page context and return JSON result |
| `browser_console` | Read captured console logs & uncaught exceptions |
| `browser_network` | Inspect recent network requests (status, MIME type, URLs — great for discovering PDF/SI URLs) |
| `browser_close_tab` | Close a specific tab or active tab |
---
<details>
<summary><b>Advanced: Manual Configuration & CLI Reference</b></summary>
### Print Manual Config Snippets
```bash
npx local-browser-mcp setup --client all
```
### Streamable HTTP Mode (for Doubao / Coze / Web Agents)
```bash
npx local-browser-mcp serve --http --port 3845 --auto-launch
# Endpoint: http://127.0.0.1:3845/mcp
```
### Full CLI Reference
```bash
local-browser-mcp ui [--port 0] [--cdp-url http://127.0.0.1:9222]
local-browser-mcp install [--clients codex,cursor] [--all] [--dry-run]
local-browser-mcp uninstall [--clients codex,cursor] [--dry-run]
local-browser-mcp launch [--channel chrome|edge|brave] [--port 9222]
local-browser-mcp doctor [--cdp-url http://127.0.0.1:9222]
local-browser-mcp serve [--cdp-url <url>] [--auto-launch] [--download-dir <dir>] [--http --port 3845]
local-browser-mcp setup [--client dsh|codex|antigravity|doubao|trae|claude-code|claude-desktop|cursor|all]
```
</details>
---
## Security Note
- Both the visual wizard and CDP bind strictly to `127.0.0.1` (localhost only). The wizard enforces per-session CSRF tokens and Host header checks.
- `local-browser-mcp` uses a dedicated persistent profile by default (`~/.local-browser-mcp/profiles/<channel>`) so you control exactly which accounts and institutional sessions are shared with AI agents.
---
## License
MIT © [yangdw2024](https://github.com/yangdw2024)
TDQS
Scored across 16 tools
Most tools target distinct actions (navigate, click, type, press, scroll, screenshot, download, etc.) and descriptions clarify boundaries. However there is mild overlap among the three read/inspect tools (browser_snapshot, browser_extract_text, browser_evaluate) and between browser_click and browser_type's click-then-insert behavior, which could cause occasional misselection.
Every tool uses the same browser_ prefix with a snake_case verb/noun suffix (browser_navigate, browser_extract_text, browser_close_tab). The pattern is uniform and predictable, including the longer browser_wait_for_human which still follows the convention.
16 tools is slightly above the ideal 3-15 range but each maps to a distinct browser capability, so the surface is well-earned. It's a touch heavy but not bloated for a full browser-automation server.
Core browser lifecycle is well covered: connect/status, navigate, tabs, click/type/press/scroll, screenshot, text extraction, JS eval, console/network inspection, download, CAPTCHA wait, and tab closing. Minor gaps exist for form interactions like select/dropdown, hover, right-click, drag, and file upload, plus explicit back/forward navigation.