Skip to main content
Glama

local-browser-mcp

English | 简体中文

CI npm version License: MIT

Least-privilege MCP server & native DeepSeek Harness (DSH) bundle that bridges AI agents (DeepSeek Harness, OpenAI Codex, Antigravity, Doubao / Trae, Claude Code, Claude Desktop, Cursor) to a local Chrome, Edge, or Brave browser over CDP — designed for local assistance on sessions you have already legitimately logged into and authorized (such as university library portals, WebVPN, and academic publishers).

Demo


Least-Privilege Security Model (Default-On)

Connecting an AI agent to an authenticated browser is high-sensitivity. local-browser-mcp ships with hard security guardrails enabled by default so engineers can run it safely on daily workstations:

  1. Isolated Research Browser Profile (Recommended Default)

    • Run npx local-browser-mcp launch --research (or click Launch research window in DSH Settings / Web Setup Wizard).

    • Opens a physically separated profile at ~/.local-browser-mcp/profiles/research-<channel> — completely isolated from your personal banking, password manager, and webmail cookies. Log in only to your academic/institutional portals inside this profile.

  2. Default High-Risk Domain Denylist & Academic Allowlist

    • Standard mode (default) automatically blocks access to banking/payment portals, password managers (1Password, Bitwarden, LastPass, etc.), webmail (mail.google.com, outlook.*, etc.), cloud consoles (AWS, Azure, GCP, Cloudflare), sensitive security/OAuth endpoints (github.com/settings*, */oauth/authorize*), file://, chrome://, and cloud metadata IPs (169.254.169.254). Even if a sensitive tab is open in your browser, MCP read/write/screenshot tools refuse to touch it.

    • Research Strict mode (--security-mode research-strict or local-browser-mcp security --mode research-strict) enforces an allowlist-only policy pre-populated with 30+ academic publishers (*.sciencedirect.com, *.acs.org, *.wiley.com, *.rsc.org, *.springer.com, *.nature.com, *.arxiv.org, etc.) plus your custom campus/WebVPN domains.

  3. Operation Privilege Tiering & Cross-Origin Write Guard

    • Tools are tiered into read, navigate, and write.

    • browser_evaluate (arbitrary JS execution) is disabled by default (allowEvaluate: false).

    • writePolicy defaults to confirm-cross-origin: cross-origin writes (browser_click, browser_type, browser_press, browser_download) are blocked unless explicitly confirmed (confirm_write: true). You can also lock the session to read-only.

  4. Indirect Prompt-Injection Defense

    • Hidden DOM text (opacity: 0, font-size: 0/1px, offscreen, aria-hidden), invisible Unicode/bidi override characters, and spoofed boundary tags are stripped before returning text or snapshots to the LLM.

    • All extracted page content is wrapped in explicit untrusted-data boundaries (<<<UNTRUSTED_WEB_CONTENT origin="..." trust="untrusted-external-data">>>).

  5. Human-in-the-Loop Policy

    • local-browser-mcp never bypasses or cracks CAPTCHAs or anti-bot protections. If an authorized site presents an interactive human check or SSO login, browser_wait_for_human brings the tab forward so you complete it manually.


Related MCP server: Antigravity Browser Controller

Quick Start

# 1. Launch an isolated Research Browser Profile (no daily cookies/passwords)
npx -y local-browser-mcp launch --research

# 2. Log into your university library / WebVPN / publisher inside that window

# 3. Auto-configure your AI agents (Codex, Antigravity, Trae, Claude, Cursor)
npx -y local-browser-mcp install

Option 2: Visual One-Click Setup Wizard

Option 3: DeepSeek Harness (DSH) Native Bundle

  1. Tell DSH in chat: "Install plugin local-browser-mcp" (or install from Plugin Manager).

  2. Open Settings → Local browser inside DSH to:

    • Auto-discover installed Chrome / Edge / Brave browsers and profiles

    • Launch an isolated Research window

    • Switch active browser, security mode (Standard / Research Strict), write guard (Confirm cross-origin / Read-only), and browser_evaluate toggle live without restarting DSH.

Option 4: Gemini Developer Mode (Web & Mobile) & Multi-MCP Gateway

Gemini Developer Mode is a cloud MCP client that requires stateless Streamable HTTP (POST /mcp), public HTTPS, OAuth 2.1 (PKCE S256), and MCP Tool Annotations (readOnlyHint / destructiveHint) — all built into v0.6.0:

  • Option A — Tailscale Funnel + Built-in OAuth 2.1 (zero custom domain):

    # 1. Start stateless Streamable HTTP + OAuth 2.1 (prints a local consent passcode)
    npx -y local-browser-mcp serve --gemini --public-url https://YOUR_NODE.YOUR_TAILNET.ts.net
    
    # 2. Expose 127.0.0.1:8765 over trusted HTTPS
    tailscale funnel 8765

    Then open https://gemini.google.com/devmode → + Create new → enter https://YOUR_NODE.YOUR_TAILNET.ts.net/mcp.

  • Option B — Cloudflare Named Tunnel + Cloudflare Access Managed OAuth:

    npx -y local-browser-mcp serve --http --stateless --port 8765 \
      --auth cloudflare-access \
      --cf-team-domain yourteam.cloudflareaccess.com \
      --cf-access-aud YOUR_APPLICATION_AUD
  • Option C — Control-Plane Inversion Gateway (Web/Mobile Gemini controls BOTH Browser AND Local Workspace / Local Agents over ONE tunnel & OAuth):

    # Mount /browser/mcp (21 browser tools) + /agent/mcp (10 sandboxed local executor & async codex/claude tools)
    npx -y local-browser-mcp gateway --enable-agent --workspace . --public-url https://YOUR_HOST
    • /browser/mcp (@LocalBrowser): your local Chrome/Edge browser.

    • /agent/mcp (@LocalAgent, opt-in via --enable-agent, strictly confined to --workspace):

      • 0 local LLM tokens: local_workspace_info, local_list_files, local_read_file, local_write_file, local_run_command — Gemini thinks in the cloud, your machine executes deterministically.

      • Async local Agent dispatch: agent_dispatch_task (codex / claude / shell), agent_task_status, agent_read_logs, agent_stop_task, agent_list_tasks — heavy coding jobs run asynchronously in the background without hitting cloud HTTP timeouts.

  • Deterministic 1-Call Gemini Web Recipe (Channel B — 0 DOM snapshot bloat): When a local script or agent genuinely needs Gemini Web's unique features (Notebooks, Deep Research, independent second-opinion review), avoid multi-step snapshot + click loops:

    # 0 local LLM tokens from any terminal/script
    npx -y local-browser-mcp ask "Summarize key design tradeoffs of solid-state electrolytes"

    Or call the single atomic MCP tool browser_gemini_ask({ prompt }) (event/stability-based completion, no blind sleep).

  • Bundled Agent Skill (gemini-local-control): The complete end-to-end Control-Plane Inversion workflow (gateway startup, Cloudflare Tunnel / Tailscale Funnel exposure, OAuth 2.1 verification, Gemini Developer Mode linking, and 1-call Recipe rules) is packaged right inside local-browser-mcp:

    • DSH: Automatically registered into the DSH skill catalog as soon as you install the local-browser-mcp bundle!

    • Codex / Claude Code / Antigravity / Trae / Cursor: Install to ~/.dsh/skills & ~/.agents/skills in one command:

      npx -y local-browser-mcp skill install

Architecture & Ecosystem Boundary

Architecture

local-browser-mcp operates strictly at the Chromium CDP browser layer (127.0.0.1 loopback only):

  • Use local-browser-mcp when an AI agent needs to read or download from web portals where you already hold legitimate access (institutional subscriptions, authenticated web apps, PDF/Supporting Information retrieval).

  • It does not control non-browser native desktop apps (use a dedicated desktop automation MCP for those) and does not run headless CAPTCHA-solving scripts.


Available MCP Tools (21 Browser + 10 Opt-In Agent Bridge)

Tier

Tool

Description

Read

browser_status

Connection status, active preference, profile mode, security policy summary, open tabs

Read

browser_discover

Auto-discover installed browsers (Chrome/Edge/Brave), live debugging status, and profiles

Read

browser_tabs

List open tabs (tabs on restricted domains are redacted & marked blocked_by_policy)

Read

browser_snapshot

Sanitized numbered DOM snapshot (ref IDs + boxes; skips hidden/invisible injection nodes)

Read

browser_extract_text

Extract visible text wrapped in <<<UNTRUSTED_WEB_CONTENT>>> boundary markers

Read

browser_extract_links

Categorized academic PDF / Supporting Information (SI) / dataset / DOI link scanner

Read

browser_screenshot

Capture viewport or clipped region as PNG/JPEG image

Read

browser_console

Read captured console logs & uncaught exceptions

Read

browser_network

Inspect recent network requests (status, MIME type, URLs)

Navigate

browser_navigate

Navigate within allowed domains (checks both target URL and post-redirect URL)

Navigate

browser_wait_for_human

Focus tab and wait for human completion of interactive SSO / human checks

Navigate

browser_select

Switch preferred browser channel (auto/chrome/edge/brave), profile_mode, and profile

Navigate

browser_launch_research

Launch an isolated Research Browser Profile separated from everyday personal cookies

Navigate

browser_gemini_ask

1-call deterministic Gemini Web recipe (0 DOM snapshot tokens, stability-based completion)

Navigate

browser_close_tab

Close a specific tab or active tab

Write

browser_click

Click element (ref / selector / x,y), guarded by cross-origin write policy

Write

browser_type

Insert text into target element, guarded by cross-origin write policy

Write

browser_press

Press a keyboard key, guarded by cross-origin write policy

Write

browser_scroll

Scroll page with mouse-wheel events

Write

browser_download

Authenticated download (in-page fetch() + native CDP fallback), policy-checked

High-Risk Write

browser_evaluate

Execute JS in page context (disabled by default; requires security.allowEvaluate=true)


Troubleshooting & Chrome/Edge 136+ Diagnostics

Chrome, Edge, and Brave 136+ block --remote-debugging-port against the default User Data directory for security.

Run doctor anytime to inspect detected browsers, stale DevToolsActivePort files, active security policy, and configured agents:

npx local-browser-mcp doctor

Configure security policies via CLI (stored in ~/.local-browser-mcp/config.json):

# Lock to academic allowlist + read-only or cross-origin confirmation
npx local-browser-mcp security --mode research-strict --write-policy confirm-cross-origin --allow-evaluate false

# Add your university domain / WebVPN to the allowlist
npx local-browser-mcp security --mode research-strict --allow "*.wiley.com,*.acs.org,*.sciencedirect.com,*.arxiv.org,*.edu"

Known Limitations

  • Requires a local Chromium-based browser (Chrome, Edge, Brave, or Chromium) installed on the host.

  • When attaching directly to an everyday Chrome/Edge 136+ window via chrome://inspect/#remote-debugging, Chrome intentionally keeps that permission scoped to the current browser run; if the browser restarts, either use the persistent Research Profile (launch --research) or re-check remote debugging.

  • browser_download via in-page fetch() requires readable response size in memory; cross-origin CDN links automatically fall back to native CDP downloads.


License

MIT © yangdw2024

Available Tools

21 tools
browser_clickClick ElementA
Destructive

[Write] Click an element in the local browser using a ref from browser_snapshot, a CSS selector, or viewport x/y coordinates. Guarded by domain policy and cross-origin write protection.

Inputs: x, y, ref, tab_id, +2 more.

browser_close_tabClose Browser TabA
Destructive

Close a specific tab (or the current active tab) in the connected local browser.

Inputs: tab_id.

browser_consoleRead Console LogsB
Read-onlyIdempotent

Read recent console log/warn/error entries captured from the browser tab.

Inputs: limit, tab_id.

browser_discoverDiscover Local BrowsersA
Read-onlyIdempotent

Auto-discover all installed local browsers (Chrome, Edge, Brave, Chromium), their live remote-debugging status, all user profiles/accounts, and the active browser preference.

Inputs: no named parameters.

browser_downloadDownload FileA
Destructive

[Write] Download a PDF, Supporting Information (SI), dataset, or file directly through the user's already-authorized browser session and save it to disk. Guarded by domain policy and cross-origin write checks.

Inputs: url (required), tab_id, filename, save_path, +2 more.

browser_evaluateEvaluate JavaScriptA
Destructive

[High-Risk Write] Execute a JavaScript expression in the page context. Disabled by default under least-privilege security policy unless security.allowEvaluate=true is configured.

Inputs: expression (required), tab_id, confirm_write.

browser_extract_textExtract Page TextA
Read-onlyIdempotent

Extract clean visible text from the current page (or a specific CSS selector), wrapped in untrusted-content boundary markers — ideal for reading articles, abstracts, tables, or institutional portal pages.

Inputs: tab_id, selector, max_chars.

browser_gemini_askAsk Logged-In Gemini Web (1-Call Deterministic Recipe)A

Deterministic single-call recipe for querying the user's logged-in Gemini Web tab (e.g. for Notebook / Deep Research / second-opinion review) with 0 DOM snapshot tokens and automatic generation-completion detection. Use only when Gemini Web's unique capabilities or independent review add value.

Inputs: prompt (required), tab_id, new_chat, close_tab, +1 more.

browser_launch_researchLaunch Isolated Research BrowserA

Launch an isolated Research Browser Profile physically separated from the user's everyday personal cookies, banking, and email logins. Recommended for academic/institutional sessions.

Inputs: channel, start_url.

browser_navigateNavigate to URLA
Destructive

Navigate the local browser to an allowed HTTP/HTTPS URL using the user's already-authorized session. Automatically flags if a human verification / CAPTCHA challenge is detected.

Inputs: url (required), tab_id, new_tab, timeout_ms, +1 more.

browser_networkRead Network RequestsA
Read-onlyIdempotent

Read recent network requests (URL, method, HTTP status, MIME type, errors) observed in the browser tab — useful for finding actual PDF/SI download endpoints.

Inputs: limit, tab_id.

browser_pressPress KeyB
Destructive

[Write] Press a single keyboard key (Enter, Tab, Escape, Backspace, Delete, Space, ArrowUp/Down/Left/Right, PageUp/Down, Home, End, or a single character).

Inputs: key (required), tab_id, confirm_write.

browser_screenshotCapture ScreenshotB
Read-onlyIdempotent

Capture a screenshot of the current browser viewport (or clipped region) and return it as an image.

Inputs: clip, format, tab_id, full_page.

browser_scrollScroll PageB

Scroll the page vertically or horizontally using a real mouse wheel event.

Inputs: x, y, tab_id, delta_x, +1 more.

browser_selectSelect Local BrowserA

Switch the preferred local browser (auto, chrome, edge, brave, chromium), profile isolation mode (research, managed, attach), and optional profile directory.

Inputs: channel (required), download_dir, profile_mode, profile_directory.

browser_snapshotDOM SnapshotA
Read-onlyIdempotent

Capture a sanitized, compact numbered DOM snapshot of visible & interactive elements (with ref numbers and bounding boxes). Call this before browser_click or browser_type by ref.

Inputs: tab_id.

browser_statusBrowser StatusA
Read-onlyIdempotent

Check connection status to the local Chrome/Edge/Brave browser via CDP, showing browser version, CDP URL, security policy, open tab count, and detected local browsers.

Inputs: no named parameters.

browser_tabsList Browser TabsA
Read-onlyIdempotent

List open page tabs in the connected local browser with their tab_id, title, and URL (tabs on policy-restricted domains are redacted).

Inputs: no named parameters.

browser_typeType TextA
Destructive

[Write] Type text into the focused element, or click a target (ref, selector, or x/y) first and then insert text. Guarded by domain policy and cross-origin write protection.

Inputs: text (required), x, y, ref, +4 more.

browser_wait_for_humanWait for Human VerificationA

Bring the tab to focus so the user can complete a human verification / CAPTCHA / institutional SSO login in their local browser. In remote HTTP mode (or when non_blocking=true), returns immediately with status 'waiting_for_human' to avoid HTTP gateway timeouts.

Inputs: reason, tab_id, selector, timeout_ms, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 21 tools

    Disambiguation4/5

    Most tools target a clearly distinct action (navigate, click, type, scroll, screenshot, download, console, network), and the descriptions explicitly separate similar pairs like browser_snapshot (interactive refs) vs browser_extract_text (clean text). Minor overlap remains between browser_status/browser_tabs/browser_discover (all report browser and tab state) and between browser_network/browser_extract_links (both help find download endpoints), which could occasionally cause misselection.

    Naming Consistency4/5

    Every tool shares the browser_ prefix in snake_case, which gives a predictable, readable namespace. There is a small deviation in verb style: some names are verb_noun (browser_close_tab, browser_extract_text, browser_wait_for_human) while others are bare nouns (browser_tabs, browser_status, browser_console, browser_network).

    Tool Count3/5

    At 21 tools the surface is heavy for a browser-automation server, and the rubric places 16-25 tools in the borderline range. Most tools do earn their place given the security-policy, discovery, download, and AI-integration features, but a few (browser_discover vs browser_status, browser_network vs browser_extract_links) could plausibly be consolidated.

    Completeness4/5

    The lifecycle is well covered: connect/discover, navigate, read (snapshot/text/links), interact (click/type/press/scroll), download, human handoff, and diagnostics (console/network). Gaps are minor but real—no hover or select-option tool, no explicit back/forward or new-tab creation, and no file upload—though most can be worked around with click/type where policy allows.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables AI agents to directly control your real Chrome browser with full context including login sessions, cookies, and open tabs. It provides tools for page scanning, JavaScript execution, CDP control, screenshots, and physical mouse/keyboard input for authentic browser automation.
      20
      243
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to drive the user's real, already-logged-in Chrome browser locally, so they can read and navigate pages, click, type, fill forms, take screenshots, and inspect cookies, tabs, console, and network traffic without headless browsers or remote-debugging ports.
      1 npm
      ISC
    • A
      license
      Not graded
      quality
      A
      maintenance
      Lets AI coding tools drive the real, already-logged-in Chrome browser over local stdio—snapshotting and reading pages, clicking, typing, managing tabs, capturing screenshots, and inspecting network, console, storage, and cookies—without opening a remote-debugging port. It installs as a Chrome extension plus native-messaging bridge, so agents work in the user's authenticated sessions while passing bot detection.
      1 npm
      ISC