dejared-mcp 0.2.0 → 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.2.0",
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.2.0",
4
+ "version": "1.0.0",
5
5
  "author": {
6
6
  "name": "HuynhKhanh1402"
7
7
  },
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.2.0",
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).