@ai-jshook/mcp 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +36 -38
- package/README.md +471 -564
- package/dist/modules/collector/CodeCollector.d.ts +5 -0
- package/dist/modules/collector/CodeCollector.d.ts.map +1 -1
- package/dist/modules/collector/CodeCollector.js +61 -1
- package/dist/modules/collector/CodeCollector.js.map +1 -1
- package/dist/modules/emulator/templates/chrome-env.d.ts +2 -2
- package/dist/server/MCPServer.d.ts +5 -8
- package/dist/server/MCPServer.d.ts.map +1 -1
- package/dist/server/MCPServer.js +720 -693
- package/dist/server/MCPServer.js.map +1 -1
- package/dist/services/LLMService.d.ts.map +1 -1
- package/dist/services/LLMService.js +0 -1
- package/dist/services/LLMService.js.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +0 -12
- package/dist/utils/config.js.map +1 -1
- package/package.json +97 -94
- package/server.json +39 -39
- package/tsconfig.dev.json +14 -14
- package/CLAUDE.md +0 -170
- package/bun.lock +0 -1484
package/server.json
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json",
|
|
3
|
-
"name": "io.github.wuji1/jshook-reverse-tool",
|
|
4
|
-
"description": "AI-powered JavaScript reverse engineering tool with 80+ MCP tools for browser automation, debugging, network monitoring, and intelligent hooking",
|
|
5
|
-
"version": "0.1.0",
|
|
6
|
-
"homepage": "https://github.com/wuji1/jshook-reverse-tool",
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"keywords": [
|
|
9
|
-
"mcp",
|
|
10
|
-
"javascript",
|
|
11
|
-
"reverse-engineering",
|
|
12
|
-
"browser-automation",
|
|
13
|
-
"debugging",
|
|
14
|
-
"deobfuscation",
|
|
15
|
-
"crypto-detection",
|
|
16
|
-
"hook",
|
|
17
|
-
"ai-powered",
|
|
18
|
-
"puppeteer",
|
|
19
|
-
"chrome-devtools",
|
|
20
|
-
"network-monitoring",
|
|
21
|
-
"anti-detection",
|
|
22
|
-
"captcha"
|
|
23
|
-
],
|
|
24
|
-
"packages": [
|
|
25
|
-
{
|
|
26
|
-
"registry_type": "npm",
|
|
27
|
-
"identifier": "jshook-reverse-tool",
|
|
28
|
-
"version": "0.1.0"
|
|
29
|
-
}
|
|
30
|
-
],
|
|
31
|
-
"author": {
|
|
32
|
-
"name": "wuji1",
|
|
33
|
-
"url": "https://github.com/wuji1"
|
|
34
|
-
},
|
|
35
|
-
"repository": {
|
|
36
|
-
"type": "git",
|
|
37
|
-
"url": "https://github.com/wuji1/jshook-reverse-tool.git"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json",
|
|
3
|
+
"name": "io.github.wuji1/jshook-reverse-tool",
|
|
4
|
+
"description": "AI-powered JavaScript reverse engineering tool with 80+ MCP tools for browser automation, debugging, network monitoring, and intelligent hooking",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"homepage": "https://github.com/wuji1/jshook-reverse-tool",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"mcp",
|
|
10
|
+
"javascript",
|
|
11
|
+
"reverse-engineering",
|
|
12
|
+
"browser-automation",
|
|
13
|
+
"debugging",
|
|
14
|
+
"deobfuscation",
|
|
15
|
+
"crypto-detection",
|
|
16
|
+
"hook",
|
|
17
|
+
"ai-powered",
|
|
18
|
+
"puppeteer",
|
|
19
|
+
"chrome-devtools",
|
|
20
|
+
"network-monitoring",
|
|
21
|
+
"anti-detection",
|
|
22
|
+
"captcha"
|
|
23
|
+
],
|
|
24
|
+
"packages": [
|
|
25
|
+
{
|
|
26
|
+
"registry_type": "npm",
|
|
27
|
+
"identifier": "jshook-reverse-tool",
|
|
28
|
+
"version": "0.1.0"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"author": {
|
|
32
|
+
"name": "wuji1",
|
|
33
|
+
"url": "https://github.com/wuji1"
|
|
34
|
+
},
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "https://github.com/wuji1/jshook-reverse-tool.git"
|
|
38
|
+
}
|
|
39
|
+
}
|
package/tsconfig.dev.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"module": "CommonJS"
|
|
5
|
-
},
|
|
6
|
-
"ts-node": {
|
|
7
|
-
"esm": false,
|
|
8
|
-
"transpileOnly": true,
|
|
9
|
-
"compilerOptions": {
|
|
10
|
-
"module": "CommonJS"
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"module": "CommonJS"
|
|
5
|
+
},
|
|
6
|
+
"ts-node": {
|
|
7
|
+
"esm": false,
|
|
8
|
+
"transpileOnly": true,
|
|
9
|
+
"compilerOptions": {
|
|
10
|
+
"module": "CommonJS"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
package/CLAUDE.md
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
# CLAUDE.md
|
|
2
|
-
|
|
3
|
-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
-
|
|
5
|
-
## Project Overview
|
|
6
|
-
|
|
7
|
-
**JSHook** 是一个 AI 驱动的 JavaScript 逆向工程工具,提供 100+ 专业 MCP 工具用于浏览器自动化、调试、网络监控和智能 Hook。
|
|
8
|
-
|
|
9
|
-
### Architecture
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
jshook-reverse-tool/ # 主项目 (MCP 服务器源码)
|
|
13
|
-
├── src/ # TypeScript 源码
|
|
14
|
-
├── dist/ # 编译输出 (MCP 服务器)
|
|
15
|
-
└── CLAUDE.md # 本文件
|
|
16
|
-
|
|
17
|
-
jshook-plugin/ # Claude Code Plugin
|
|
18
|
-
├── .mcp.json # MCP 服务器配置
|
|
19
|
-
├── skills/ # Agent Skills (6个)
|
|
20
|
-
│ ├── browser-automation/
|
|
21
|
-
│ ├── debugger-tools/
|
|
22
|
-
│ ├── network-monitoring/
|
|
23
|
-
│ ├── ai-hooking/
|
|
24
|
-
│ ├── performance-analysis/
|
|
25
|
-
│ └── cache-management/
|
|
26
|
-
└── README.md # 插件文档
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### Dual Mode Operation
|
|
30
|
-
|
|
31
|
-
此项目支持两种运行模式:
|
|
32
|
-
|
|
33
|
-
1. **Standalone Mode** (独立 MCP 服务器)
|
|
34
|
-
```bash
|
|
35
|
-
npm run dev
|
|
36
|
-
# 启动独立 MCP 服务器,通过 OPENAI_API_KEY/ANTHROPIC_API_KEY 调用 LLM
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
2. **Plugin Mode** (Claude Code Plugin) - **Recommended**
|
|
40
|
-
```json
|
|
41
|
-
// .mcp.json
|
|
42
|
-
{
|
|
43
|
-
"mcpServers": {
|
|
44
|
-
"jshook": {
|
|
45
|
-
"command": "node",
|
|
46
|
-
"args": ["../dist/index.js"]
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
- MCP 服务器运行在后台
|
|
52
|
-
- Claude Code 的 Agent Skills 直接调用 MCP 工具
|
|
53
|
-
- AI 分析由 Claude Code 内置模型处理(无需额外 API Key)
|
|
54
|
-
|
|
55
|
-
### Plugin Installation
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
# 1. 在 Claude Code 中添加插件
|
|
59
|
-
# 指向 jshook-plugin/.mcp.json
|
|
60
|
-
|
|
61
|
-
# 2. 使用 Skills 进行逆向工作
|
|
62
|
-
/js-reverse https://example.com/api "header" "X-Signature"
|
|
63
|
-
# 或手动调用 MCP 工具
|
|
64
|
-
browser_launch()
|
|
65
|
-
page_navigate(url="https://example.com")
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Development Commands
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
# 开发模式(自动重启)
|
|
72
|
-
npm run dev
|
|
73
|
-
|
|
74
|
-
# 构建项目
|
|
75
|
-
npm run build
|
|
76
|
-
|
|
77
|
-
# 运行测试
|
|
78
|
-
npm test
|
|
79
|
-
|
|
80
|
-
# 代码检查
|
|
81
|
-
npm run lint
|
|
82
|
-
|
|
83
|
-
# 代码格式化
|
|
84
|
-
npm run format
|
|
85
|
-
|
|
86
|
-
# 完整检查
|
|
87
|
-
npm run check
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
## Architecture
|
|
91
|
-
|
|
92
|
-
### Source Directory (src/)
|
|
93
|
-
|
|
94
|
-
```
|
|
95
|
-
src/
|
|
96
|
-
├── index.ts # MCP 服务器入口
|
|
97
|
-
├── server/ # MCP 服务器层
|
|
98
|
-
│ ├── MCPServer.ts # 主服务器类 (使用 McpServer API)
|
|
99
|
-
│ ├── BrowserToolHandlers.ts # 35 浏览器工具
|
|
100
|
-
│ ├── DebuggerToolHandlers.ts # 38 调试器工具
|
|
101
|
-
│ ├── AIHookToolHandlers.ts # AI Hook 工具
|
|
102
|
-
│ └── AdvancedToolHandlers.ts # 网络/性能工具
|
|
103
|
-
├── modules/ # 核心功能模块
|
|
104
|
-
│ ├── collector/ # 代码收集器 (DOM/XHR/脚本)
|
|
105
|
-
│ ├── debugger/ # 调试器 (断点/调用栈)
|
|
106
|
-
│ ├── deobfuscator/ # 反混淆器 (基于规则)
|
|
107
|
-
│ ├── crypto/ # 加密检测 (规则 + AI)
|
|
108
|
-
│ ├── captcha/ # 验证码检测
|
|
109
|
-
│ ├── stealth/ # 反检测脚本
|
|
110
|
-
│ ├── hook/ # Hook 管理器
|
|
111
|
-
│ └── monitor/ # 控制台/性能监控
|
|
112
|
-
├── services/
|
|
113
|
-
│ └── LLMService.ts # LLM API 封装 (独立模式用)
|
|
114
|
-
├── types/
|
|
115
|
-
│ └── index.ts # 核心类型定义
|
|
116
|
-
└── utils/
|
|
117
|
-
├── TokenBudgetManager.ts # Token 预算管理
|
|
118
|
-
├── UnifiedCacheManager.ts # 统一缓存管理
|
|
119
|
-
└── logger.ts # 日志系统
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Plugin Skills (jshook-plugin/skills/)
|
|
123
|
-
|
|
124
|
-
| Skill | Tools | Description |
|
|
125
|
-
|-------|-------|-------------|
|
|
126
|
-
| `browser-automation/` | 35+ | 页面导航、DOM操作、反检测、CAPTCHA处理 |
|
|
127
|
-
| `debugger-tools/` | 38+ | 断点、调用栈、监控表达式 |
|
|
128
|
-
| `network-monitoring/` | 6+ | HTTP 请求/响应捕获 |
|
|
129
|
-
| `ai-hooking/` | 7 | AI 驱动 Hook 生成 |
|
|
130
|
-
| `performance-analysis/` | 4 | Web Vitals、代码覆盖率 |
|
|
131
|
-
| `cache-management/` | 6 | Token 预算、缓存清理 |
|
|
132
|
-
|
|
133
|
-
### Key Patterns
|
|
134
|
-
|
|
135
|
-
1. **MCP Tool Pattern**: 使用 `McpServer.registerTool()` 注册工具
|
|
136
|
-
2. **Zod Schema**: 使用 zod 定义输入输出模式
|
|
137
|
-
3. **Singleton Pattern**: `TokenBudgetManager`、`UnifiedCacheManager`
|
|
138
|
-
4. **ES Modules**: 导入需带 `.js` 扩展名
|
|
139
|
-
5. **Claude Code Integration**: Plugin 模式下,AI 分析由 Claude Code Agent Skills 完成
|
|
140
|
-
|
|
141
|
-
### Module Dependencies
|
|
142
|
-
|
|
143
|
-
```
|
|
144
|
-
MCPServer
|
|
145
|
-
├── BrowserToolHandlers → collector + stealth + captcha
|
|
146
|
-
├── DebuggerToolHandlers → DebuggerManager
|
|
147
|
-
├── AIHookToolHandlers → HookManager
|
|
148
|
-
├── Deobfuscator → 规则引擎 (独立模式: LLMService)
|
|
149
|
-
├── CryptoDetector → 规则引擎 (独立模式: LLMService)
|
|
150
|
-
├── TokenBudgetManager (singleton)
|
|
151
|
-
└── UnifiedCacheManager (singleton)
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
## Tech Stack
|
|
155
|
-
|
|
156
|
-
| Category | Technology |
|
|
157
|
-
|----------|------------|
|
|
158
|
-
| Runtime | Node.js 18+, TypeScript 5.0+ |
|
|
159
|
-
| Browser Automation | Puppeteer, Chrome DevTools Protocol |
|
|
160
|
-
| MCP Protocol | @modelcontextprotocol/sdk |
|
|
161
|
-
| AST Processing | @babel/parser, @babel/traverse, @babel/types |
|
|
162
|
-
| Testing | Jest, ts-jest |
|
|
163
|
-
|
|
164
|
-
## Important Notes
|
|
165
|
-
|
|
166
|
-
1. **Plugin Mode 优先**: 推荐使用 Claude Code Plugin 模式,AI 分析更自然
|
|
167
|
-
2. **独立模式**: 需要 `OPENAI_API_KEY` 或 `ANTHROPIC_API_KEY`
|
|
168
|
-
3. **首次运行**: Puppeteer 会自动下载 Chromium
|
|
169
|
-
4. **工具数量**: 100+ MCP 工具,分布在多个 Handlers 文件
|
|
170
|
-
5. **大数据处理**: 大型数据通过 `detailId` 返回,防止上下文溢出
|