Skip to main content
Glama

Chrome MCP Stealth

用于通过 Chrome DevTools Protocol 进行隐身浏览器自动化的 MCP 服务器。连接到真实的 Chrome 实例,并使用类人交互模式(贝塞尔曲线鼠标轨迹、高斯打字延迟、滚动抖动)以避免机器人检测。

为什么

标准的浏览器自动化工具(Playwright、Puppeteer、Selenium)很容易被现代反机器人系统检测到。网站通过指纹识别鼠标移动(直线、瞬间传送)、打字模式(均匀延迟)以及 JavaScript 属性(navigator.webdriver、缺失的插件)来阻止自动化访问。

Chrome MCP Stealth 通过在 Playwright 与真实 Chrome 实例的 CDP 连接之上叠加类人行为来解决这个问题——不是无头浏览器,也不是全新的配置文件,而是你带有 Cookie、扩展程序和历史记录的真实浏览器。

Related MCP server: wraith-mcp

功能

  • 隐身模式:贝塞尔曲线鼠标移动、高斯按键延迟、滚动抖动、反检测 JS 补丁

  • 快速模式:无延迟的即时操作——适用于非受保护的域名

  • 安全性:针对提示词注入、数据泄露和凭据泄露的 4 层防御

  • 单文件:整个服务器是一个 index.js 文件(约 630 行)

隐身原理

鼠标移动遵循带有随机控制点的三次贝塞尔曲线,产生自然的弧线而不是直线。每次移动使用 12-50 个插值步骤,具有缓入缓出计时和偶尔的过冲校正。

打字使用高斯分布的按键间延迟(平均约 75ms),在标点符号后有额外的停顿,并每约 10 个字符进行一次周期性的“思考停顿”——模拟人类的打字节奏。

滚动被分解为带有稳定延迟的抖动多步增量,避免了标记自动化的瞬间跳转。

反检测补丁移除 navigator.webdriver,从 window 中清理 Playwright/Selenium 工件,并注入真实的 chrome.runtime 和插件存根。

请参阅 ARCHITECTURE.md 了解完整的实现细节。

安全模型

  1. 提示词注入扫描器 — 20 多种正则表达式模式可检测页面内容中的指令覆盖尝试、社会工程学和数据泄露命令

  2. 内容清理 — 在返回页面文本之前剥离隐藏/不可见的元素,防止通过零尺寸或屏幕外元素进行注入

  3. 内容聚焦 — 所有页面内容都被包裹在 <EXTERNAL_CONTENT trust="untrusted"> 标签中,并带有安全页脚

  4. 域名控制 — 云元数据端点被完全阻止;银行/电子邮件域名会触发警告;仅限隐身的域名强制执行隐身模式

此外,所有输出都会被扫描凭据模式(API 密钥、令牌、JWT)并在返回前进行脱敏处理。

工具 (11)

工具

用途

chrome_set_mode

在隐身/快速模式之间切换

chrome_navigate

导航到 URL

chrome_snapshot

获取清理后的辅助功能树

chrome_screenshot

截取 PNG 截图

chrome_click

点击元素(隐身模式下使用贝塞尔鼠标)

chrome_type

输入文本(隐身模式下使用高斯延迟)

chrome_tabs

列出/切换/创建/关闭标签页

chrome_evaluate

在页面上下文中运行 JS(输出已脱敏)

chrome_wait

等待选择器或超时

chrome_scroll

向上/向下滚动(隐身模式下有抖动)

chrome_page_info

获取当前 URL、标题、域名风险

设置

  1. 使用 CDP 启动 Chrome:

    /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
      --remote-debugging-port=9222 \
      --user-data-dir=~/.chrome-debug-profile
  2. 安装并运行:

    npm install
    npm start
  3. 在你的 MCP 配置中注册:

    {
      "chrome-stealth": {
        "command": "node",
        "args": ["path/to/chrome-mcp/index.js"],
        "env": { "CDP_ENDPOINT": "http://127.0.0.1:9222" }
      }
    }

仅限隐身的域名

LinkedIn (linkedin.com, www.linkedin.com) 强制执行隐身模式——快速模式被阻止。这在 5 个层面强制执行:导航、模式切换、每次交互、重定向后和标签页切换。

依赖

  • @modelcontextprotocol/sdk — MCP 协议实现

  • playwright-core — Chrome DevTools Protocol 连接

许可证

MIT

Available Tools

11 tools
chrome_clickA

Click an element. Stealth: Bezier mouse + jitter. Fast: instant. Examples: "button:has-text('Sign in')", "#search-input"

Inputs: selector (required).

chrome_evaluateA

Execute JavaScript in page context. Output scanned for credential leaks. Read-only on stealth-only domains (LinkedIn): expressions that write to the page are refused, use chrome_type and chrome_click.

Inputs: expression (required).

chrome_navigateA

Navigate the current tab to a URL. Blocked domains rejected. Sensitive domains trigger warnings.

Inputs: url (required).

chrome_page_infoA

Get current URL, title, domain risk level

Inputs: no named parameters.

chrome_screenshotC

Take a screenshot of the current page

Inputs: fullPage.

chrome_scrollC

Scroll up/down. Stealth: jittered steps. Fast: instant.

Inputs: direction (required), amount.

chrome_set_modeA

Switch between "fast" mode (default, instant actions, no delays) and "stealth" mode (human-like delays, Bezier mouse, anti-detection). LinkedIn auto-enforces stealth and blocks fast mode.

Inputs: mode (required).

chrome_snapshotB

Get sanitized text snapshot. Hidden elements stripped. Content wrapped in trust labels. Injection patterns flagged.

Inputs: no named parameters.

chrome_tabsC

List/switch/create/close tabs

Inputs: action (required), url, index.

chrome_typeB

Type text. Stealth: Gaussian delays + thinking pauses, line breaks typed as Shift+Enter (bare Enter only via pressEnter). Fast: instant. Credential patterns blocked.

Inputs: text (required), selector, pressEnter.

chrome_waitC

Wait for a selector or fixed time

Inputs: timeout, selector.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 11 tools

    Disambiguation4/5

    Most tools target a clearly distinct action (navigate, click, type, scroll, wait) with no real overlap. The main soft spots are chrome_page_info vs chrome_snapshot vs chrome_screenshot (all read page state in different forms) and chrome_evaluate vs chrome_type/click, though the descriptions do clarify the boundaries and stealth-mode restrictions.

    Naming Consistency4/5

    All tools share a consistent chrome_ snake_case prefix, making the set highly predictable. A few are noun-only (chrome_page_info, chrome_snapshot, chrome_screenshot) while the rest follow verb_noun, which is a minor but noticeable deviation.

    Tool Count5/5

    Eleven tools is well-scoped for a browser automation server, covering the essential primitives without redundancy. Each tool earns its place and there is no obvious clutter.

    Completeness3/5

    The core browsing lifecycle (navigate, inspect, interact, tabs, wait) is covered, but notable gaps remain: chrome_type explicitly references 'pressEnter' yet no key-press/hover/select-dropdown tool exists, and there is no back/forward or cookie/storage management. Agents will hit dead ends on common keyboard and form interactions.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      An MCP server for anti-detection browser automation that uses Camoufox to bypass bot detection and spoof digital fingerprints. It enables AI agents to perform human-like web interactions, including realistic cursor movements, humanized click delays, and automatic cookie popup dismissal.
      36
      84 npm
      7
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A stealth-enhanced browser automation MCP server for AI agents to interact with websites while bypassing anti-bot detection mechanisms like Cloudflare and reCAPTCHA.
      9
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Browser automation MCP server using Camoufox anti-detect browser with fingerprint spoofing, geolocation/timezone spoofing, and human-like cursor movement.
      14
      1
      Apache 2.0