dejared-mcp 0.1.4 → 1.0.0

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.
@@ -12,7 +12,7 @@
12
12
  "name": "dejared",
13
13
  "source": "./",
14
14
  "description": "Explore, analyze, and decompile Java JAR files with structured workflows.",
15
- "version": "0.1.4",
15
+ "version": "1.0.0",
16
16
  "author": {
17
17
  "name": "HuynhKhanh1402"
18
18
  },
@@ -1,7 +1,7 @@
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
+ "version": "1.0.0",
5
5
  "author": {
6
6
  "name": "HuynhKhanh1402"
7
7
  },
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  [![npm version](https://img.shields.io/npm/v/dejared-mcp?style=flat-square)](https://www.npmjs.com/package/dejared-mcp)
2
2
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](LICENSE)
3
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)]()
4
+ [![Java](https://img.shields.io/badge/Java-17%2B-ED8B00?style=flat-square&logo=openjdk&logoColor=white)]()
5
5
 
6
6
  # dejared-mcp
7
7
 
@@ -41,7 +41,7 @@ transport.
41
41
  ## Prerequisites
42
42
 
43
43
  - **Node.js** 18 or later
44
- - **Java** 21 or later (JRE is sufficient)
44
+ - **Java** 17 or later (JRE is sufficient)
45
45
 
46
46
  ## Quick Start
47
47
 
@@ -358,7 +358,7 @@ If you prefer to run the server JAR directly without Node.js:
358
358
 
359
359
  2. Run it:
360
360
  ```bash
361
- java -jar dejared-mcp-0.1.3.jar
361
+ java -jar dejared-mcp-0.2.0.jar
362
362
  ```
363
363
 
364
364
  3. Configure your MCP client to use the JAR directly instead of `npx`:
@@ -368,7 +368,7 @@ If you prefer to run the server JAR directly without Node.js:
368
368
  "mcpServers": {
369
369
  "dejared": {
370
370
  "command": "java",
371
- "args": ["-jar", "/path/to/dejared-mcp-0.1.3.jar"]
371
+ "args": ["-jar", "/path/to/dejared-mcp-0.2.0.jar"]
372
372
  }
373
373
  }
374
374
  }
@@ -437,7 +437,7 @@ tool. The default timeout is 30 seconds and can be adjusted via
437
437
 
438
438
  **Q: Which Java version do I need?**
439
439
 
440
- Java 21 or later. A JRE is sufficient; you do not need a full JDK.
440
+ Java 17 or later. A JRE is sufficient; you do not need a full JDK.
441
441
 
442
442
  **Q: Can I run the server without Node.js?**
443
443
 
package/lib/jar-runner.js CHANGED
@@ -138,9 +138,20 @@ async function run() {
138
138
  const javaPath = resolveJava();
139
139
  await ensureJar();
140
140
 
141
- const child = spawn(javaPath, ["-jar", JAR_PATH], {
142
- stdio: "inherit",
143
- });
141
+ const logDir = process.env.DEJARED_LOG_DIR || path.join(CACHE_DIR, "logs");
142
+ fs.mkdirSync(logDir, { recursive: true });
143
+
144
+ const jvmArgs = [`-Ddejared.log.dir=${logDir}`];
145
+
146
+ if (process.env.DEJARED_LOG_LEVEL) {
147
+ jvmArgs.push(`-Ddejared.log.level=${process.env.DEJARED_LOG_LEVEL}`);
148
+ }
149
+
150
+ const child = spawn(
151
+ javaPath,
152
+ [...jvmArgs, "-jar", JAR_PATH, "--spring.profiles.active=file-logging"],
153
+ { stdio: "inherit" },
154
+ );
144
155
 
145
156
  child.on("error", (err) => {
146
157
  log(`Failed to start Java: ${err.message}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dejared-mcp",
3
- "version": "0.1.4",
3
+ "version": "1.0.0",
4
4
  "mcpName": "io.github.HuynhKhanh1402/dejared",
5
5
  "description": "Explore, analyze, and decompile Java JAR files via MCP",
6
6
  "bin": {
@@ -15,7 +15,7 @@ description: >
15
15
  | `dejared_list_packages` | Cheap | List all packages with class counts |
16
16
  | `dejared_list_classes` | Cheap | List classes in a package (`recursive=true` for sub-packages) |
17
17
  | `dejared_list_resources` | Cheap | List all non-class resource files with sizes |
18
- | `dejared_read_resource` | Cheap | Read a resource file (yml, properties, xml, json, txt, sql, conf) |
18
+ | `dejared_read_resource` | Cheap | Read a text resource file from inside a JAR (content-based detection, no extension restrictions) |
19
19
  | `dejared_dump_package_metadata` | Cheap | Batch metadata for multiple packages at once (annotations, fields, methods via ASM) |
20
20
  | `dejared_get_metadata` | Cheap | Single class metadata (ASM-based, no decompilation) |
21
21
  | `dejared_search_class` | Cheap | Find classes by name keyword (case-insensitive) |
@@ -25,7 +25,7 @@ description: >
25
25
  ## Shared Rules
26
26
 
27
27
  - All tool calls require the **absolute path** to the JAR file.
28
- - NEVER decompile a class without checking its metadata first.
28
+ - Check metadata before decompiling — it often provides enough information without the cost of full decompilation.
29
29
  - Default decompiler: CFR. If output is broken, try `vineflower` or `procyon`.
30
30
  - Report results in structured format.
31
31
 
@@ -33,21 +33,21 @@ description: >
33
33
 
34
34
  ## Quick Use Cases
35
35
 
36
- **Quick Lookup** - find a class by name (`dejared_search_class`) or find a string in bytecode (`dejared_search_string`). One call, done.
36
+ **Quick Lookup** — find a class by name (`dejared_search_class`) or find a string in bytecode (`dejared_search_string`). One call, done.
37
37
 
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.)
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.).
39
39
 
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.
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.
41
41
 
42
42
  ---
43
43
 
44
44
  ## Workflows
45
45
 
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.
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. If CFR output has issues, retry with `vineflower` or `procyon`.
48
48
 
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.
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.
51
51
 
52
- **Deep Analysis** - single class investigation:
52
+ **Deep Analysis** — single class investigation:
53
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).