dejared-mcp 0.1.2 → 0.1.4

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.
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "dejared-mcp-marketplace",
3
+ "owner": {
4
+ "name": "HuynhKhanh1402",
5
+ "email": "huynhkhanh14022004@gmail.com"
6
+ },
7
+ "metadata": {
8
+ "description": "MCP server and Claude Code plugin for exploring, analyzing, and decompiling Java JAR files"
9
+ },
10
+ "plugins": [
11
+ {
12
+ "name": "dejared",
13
+ "source": "./",
14
+ "description": "Explore, analyze, and decompile Java JAR files with structured workflows.",
15
+ "version": "0.1.4",
16
+ "author": {
17
+ "name": "HuynhKhanh1402"
18
+ },
19
+ "license": "MIT",
20
+ "keywords": ["java", "jar", "decompiler", "bytecode", "reverse-engineering", "mcp"],
21
+ "category": "development"
22
+ }
23
+ ]
24
+ }
@@ -1,10 +1,17 @@
1
1
  {
2
2
  "name": "dejared",
3
3
  "description": "Explore, analyze, and decompile Java JAR files with structured workflows.",
4
+ "version": "0.1.4",
4
5
  "author": {
5
6
  "name": "HuynhKhanh1402"
6
7
  },
7
8
  "repository": "https://github.com/HuynhKhanh1402/dejared-mcp",
8
9
  "license": "MIT",
9
- "keywords": ["java", "jar", "decompiler", "bytecode", "reverse-engineering", "mcp"]
10
+ "keywords": ["java", "jar", "decompiler", "bytecode", "reverse-engineering", "mcp"],
11
+ "mcpServers": {
12
+ "dejared": {
13
+ "command": "npx",
14
+ "args": ["-y", "dejared-mcp"]
15
+ }
16
+ }
10
17
  }
package/README.md CHANGED
@@ -1,15 +1,51 @@
1
+ [![npm version](https://img.shields.io/npm/v/dejared-mcp?style=flat-square)](https://www.npmjs.com/package/dejared-mcp)
2
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](LICENSE)
3
+ [![Node.js](https://img.shields.io/badge/Node.js-18%2B-339933?style=flat-square&logo=node.js&logoColor=white)]()
4
+ [![Java](https://img.shields.io/badge/Java-21%2B-ED8B00?style=flat-square&logo=openjdk&logoColor=white)]()
5
+
1
6
  # dejared-mcp
2
7
 
3
- An MCP (Model Context Protocol) server that lets AI assistants explore, analyze, and decompile Java JAR files.
8
+ A Model Context Protocol (MCP) server for exploring, analyzing, and decompiling Java JAR files.
9
+ Designed for AI-powered development tools, dejared-mcp connects your IDE or CLI assistant
10
+ to inspect package structures, search bytecode, and decompile classes
11
+ using CFR, Vineflower, or Procyon.
12
+
13
+ ## Table of Contents
14
+
15
+ - [Overview](#overview)
16
+ - [Prerequisites](#prerequisites)
17
+ - [Quick Start](#quick-start)
18
+ - [Features](#features)
19
+ - [Decompiler Engines](#decompiler-engines)
20
+ - [Installation and Configuration](#installation-and-configuration)
21
+ - [Custom Java Path](#custom-java-path)
22
+ - [Server Configuration](#server-configuration)
23
+ - [How It Works](#how-it-works)
24
+ - [FAQ and Troubleshooting](#faq-and-troubleshooting)
25
+ - [Contributing](#contributing)
26
+ - [Third-Party Licenses](#third-party-licenses)
27
+ - [License](#license)
28
+
29
+ ## Overview
30
+
31
+ dejared-mcp is a Java-based MCP server distributed as an npm package.
32
+ It provides nine tools organized into three categories: discovery, hunting,
33
+ and deep analysis. AI assistants use these tools to navigate JAR file
34
+ structures, search for classes and string literals in bytecode, and
35
+ decompile `.class` files back to readable Java source code.
36
+
37
+ The npm package acts as a thin wrapper that downloads and caches the
38
+ server JAR on first run, then spawns it via `java -jar` using stdio
39
+ transport.
4
40
 
5
41
  ## Prerequisites
6
42
 
7
- - **Node.js 18+** - required for the `npx` wrapper (not needed for pure Java usage)
8
- - **Java 21+** - JRE is sufficient
43
+ - **Node.js** 18 or later
44
+ - **Java** 21 or later (JRE is sufficient)
9
45
 
10
46
  ## Quick Start
11
47
 
12
- Most MCP-compatible tools use a JSON configuration like this:
48
+ Add the following to your MCP client configuration:
13
49
 
14
50
  ```json
15
51
  {
@@ -22,27 +58,56 @@ Most MCP-compatible tools use a JSON configuration like this:
22
58
  }
23
59
  ```
24
60
 
25
- See below for tool-specific instructions.
61
+ See [Installation and Configuration](#installation-and-configuration)
62
+ for tool-specific instructions.
26
63
 
27
- ## MCP Registry
64
+ ## Features
28
65
 
29
- This server is published to the [MCP Registry](https://registry.modelcontextprotocol.io) as `io.github.huynhkhanh1402/dejared`.
66
+ ### Discovery
30
67
 
31
- You can verify it via the registry API:
68
+ Browse and read JAR contents.
32
69
 
33
- ```bash
34
- curl "https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.huynhkhanh1402/dejared"
35
- ```
70
+ | Tool | Description |
71
+ |------|-------------|
72
+ | `dejared_list_packages` | List all packages with class counts |
73
+ | `dejared_list_classes` | List classes in a specific package |
74
+ | `dejared_list_resources` | List non-class resource files |
75
+ | `dejared_read_resource` | Read text resources (YAML, XML, properties, JSON, and others) |
36
76
 
37
- ## Configuration by Tool
77
+ ### Hunting
38
78
 
39
- <details>
40
- <summary><strong>Claude Desktop</strong></summary>
79
+ Search inside JAR files.
41
80
 
42
- Edit the Claude Desktop config file:
81
+ | Tool | Description |
82
+ |------|-------------|
83
+ | `dejared_search_class` | Search classes by name |
84
+ | `dejared_search_string` | Search string literals in bytecode (URLs, SQL, error messages) |
43
85
 
44
- - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
45
- - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
86
+ ### Deep Analysis
87
+
88
+ Inspect metadata and decompile classes.
89
+
90
+ | Tool | Description |
91
+ |------|-------------|
92
+ | `dejared_get_metadata` | Extract class metadata via ASM (fast, no decompilation) |
93
+ | `dejared_dump_package_metadata` | Batch metadata extraction for entire packages |
94
+ | `dejared_decompile_class` | Decompile `.class` files to Java source code |
95
+
96
+ ## Decompiler Engines
97
+
98
+ dejared-mcp supports three decompiler engines. The engine can be
99
+ specified per request via the `dejared_decompile_class` tool.
100
+
101
+ | Engine | Description |
102
+ |--------|-------------|
103
+ | **CFR** (default) | Reliable general-purpose decompiler |
104
+ | **Vineflower** | Modern fork of FernFlower, handles newer Java features well |
105
+ | **Procyon** | Alternative engine, can handle some edge cases better |
106
+
107
+ ## Installation and Configuration
108
+
109
+ The standard configuration below works with most MCP-compatible tools.
110
+ Expand the relevant section for tool-specific instructions.
46
111
 
47
112
  ```json
48
113
  {
@@ -55,20 +120,32 @@ Edit the Claude Desktop config file:
55
120
  }
56
121
  ```
57
122
 
58
- Restart Claude Desktop after saving.
123
+ <details>
124
+ <summary><strong>Amp</strong></summary>
59
125
 
60
- </details>
126
+ Add via the Amp VS Code extension settings screen or by updating your `settings.json` file:
61
127
 
62
- <details>
63
- <summary><strong>Claude Code (CLI)</strong></summary>
128
+ ```json
129
+ "amp.mcpServers": {
130
+ "dejared": {
131
+ "command": "npx",
132
+ "args": ["-y", "dejared-mcp"]
133
+ }
134
+ }
135
+ ```
64
136
 
65
- Run this command in your terminal:
137
+ **Amp CLI:**
66
138
 
67
139
  ```bash
68
- claude mcp add dejared -- npx -y dejared-mcp
140
+ amp mcp add dejared -- npx -y dejared-mcp
69
141
  ```
70
142
 
71
- Or add it to your project's `.mcp.json`:
143
+ </details>
144
+
145
+ <details>
146
+ <summary><strong>Antigravity Editor</strong></summary>
147
+
148
+ Edit `~/.gemini/antigravity/mcp_config.json`:
72
149
 
73
150
  ```json
74
151
  {
@@ -81,19 +158,88 @@ Or add it to your project's `.mcp.json`:
81
158
  }
82
159
  ```
83
160
 
161
+ Or install through the MCP Store if available.
162
+
84
163
  </details>
85
164
 
86
165
  <details>
87
- <summary><strong>Cursor</strong></summary>
166
+ <summary><strong>Claude Code</strong></summary>
167
+
168
+ ```bash
169
+ claude mcp add dejared -- npx -y dejared-mcp
170
+ ```
171
+
172
+ Or add it to your project's `.mcp.json` using the standard config above.
173
+
174
+ **Plugin (Marketplace)** installs both the MCP server and the `/jar-analysis` skill:
175
+
176
+ ```bash
177
+ claude plugin marketplace add HuynhKhanh1402/dejared-mcp
178
+ claude plugin install dejared@dejared-mcp-marketplace
179
+ ```
88
180
 
89
- Create or edit `.cursor/mcp.json` in your project root (project-level) or `~/.cursor/mcp.json` (global):
181
+ </details>
182
+
183
+ <details>
184
+ <summary><strong>Claude Desktop</strong></summary>
185
+
186
+ Edit the Claude Desktop config file:
187
+
188
+ - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
189
+ - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
190
+
191
+ Add the standard config above and restart Claude Desktop.
192
+
193
+ </details>
194
+
195
+ <details>
196
+ <summary><strong>Cline</strong></summary>
197
+
198
+ Add the standard config above to your MCP settings file.
199
+
200
+ </details>
201
+
202
+ <details>
203
+ <summary><strong>Codex</strong></summary>
204
+
205
+ ```bash
206
+ codex mcp add dejared npx "-y dejared-mcp"
207
+ ```
208
+
209
+ Or edit `~/.codex/config.toml`:
210
+
211
+ ```toml
212
+ [mcp_servers.dejared]
213
+ command = "npx"
214
+ args = ["-y", "dejared-mcp"]
215
+ ```
216
+
217
+ </details>
218
+
219
+ <details>
220
+ <summary><strong>Copilot CLI</strong></summary>
221
+
222
+ Interactive:
223
+
224
+ ```
225
+ /mcp add
226
+ ```
227
+
228
+ Then fill in:
229
+ - **Server Name**: `dejared`
230
+ - **Server Type**: `STDIO`
231
+ - **Command**: `npx -y dejared-mcp`
232
+
233
+ Or edit `~/.copilot/mcp-config.json`:
90
234
 
91
235
  ```json
92
236
  {
93
237
  "mcpServers": {
94
238
  "dejared": {
239
+ "type": "local",
95
240
  "command": "npx",
96
- "args": ["-y", "dejared-mcp"]
241
+ "args": ["-y", "dejared-mcp"],
242
+ "tools": ["*"]
97
243
  }
98
244
  }
99
245
  }
@@ -102,29 +248,34 @@ Create or edit `.cursor/mcp.json` in your project root (project-level) or `~/.cu
102
248
  </details>
103
249
 
104
250
  <details>
105
- <summary><strong>VS Code (GitHub Copilot)</strong></summary>
251
+ <summary><strong>Cursor</strong></summary>
106
252
 
107
- Create or edit `.vscode/mcp.json` in your project root:
253
+ Create or edit `.cursor/mcp.json` in your project root (project-level) or `~/.cursor/mcp.json` (global) using the standard config above.
108
254
 
109
- ```json
110
- {
111
- "servers": {
112
- "dejared": {
113
- "command": "npx",
114
- "args": ["-y", "dejared-mcp"]
115
- }
116
- }
117
- }
255
+ </details>
256
+
257
+ <details>
258
+ <summary><strong>Gemini CLI</strong></summary>
259
+
260
+ ```bash
261
+ gemini mcp add dejared npx -y dejared-mcp
118
262
  ```
119
263
 
120
- Or add to your VS Code `settings.json` for global availability.
264
+ Or edit `~/.gemini/settings.json` (global) or `.gemini/settings.json` (project) using the standard config above.
121
265
 
122
- After saving, click the **Start** button that appears in the MCP config file, then use Agent mode in Copilot Chat.
266
+ Use `/mcp` in a Gemini CLI session to verify the server is connected.
123
267
 
124
268
  </details>
125
269
 
126
270
  <details>
127
- <summary><strong>JetBrains IDEs (GitHub Copilot)</strong></summary>
271
+ <summary><strong>Goose</strong></summary>
272
+
273
+ Go to **Advanced settings** > **Extensions** > **Add custom extension**. Name to your liking, use type `STDIO`, and set the command to `npx -y dejared-mcp`.
274
+
275
+ </details>
276
+
277
+ <details>
278
+ <summary><strong>JetBrains IDEs</strong></summary>
128
279
 
129
280
  Go to **Settings** > **Tools** > **AI Assistant** > **Model Context Protocol (MCP)**.
130
281
 
@@ -138,39 +289,47 @@ Click **+ Add** and configure:
138
289
  </details>
139
290
 
140
291
  <details>
141
- <summary><strong>Gemini CLI</strong></summary>
292
+ <summary><strong>Kiro</strong></summary>
142
293
 
143
- **Option A** - CLI command:
294
+ Create or edit `.kiro/settings/mcp.json` using the standard config above.
144
295
 
145
- ```bash
146
- gemini mcp add dejared npx -y dejared-mcp
147
- ```
296
+ </details>
148
297
 
149
- **Option B** - Edit `~/.gemini/settings.json` (global) or `.gemini/settings.json` (project):
298
+ <details>
299
+ <summary><strong>opencode</strong></summary>
300
+
301
+ Edit `~/.config/opencode/opencode.json`:
150
302
 
151
303
  ```json
152
304
  {
153
- "mcpServers": {
305
+ "$schema": "https://opencode.ai/config.json",
306
+ "mcp": {
154
307
  "dejared": {
155
- "command": "npx",
156
- "args": ["-y", "dejared-mcp"]
308
+ "type": "local",
309
+ "command": ["npx", "-y", "dejared-mcp"],
310
+ "enabled": true
157
311
  }
158
312
  }
159
313
  }
160
314
  ```
161
315
 
162
- Use `/mcp` in a Gemini CLI session to verify the server is connected.
316
+ </details>
317
+
318
+ <details>
319
+ <summary><strong>Qodo Gen</strong></summary>
320
+
321
+ Open [Qodo Gen](https://docs.qodo.ai/qodo-documentation/qodo-gen) chat panel in VS Code or IntelliJ > Connect more tools > + Add new MCP > Paste the standard config above > Save.
163
322
 
164
323
  </details>
165
324
 
166
325
  <details>
167
- <summary><strong>Antigravity Editor</strong></summary>
326
+ <summary><strong>VS Code (GitHub Copilot)</strong></summary>
168
327
 
169
- Edit `~/.gemini/antigravity/mcp_config.json`:
328
+ Create or edit `.vscode/mcp.json` in your project root:
170
329
 
171
330
  ```json
172
331
  {
173
- "mcpServers": {
332
+ "servers": {
174
333
  "dejared": {
175
334
  "command": "npx",
176
335
  "args": ["-y", "dejared-mcp"]
@@ -179,38 +338,14 @@ Edit `~/.gemini/antigravity/mcp_config.json`:
179
338
  }
180
339
  ```
181
340
 
182
- Or install through the MCP Store if available.
341
+ After saving, click the **Start** button that appears in the MCP config file, then use Agent mode in Copilot Chat.
183
342
 
184
343
  </details>
185
344
 
186
345
  <details>
187
- <summary><strong>GitHub Copilot CLI</strong></summary>
188
-
189
- **Option A** - Interactive:
190
-
191
- ```
192
- /mcp add
193
- ```
194
-
195
- Then fill in:
196
- - **Server Name**: `dejared`
197
- - **Server Type**: `STDIO`
198
- - **Command**: `npx -y dejared-mcp`
346
+ <summary><strong>Windsurf</strong></summary>
199
347
 
200
- **Option B** - Edit `~/.copilot/mcp-config.json`:
201
-
202
- ```json
203
- {
204
- "mcpServers": {
205
- "dejared": {
206
- "type": "local",
207
- "command": "npx",
208
- "args": ["-y", "dejared-mcp"],
209
- "tools": ["*"]
210
- }
211
- }
212
- }
213
- ```
348
+ Open Windsurf settings, navigate to MCP servers, and add a new server using the `command` type with `npx -y dejared-mcp`. Or add the standard config under `mcpServers` in your settings.
214
349
 
215
350
  </details>
216
351
 
@@ -221,31 +356,24 @@ If you prefer to run the server JAR directly without Node.js:
221
356
 
222
357
  1. Download the latest JAR from [GitHub Releases](https://github.com/HuynhKhanh1402/dejared-mcp/releases).
223
358
 
224
- Direct link pattern:
225
- ```
226
- https://github.com/HuynhKhanh1402/dejared-mcp/releases/download/v{VERSION}/dejared-mcp-{VERSION}.jar
227
- ```
228
-
229
359
  2. Run it:
230
360
  ```bash
231
- java -jar dejared-mcp-0.1.1.jar
361
+ java -jar dejared-mcp-0.1.3.jar
232
362
  ```
233
363
 
234
- 3. Configure your MCP client to use the JAR directly instead of `npx`. For example, in Claude Desktop:
364
+ 3. Configure your MCP client to use the JAR directly instead of `npx`:
235
365
 
236
366
  ```json
237
367
  {
238
368
  "mcpServers": {
239
369
  "dejared": {
240
370
  "command": "java",
241
- "args": ["-jar", "/path/to/dejared-mcp-0.1.1.jar"]
371
+ "args": ["-jar", "/path/to/dejared-mcp-0.1.3.jar"]
242
372
  }
243
373
  }
244
374
  }
245
375
  ```
246
376
 
247
- Replace `/path/to/dejared-mcp-0.1.1.jar` with the actual path where you saved the JAR. This works with any MCP client that supports stdio transport.
248
-
249
377
  </details>
250
378
 
251
379
  ## Custom Java Path
@@ -266,50 +394,92 @@ If Java is not in your system PATH, set the `DEJARED_JAVA_PATH` environment vari
266
394
  }
267
395
  ```
268
396
 
269
- ## Features
397
+ ## Server Configuration
270
398
 
271
- **Discovery** - Browse JAR structure:
272
- - `dejared_list_packages` - List all packages with class counts
273
- - `dejared_list_classes` - List classes in a specific package
274
- - `dejared_list_resources` - List non-class resource files
275
- - `dejared_read_resource` - Read text resources (yml, xml, properties, json, etc.)
399
+ | Property | Default | Description |
400
+ |----------|---------|-------------|
401
+ | `dejared.cache.max-size` | `500` | Max entries in the decompilation LRU cache |
402
+ | `dejared.security.max-resource-size` | `5242880` | Max resource file size (bytes) |
403
+ | `dejared.security.decompile-timeout-seconds` | `30` | Timeout per decompilation |
276
404
 
277
- **Hunting** - Search inside JARs:
278
- - `dejared_search_class` - Search classes by name
279
- - `dejared_search_string` - Search string literals in bytecode (URLs, SQL, error messages, etc.)
405
+ ## How It Works
280
406
 
281
- **Deep Analysis** - Inspect and decompile:
282
- - `dejared_get_metadata` - Extract class metadata via ASM (fast, no decompilation)
283
- - `dejared_dump_package_metadata` - Batch metadata for entire packages
284
- - `dejared_decompile_class` - Decompile `.class` to Java source code
407
+ The npm package is a thin Node.js wrapper. On first run it:
285
408
 
286
- ## Decompiler Engines
409
+ 1. Checks the platform cache directory for a cached JAR matching the current version.
410
+ - **Linux**: `$XDG_CACHE_HOME/dejared-mcp` (defaults to `~/.cache/dejared-mcp`)
411
+ - **macOS**: `~/Library/Caches/dejared-mcp`
412
+ - **Windows**: `%LOCALAPPDATA%\dejared-mcp`
413
+ 2. Downloads the JAR from GitHub Releases if not cached.
414
+ 3. Spawns `java -jar` with stdio inherited for MCP transport.
287
415
 
288
- | Engine | Description |
289
- |--------|-------------|
290
- | **CFR** (default) | Reliable general-purpose decompiler |
291
- | **Vineflower** | Modern fork of FernFlower, good with newer Java features |
292
- | **Procyon** | Alternative engine, can handle some edge cases better |
416
+ The server communicates over stdio using the Model Context Protocol.
293
417
 
294
- ## How It Works
418
+ ## FAQ and Troubleshooting
295
419
 
296
- The npm package is a thin Node.js wrapper. On first run it:
297
- 1. Checks the platform cache directory for a cached JAR matching the current version
298
- - Linux: `$XDG_CACHE_HOME/dejared-mcp` (default `~/.cache/dejared-mcp`)
299
- - macOS: `~/Library/Caches/dejared-mcp`
300
- - Windows: `%LOCALAPPDATA%\dejared-mcp`
301
- 2. Downloads the JAR from GitHub Releases if not cached
302
- 3. Spawns `java -jar` with stdio inherited for MCP transport
420
+ **Q: Java is installed but the server cannot find it.**
303
421
 
304
- The server communicates over stdio.
422
+ Set the `DEJARED_JAVA_PATH` environment variable in your MCP
423
+ configuration. See [Custom Java Path](#custom-java-path).
305
424
 
306
- ## Server Configuration
425
+ **Q: The server fails to start with a permission error.**
307
426
 
308
- | Property | Default | Description |
309
- |----------|---------|-------------|
310
- | `dejared.cache.max-size` | `500` | Max entries in the decompilation LRU cache |
311
- | `dejared.security.max-resource-size` | `5242880` | Max resource file size (bytes) |
312
- | `dejared.security.decompile-timeout-seconds` | `30` | Timeout per decompilation |
427
+ Ensure that the cached JAR file is readable. The cache location
428
+ depends on your platform. See [How It Works](#how-it-works) for
429
+ the cache directory paths.
430
+
431
+ **Q: Decompilation times out or returns an error.**
432
+
433
+ Some classes are difficult to decompile. Try a different engine
434
+ by specifying `vineflower` or `procyon` in the `dejared_decompile_class`
435
+ tool. The default timeout is 30 seconds and can be adjusted via
436
+ `dejared.security.decompile-timeout-seconds`.
437
+
438
+ **Q: Which Java version do I need?**
439
+
440
+ Java 21 or later. A JRE is sufficient; you do not need a full JDK.
441
+
442
+ **Q: Can I run the server without Node.js?**
443
+
444
+ Yes. Download the JAR from GitHub Releases and run it directly
445
+ with `java -jar`. See the "Pure Java" section under
446
+ [Installation and Configuration](#installation-and-configuration).
447
+
448
+ ## Contributing
449
+
450
+ Contributions are welcome. Please follow these guidelines:
451
+
452
+ 1. Fork the repository and create a feature branch from `master`.
453
+ 2. Ensure your changes compile and pass existing tests.
454
+ 3. Write clear commit messages describing the purpose of each change.
455
+ 4. Open a pull request against `master` with a description of what
456
+ the change does and why.
457
+
458
+ ### Project Structure
459
+
460
+ ```
461
+ dejared-mcp/
462
+ ├── bin/ # Node.js CLI entry point
463
+ ├── lib/ # Node.js wrapper (JAR download and process management)
464
+ ├── java-mcp/ # Java MCP server (Spring Boot, Gradle)
465
+ │ └── src/
466
+ ├── skills/ # Claude Code plugin skills
467
+ ├── package.json # npm package manifest
468
+ └── server.json # MCP Registry manifest
469
+ ```
470
+
471
+ ### Building from Source
472
+
473
+ ```bash
474
+ cd java-mcp
475
+ ./gradlew build
476
+ ```
477
+
478
+ ### Reporting Issues
479
+
480
+ Open an issue on [GitHub Issues](https://github.com/HuynhKhanh1402/dejared-mcp/issues)
481
+ with steps to reproduce the problem, your Java version, and your
482
+ Node.js version.
313
483
 
314
484
  ## Third-Party Licenses
315
485
 
@@ -326,4 +496,4 @@ This project uses the following open-source libraries:
326
496
 
327
497
  ## License
328
498
 
329
- [MIT](LICENSE)
499
+ This project is licensed under the [MIT License](LICENSE).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dejared-mcp",
3
- "version": "0.1.2",
4
- "mcpName": "io.github.huynhkhanh1402/dejared",
3
+ "version": "0.1.4",
4
+ "mcpName": "io.github.HuynhKhanh1402/dejared",
5
5
  "description": "Explore, analyze, and decompile Java JAR files via MCP",
6
6
  "bin": {
7
7
  "dejared-mcp": "bin/dejared-mcp.js"
@@ -1,16 +1,13 @@
1
1
  ---
2
2
  name: jar-analysis
3
3
  description: >
4
- Explore, search, and decompile Java JAR files. Three workflows: Explore
5
- (top-down structure mapping), Hunt (search for specific code/strings),
6
- and Deep Analysis (single-class investigation). Use the workflow that
7
- matches the task.
4
+ Explore, search, and decompile Java JAR files. Quick use cases for
5
+ common tasks (lookup, read config, get signatures) and workflows for
6
+ deeper analysis (Explore, Hunt, Deep Analysis).
8
7
  ---
9
8
 
10
9
  # JAR Analysis
11
10
 
12
- Three workflows for working with Java JAR files. Pick the one that fits your goal.
13
-
14
11
  ## Available Tools
15
12
 
16
13
  | Tool | Cost | Purpose |
@@ -34,106 +31,23 @@ Three workflows for working with Java JAR files. Pick the one that fits your goa
34
31
 
35
32
  ---
36
33
 
37
- ## Workflow 1: Explore
38
-
39
- Use when exploring unknown JARs or understanding JAR architecture. Top-down approach: cheap tools first, decompilation last.
40
-
41
- ### Step 1: Map Package Structure
42
- Call `dejared_list_packages` to get the full layout.
43
- - Identify the root application package (highest class count, deepest nesting).
44
- - Distinguish app code from shaded/third-party dependencies.
45
-
46
- ### Step 2: List Classes
47
- Call `dejared_list_classes` with `recursive=true` on the root application package to get all classes in one call.
48
- - For targeted exploration of specific packages, use `recursive=false`.
49
-
50
- ### Step 3: Discover Resources
51
- Call `dejared_list_resources` to see what non-class files exist in the JAR.
34
+ ## Quick Use Cases
52
35
 
53
- ### Step 4: Read Configuration
54
- Call `dejared_read_resource` for files discovered in Step 3:
55
- - `application.yml` / `application.yaml` / `application.properties`
56
- - `META-INF/spring.factories` or `META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports`
57
- - `logback.xml` / `log4j2.xml`
36
+ **Quick Lookup** - find a class by name (`dejared_search_class`) or find a string in bytecode (`dejared_search_string`). One call, done.
58
37
 
59
- ### Step 5: Batch Metadata
60
- Call `dejared_dump_package_metadata` with **all important packages at once** (it accepts a list).
61
- Example: `packageNames: ["com.example.service", "com.example.config", "com.example.controller"]`
62
- - Returns annotations, fields, and method signatures for every class.
63
- - One call replaces dozens of individual `dejared_get_metadata` calls.
38
+ **Read Config** - `dejared_list_resources` to see what's in the JAR, then `dejared_read_resource` to read it (application.yml, pom.xml, logback.xml, etc.)
64
39
 
65
- ### Step 6: Selective Decompilation
66
- Call `dejared_decompile_class` ONLY for classes where you need method body logic.
67
- - You MUST have reviewed metadata from Step 5 first.
68
- - Decompile one class at a time; summarize before continuing.
69
- - For JARs with >20 packages, group by prefix and summarize before diving in.
40
+ **Get Signatures** - `dejared_get_metadata` for a single class, or `dejared_dump_package_metadata` for an entire package (accepts a list). Returns class hierarchy, annotations, fields, and method signatures without decompiling.
70
41
 
71
42
  ---
72
43
 
73
- ## Workflow 2: Hunt
74
-
75
- Use when looking for specific functionality, URLs, SQL, error messages, or credentials. Search-driven approach.
76
-
77
- ### Search Tools
78
-
79
- **`dejared_search_class`** -- Find by class name.
80
- Case-insensitive keyword match against simple class names.
81
- - Find specific classes: "UserService", "DatabaseConfig"
82
- - Find patterns: "Controller", "Repository", "Factory", "Handler"
83
-
84
- **`dejared_search_string`** -- Find by string literal.
85
- Scans bytecode constant pools across all classes (case-insensitive).
86
- - URLs, endpoints, API paths
87
- - SQL queries, table names
88
- - Error messages, log messages
89
- - Config keys, credentials, secrets
90
- - Useful keywords for security audits: "password", "secret", "token", "key", "jdbc", "http://"
91
-
92
- ### Steps
93
-
94
- 1. **Search** -- Pick the right search tool based on the goal.
95
- 2. **Triage** -- Review results, identify most relevant matches.
96
- 3. **Inspect** -- Call `dejared_get_metadata` on promising classes to understand their role (annotations, fields, methods).
97
- 4. **Decompile** -- Call `dejared_decompile_class` ONLY on classes where you need to see method body logic. Never skip step 3.
98
- 5. **Report** -- Summarize findings with context and implications.
99
-
100
- Note: String search finds compiled constants only, not runtime-generated strings.
101
-
102
- ---
103
-
104
- ## Workflow 3: Deep Analysis
105
-
106
- Use when investigating a single class in detail. Combines metadata extraction with multi-engine decompilation.
107
-
108
- ### Step 1: Metadata First
109
- Call `dejared_get_metadata` to extract:
110
- - Class hierarchy (superclass, interfaces)
111
- - Annotations (`@Service`, `@Entity`, `@Controller`, etc.)
112
- - Fields (state the class holds)
113
- - Methods (behavior -- names, return types, parameters)
114
-
115
- This tells you the class's role and size before decompiling.
116
-
117
- ### Step 2: Decompile
118
- Call `dejared_decompile_class` (default engine: CFR). Analyze:
119
- - Constructor logic and dependency injection
120
- - Method implementations and business logic
121
- - Error handling patterns
122
- - Interactions with other classes
44
+ ## Workflows
123
45
 
124
- ### Step 3: Cross-Reference (if needed)
125
- If decompiled code references important classes:
126
- - `dejared_search_class` to find them by name.
127
- - `dejared_dump_package_metadata` on the same package to see sibling classes (accepts a list of packages).
46
+ **Explore** - top-down JAR mapping:
47
+ `dejared_list_packages` `dejared_list_classes` (use `recursive=true`) → `dejared_list_resources` → `dejared_read_resource` for configs → `dejared_dump_package_metadata` (batch all important packages in one call) → selective `dejared_decompile_class` only where method body logic is needed.
128
48
 
129
- ### Step 4: Try Alternative Engine (if needed)
130
- If CFR output has problems (broken lambdas, goto statements, placeholder bodies):
131
- - `vineflower` -- best for modern Java features.
132
- - `procyon` -- good for edge cases.
49
+ **Hunt** - search-driven investigation:
50
+ Pick search tool (`dejared_search_class` or `dejared_search_string`) triage results `dejared_get_metadata` on promising matches → `dejared_decompile_class` only if needed. Never skip the metadata step.
133
51
 
134
- ### Report Structure
135
- 1. **Role** -- What this class does (one sentence).
136
- 2. **Framework Integration** -- Annotations, Spring beans, injection points.
137
- 3. **Key Methods** -- Important methods and what they do.
138
- 4. **Dependencies** -- Other classes/services it uses.
139
- 5. **Notable Patterns** -- Design patterns, security concerns, performance notes.
52
+ **Deep Analysis** - single class investigation:
53
+ `dejared_get_metadata` first → `dejared_decompile_class` (CFR default) → cross-reference with `dejared_search_class` or `dejared_dump_package_metadata` if needed. If CFR output has issues (broken lambdas, `goto` statements, missing method bodies), retry with `vineflower` (best for modern Java features like records, sealed classes, pattern matching) or `procyon` (handles some obfuscated/edge-case bytecode better).