js-reverse-mcp
zhizhuodemao · zhizhuodemao/js-reverse-mcp
An MCP server enabling AI agents to perform JavaScript reverse engineering with headed Chrome debugging, network analysis, and anti-detection capabilities.
AI Agent-first JS 逆向 MCP Server:有头 Chrome 调试、断点、网络/WebSocket 分析、Patchright 反检测,可选 CloakBrowser。
Preview
What you can do with it
- Debug complex JavaScript code on a webpage using an AI agent.
- Analyze network requests and WebSocket communications for web scraping or security research.
- Bypass anti-bot measures on websites for automated data collection.
Verified live · 24 tools
We started this MCP server in an isolated sandbox and it exposed these tools:
break_on_xhrSets a URL-substring breakpoint for a future XHR/Fetch when runtime request arguments, local variables, or payload construction must be inspected. For an already captured request, call get_request_ini
clear_network_requestsDiscard captured HTTP(S) evidence for the currently selected page after confirm=true. Use this immediately before reproducing an action when a clean network capture window is needed; do not use it to
clear_site_dataIrreversibly clear browser state after confirm=true to create a clean replay environment for the selected page. Use this before replaying login, session creation, storage initialization, or other stat
click_elementPerforms one verified, auditable click in the currently selected frame. Use it when the task requires activating a known button, link, or control after selecting the correct page/frame and identifying
evaluate_scriptEvaluates one focused JavaScript function for DOM/page state, web storage, page-defined globals, a paused-frame expression, or browser-side processing of one local file. Use it when those runtime valu
get_paused_infoInspects the current call stack, source locations, and selected call-frame scopes after a code/XHR breakpoint or explicit pause has stopped execution. It neither creates a pause nor resumes one. Retur
get_request_initiatorNon-pausing first action for tracing which JavaScript initiated a retained HTTP request when CDP initiator evidence was active. Pass the reqid from list_network_requests; because initiator capture sta
get_script_sourceReads a small source region around a search match, paused location, or known statement without executing or pausing the page. Select by URL when available because URL-backed scripts can be resolved ag
get_websocket_messagesInspect captured bidirectional WebSocket connections and frame payloads for the selected page. Use this for WebSocket, socket, live-update, push, streaming, or realtime message flows; use list_network
list_breakpointsInspects code and XHR/Fetch breakpoints managed by this MCP session before reproducing an action or cleaning up debugger state. Returns current code breakpointIds and the exact XHR URL patterns needed
list_console_messagesInspects console messages and uncaught page errors captured for the selected page. Use it to diagnose runtime failures, warnings, application logs, or values already emitted by page code; use search_i
list_network_requestsInspect captured HTTP(S) traffic for the currently selected page. Use this for API calls, request or response headers and bodies, redirects, authentication/session flows, replay or signing inputs, and
list_scriptsDiscovers JavaScript currently loaded in the selected debugger context—the main frame by default, or the frame chosen with select_frame. Use select_frame first for iframe-specific source/debugger work
navigate_pageNavigates, reloads, or moves through history in the currently selected page. Use it to reproduce requests, trigger configured breakpoints, refresh scripts, or continue a workflow in the same tab; use
new_pageOpens a separate browser page for a URL, reusing an existing about:blank startup tab when available. Use this when the task needs another tab or should preserve the currently selected page; use naviga
npx js-reverse-mcp · 08/10/2026
Safety check
No risky patterns found in the files we scanned.
Automated scan of the repo files. Always review code you run.
From the README
JS Reverse MCP
English | 中文
AI-first / AI-native 的 JavaScript 逆向工程 MCP Server,让你的 AI 编码助手(如 Claude、Cursor、Copilot)能够像分析师一样持续调试、定位、保存和复盘网页中的 JavaScript 行为。
它不是把 Chrome DevTools API 原样搬给模型,而是把脚本、断点、网络、WebSocket、浏览器状态和本地文件 I/O 重新组织成适合 AI Agent 连续推理和操作的工具。反检测是其中一部分能力:默认使用为本 MCP 重新编译发布、独立维护的 Patchright fork 提供协议层 stealth,对强反爬站点可选启用 CloakBrowser 源码层指纹模式。
☁️ 赞助 · Sponsored by IPWO
IPWO 住宅代理支持灵活的代理配置,开发者可以根据不同任务选择相应的网络环境,用于网页访问、请求测试、地区化内容分析及自动化工作流。
对于涉及 JS 逆向、浏览器调试和 Web 网络分析的项目,住宅代理也可以作为网络环境的一种补充选择,帮助开发者更灵活地满足不同地区的访问与测试需求。
👉 免费测试入口,9 折优惠码:0204
☁️ 赞助 · Sponsored by Infistar.cc 无限星河
js-reverse-mcp × Infistar.cc 无限星河|全模型 API · 稳定驱动 AI 辅助调试
感谢 Infistar.cc 无限星河赞助并为 js-reverse-mcp 提供模型服务支持!
- ⚡ 稳定承载复杂调试任务:提供企业级高并发通道与多节点冗余,价格低至官方渠道 1 折,减少限流、429 和长任务断连问题。
- 🧠 一个 API Key 接入主流模型:支持 ChatGPT、Claude、Gemini、Kimi、GLM、DeepSeek 等模型,适配 Claude Code、Codex、Cursor 等 AI 编程工具。
- 🔎 助力授权调试与安全研究:适用于脚本检索、断点分析、网络请求追踪、调用栈检查和代码逻辑理解等多步骤任务。
- 📦 项目用户专属福利:通过 专属推广链接 注册并完成首次调用,即可领取 5 美元等值测试额度 / 首充专属优惠。
定位:Claude Code / Codex 模型 API 配置支持。
功能特点
- AI-native 工具设计:工具粒度、输出边界和错误提示都围绕 Agent 决策设计,避免把模型推向无效下一步
- 可复盘工作流:脚本源码、网络原始数据、二进制结果都能导出到本地文件,再作为后续分析输入
- 断点上下文执行:暂停时可直接在 call frame 中求值,检查作用域变量,单步执行并返回源码上下文
- 脚本分析:列出所有加载的 JS,搜索代码,获取/保存源码,自动格式化大型压缩脚本
- 网络与 WebSocket 分析:请求调用栈、XHR 断点、Set-Cookie 识别、原始 body/header 导出、WebSocket 消息分组
- 浏览器状态重放:清理当前站点 cookies / cache / storage / sessionStorage,配合 reload 复现 cookie 和风控流程
- 默认有头 + 持久化登录态:看得到浏览器,cookies / localStorage 跨会话保留
- 专用 Patchright 内核:默认依赖本项目独立维护的 Patchright fork,持续修复上游已知的共享实现特征
- 可选反检测层:专用 Patchright 协议层 stealth 默认启用;强反爬站点可加
--cloak使用 CloakBrowser 二进制
专用 Patchright fork
js-reverse-mcp 不再直接依赖 Patchright 的大众发行包,而是使用专门为本 MCP 编译发布的 @zhizhuodemao/patchright。这个 fork 会在独立仓库持续维护,并随本 MCP 的实际检测样本演进。
- 不再直接依赖 Patchright 大众发行包
- 针对已确认的上游共享实现特征进行协议层调整并重新编译发布
- 反检测调整不依赖页面级 JS 注入
- 保留 evaluate、locator 和页面控制等原始能力
- fork 在面向本 MCP 的专用仓库中持续维护
公开文档仅说明设计边界,不展开内部检测样本与实现细节。专用 fork 的目标是减少已确认的共享实现特征,而不是承诺浏览器自动化绝对不可检测。
系统要求
快速开始(npx)
无需安装,直接在 MCP 客户端配置中添加:
{
"mcpServers": {
"js-reverse": {
"command": "npx",
"args": ["js-reverse-mcp"]
}
}
}
Claude Code
claude mcp add js-reverse npx js-reverse-mcp
如果你还没有可用的模型 API,或者需要配置自定义 API 地址,可以参考:Claude Code / Codex 第三方模型 API 配置教程。
Codex
codex mcp add js-reverse -- npx js-reverse-mcp
如果你还没有可用的模型 API,或者需要配置自定义 API 地址,可以参考:Claude Code / Codex 第三方模型 API 配置教程。
Cursor
进入 Cursor Settings -> MCP -> New MCP Server,使用上面的配置。
VS Code Copilot
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-first 设计
这个项目的核心目标不是“能操作浏览器”,而是让 AI Agent 能稳定完成一轮真实 JS 逆向任务:打开页面、过风控、定位脚本、保存源码、设置断点、触发行为、检查运行时、导出网络材料、复现状态,然后继续推理。
几个设计取向贯穿在代码里:
- 工具是 Agent primitives,不是 DevTools 菜单映射:
list_network_requests既能列索引,也能按reqid查详情,还能用outputFile导出精确材料;evaluate_script既能在页面执行,也能在断点 call frame 执行,还能接收localFilePath输入。 - 输出要能指导下一步:列表输出保持短而可扫描;详情输出有边界;长结果提示导出;pending 请求会明确提示先恢复执行,避免 Agent 等一个永远不会完成的 response。
- 本地文件是分析工作台:
save_script_source、list_network_requests(..., outputFile)、evaluate_script(..., localFilePath)让 Agent 能在浏览器、网络和本地文件之间往返,而不是把大段代码或二进制数据塞进聊天上下文。 - 状态可清理、流程可重放:默认 profile 保留登录态;
--isolated提供一次性干净环境;clear_site_data只清当前站点相关状态,用来反复复现 cookie 生成、风控初始化和请求链路。 - 反检测服务于调试链路:CDP 静默导航、真实视口、Google referer、专用 Patchright fork 和 CloakBrowser 的目标都是让 Agent 能进入目标页面继续分析,而不是把项目变成一个泛用爬虫框架。
反检测机制(支撑能力)
反检测是 js-reverse-mcp 的底层支撑能力之一。包装层(这个 MCP 自己)零 JS 注入、不做 Object.defineProperty hack(那本身就是检测信号)。所有反检测都在两个互不重叠的层:
| 层 | 默认模式 | --cloak 模式 |
|---|---|---|
| 协议层(CDP) | 专用 Patchright fork:不调 Runtime.enable / Console.enable,在 isolated world 里执行 evaluate,移除自动化 launch flag,并持续修复已知共享实现特征 | 同 |
| 源码层(C++ 二进制 patch) | 无 —— 直接用系统 Google Chrome | CloakBrowser 二进制(按平台提供源码层指纹 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) |