by zhizhuodemao
AI Agent-first JS 逆向 MCP Server:有头 Chrome 调试、断点、网络/WebSocket 分析、Patchright 反检测,可选 CloakBrowser。
# Add to your Claude Code skills
git clone https://github.com/zhizhuodemao/js-reverse-mcpGuides for using ai agents skills like js-reverse-mcp.
Last scanned: 6/23/2026
{
"issues": [
{
"type": "npm-audit",
"message": "@modelcontextprotocol/sdk: Anthropic's MCP TypeScript SDK has a ReDoS vulnerability",
"severity": "high"
},
{
"type": "npm-audit",
"message": "ajv: ajv has ReDoS when using `$data` option",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "body-parser: body-parser is vulnerable to denial of service when url encoding is used",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "brace-expansion: brace-expansion: Zero-step sequence causes process hang and memory exhaustion",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "diff: jsdiff has a Denial of Service vulnerability in parsePatch and applyPatch",
"severity": "low"
},
{
"type": "npm-audit",
"message": "fast-uri: fast-uri vulnerable to path traversal via percent-encoded dot segments",
"severity": "high"
},
{
"type": "npm-audit",
"message": "flatted: flatted vulnerable to unbounded recursion DoS in parse() revive phase",
"severity": "high"
},
{
"type": "npm-audit",
"message": "js-yaml: JS-YAML: Quadratic-complexity DoS in merge key handling via repeated aliases",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "lodash: lodash vulnerable to Code Injection via `_.template` imports key names",
"severity": "high"
},
{
"type": "npm-audit",
"message": "minimatch: minimatch has a ReDoS via repeated wildcards with non-matching literal in pattern",
"severity": "high"
},
{
"type": "npm-audit",
"message": "path-to-regexp: path-to-regexp vulnerable to Denial of Service via sequential optional groups",
"severity": "high"
},
{
"type": "npm-audit",
"message": "picomatch: Picomatch: Method Injection in POSIX Character Classes causes incorrect Glob Matching",
"severity": "high"
},
{
"type": "npm-audit",
"message": "qs: qs's arrayLimit bypass in comma parsing allows denial of service",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "rollup: Rollup 4 has Arbitrary File Write via Path Traversal",
"severity": "high"
},
{
"type": "npm-audit",
"message": "sinon: Vulnerability found",
"severity": "low"
},
{
"type": "npm-audit",
"message": "tar: node-tar applies PAX size override to intermediary GNU long-name/long-link headers, causing tar parser interpretation differential (file smuggling)",
"severity": "medium"
}
],
"status": "WARNING",
"scannedAt": "2026-06-23T07:49:14.572Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}js-reverse-mcp is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by zhizhuodemao. AI Agent-first JS 逆向 MCP Server:有头 Chrome 调试、断点、网络/WebSocket 分析、Patchright 反检测,可选 CloakBrowser。. It has 1,976 GitHub stars.
js-reverse-mcp returned warnings in SkillsLLM's automated security scan. It has no critical vulnerabilities, but review the flagged issues in the Security Report section before adding it to your workflow.
Clone the repository with "git clone https://github.com/zhizhuodemao/js-reverse-mcp" and add it to your Claude Code skills directory (see the Installation section above).
js-reverse-mcp is primarily written in TypeScript. It is open-source under zhizhuodemao on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh js-reverse-mcp against similar tools.
No comments yet. Be the first to share your thoughts!
Requires a passing catalog security scan. Resolve the flagged issues and resubmit to enable featuring.
English | 中文
AI-first / AI-native 的 JavaScript 逆向工程 MCP Server,让你的 AI 编码助手(如 Claude、Cursor、Copilot)能够像分析师一样持续调试、定位、保存和复盘网页中的 JavaScript 行为。
它不是把 Chrome DevTools API 原样搬给模型,而是把脚本、断点、网络、WebSocket、浏览器状态和本地文件 I/O 重新组织成适合 AI Agent 连续推理和操作的工具。反检测是其中一部分能力:默认基于 Patchright 协议层 stealth,对强反爬站点可选启用 CloakBrowser 源码层指纹模式。
--cloak 使用 CloakBrowser 二进制无需安装,直接在 MCP 客户端配置中添加:
{
"mcpServers": {
"js-reverse": {
"command": "npx",
"args": ["js-reverse-mcp"]
}
}
}
claude mcp add js-reverse npx js-reverse-mcp
codex mcp add js-reverse -- npx js-reverse-mcp
进入 Cursor Settings -> MCP -> New MCP Server,使用上面的配置。
code --add-mcp '{"name":"js-reverse","command":"npx","args":["js-reverse-mcp"]}'
git clone https://github.com/zhizhuodemao/js-reverse-mcp.git
cd js-reverse-mcp
npm install
npm run build
然后在 MCP 配置中使用本地路径:
{
"mcpServers": {
"js-reverse": {
"command": "node",
"args": ["/你的路径/js-reverse-mcp/build/src/index.js"]
}
}
}
这个项目的核心目标不是“能操作浏览器”,而是让 AI Agent 能稳定完成一轮真实 JS 逆向任务:打开页面、过风控、定位脚本、保存源码、设置断点、触发行为、检查运行时、导出网络材料、复现状态,然后继续推理。
几个设计取向贯穿在代码里:
list_network_requests 既能列索引,也能按 reqid 查详情,还能用 outputFile 导出精确材料;evaluate_script 既能在页面执行,也能在断点 call frame 执行,还能接收 localFilePath 输入。save_script_source、list_network_requests(..., outputFile)、evaluate_script(..., localFilePath) 让 Agent 能在浏览器、网络和本地文件之间往返,而不是把大段代码或二进制数据塞进聊天上下文。--isolated 提供一次性干净环境;clear_site_data 只清当前站点相关状态,用来反复复现 cookie 生成、风控初始化和请求链路。反检测是 js-reverse-mcp 的底层支撑能力之一。包装层(这个 MCP 自己)零 JS 注入、不做 Object.defineProperty hack(那本身就是检测信号)。所有反检测都在两个互不重叠的层:
| 层 | 默认模式 | --cloak 模式 |
|---|---|---|
| 协议层(CDP) | Patchright:不调 Runtime.enable / Console.enable,在 isolated world 里执行 evaluate,移除自动化 launch flag |
同 |
| 源码层(C++ 二进制 patch) | 无 —— 直接用系统 Google Chrome | CloakBrowser 二进制(49 个 C++ patch:navigator.webdriver、canvas、WebGL、audio、GPU、字体、屏幕、WebRTC、TLS) |
| Profile 目录 | ~/.cache/chrome-devtools-mcp/chrome-profile(持久化登录态) |
~/.cache/chrome-devtools-mcp/cloak-profile(与默认物理隔离) |
| 实际浏览器 | 你装的 Google Chrome(带 Web Store、扩展、sync) | 定制 Chromium 编译版(无 Google 服务、无 Web Store) |
另外几个导航级措施(两种模式都生效):
Network.enable / Debugger.enable,请求/控制台收集只走 Playwright 监听器,直到某个工具显式需要 CDP 才激活new_page 默认带 referer: https://www.google.com/何时开 --cloak:只在以上还不够、被站点指纹拦截时才用。详见 docs/cloak.md。
| 工具 | 描述 |
|---|---|
select_page |
列出打开的页面,或按索引选择调试上下文 |
new_page |
创建新页面并导航到 URL |
navigate_page |
导航、后退、前进或刷新页面 |
select_frame |
列出所有 frame(iframe),或选择执行上下文 |
take_screenshot |
截取页面截图 |
| 工具 | 描述 |
|---|---|
list_scripts |
列出页面中所有加载的 JavaScript 脚本 |
get_script_source |
获取脚本源码片段,支持行范围或字符偏移 |
save_script_source |
保存完整脚本源码到本地文件(适用于大型/压缩/WASM文件) |
search_in_sources |
在所有脚本中搜索字符串或正则表达式 |
| 工具 | 描述 |
|---|---|
set_breakpoint_on_text |
通过搜索代码文本自动设置断点(适用于压缩代码) |
break_on_xhr |
按 URL 模式设置 XHR/Fetch 断点 |
remove_breakpoint |
按 ID、URL 或全部移除断点,自动恢复执行 |
list_breakpoints |
列出所有活动断点 |
get_paused_info |
获取暂停状态、调用栈和作用域变量 |
pause_or_resume |
切换暂停/恢复执行 |
step |
单步调试(over/into/out),返回位置和源码上下文 |
| 工具 | 描述 |
|---|---|
list_network_requests |
列出网络请求、查看详情,或导出 header/body/query 等原始材料 |
get_request_initiator |
获取网络请求的 JavaScript 调用栈 |
get_websocket_messages |
列出 WebSocket 连接、分析消息模式或获取消息详情 |
| 工具 | 描述 |
|---|---|
clear_site_data |
清理当前站点相关 cookies、HTTP cache、origin storage 和 sessionStorage |
| 工具 | 描述 |
|---|---|
evaluate_script |
在页面或断点上下文执行 JavaScript,支持主世界、保存结果和读取一个本地输入文件 |
list_console_messages |
列出控制台消息,或按 msgid 获取单条详情 |
打开 https://example.com 并列出所有加载的 JS 脚本
在所有脚本中搜索包含 "encrypt" 的代码
在加密函数入口处设置断点
在页面上触发操作,断点命中后检查参数、调用栈和作用域变量
列出 WebSocket 连接,分析消息模式,查看特定类型的消息内容
因为导航阶段会刻意保持 CDP 静默,首次进入目标页时不会立即打开 Network / Debugger 域。推荐流程是先过风控,再刷新捕获:
1. new_page 打开目标页
2. 调用 list_network_requests 激活 collectors
3. navigate_page(type="reload") 刷新页面
4. 再次 list_network_requests 查看完整请求
5. 对关键 reqid 使用 outputFile 导出原始材料
1. clear_site_data 清理当前站点状态
2. navigate_page(type="reload") 重新触发初始化
3. list_network_requests 找到设置 cookie 或提交 sensor 的请求
4. 导出 requestBody / responseHeaders / responseBody
5. 用 evaluate_script + localFilePath 在页面上下文中复算或验证
CLI 刻意精简到 4 个 flag,全部可选。99% 场景默认即可。
| 选项 | 描述 | 默认值 |
|---|---|---|
--cloak |
切换到 CloakBrowser 隐身二进制(取代系统 Chrome)。叠加 49 个 C++ 源码层指纹 patch。首次启动自动下载 ~200MB 二进制;指纹身份按 profile 持久化。详见 docs/cloak.md。 | false |
--isolated |
使用临时 user-data-dir(cookies/localStorage 不保留,关闭时自动清理) | false |
--browserUrl, -u |
连接到已运行的 Chrome 实例(CDP HTTP 端点,如 http://127.0.0.1:9222)。MCP 会自动探测出 WebSocket debugger URL。本地 Chrome、AdsPower、BitBrowser 等怎么拿到这个端点详见 docs/cdp-endpoint.md。 |
– |
--logFile |
调试日志输出文件路径(配合 DEBUG=* 环境变量得到详细日志) |
– |
默认 —— 系统 Chrome + 持久化登录态(绝大多数调试场景推荐):
{
"mcpServers": {
"js-reverse": {
"command": "npx",
"args": ["js-reverse-mcp"]
}
}
}
--cloak —— 强反爬站点(Cloudflare Turnstile / DataDome / FingerprintJS 防护):
强烈推荐:先把二进制预下载好(一次性,~30–60 秒)。不做这一步的话,首次启动带
--cloak的 MCP 会静默下载 ~200MB,看起来像 MCP 卡住了:npx cloakbrowser install(
cloakbrowser包已经通过optionalDependencies一起装好,这条命令只是触发它自带的二进制下载逻辑,有进度条)
{
"mcpServers": {
"js-reverse-cloak": {