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.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +5 -5
- package/lib/jar-runner.js +14 -3
- package/package.json +1 -1
- package/skills/jar-analysis/SKILL.md +10 -10
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[](https://www.npmjs.com/package/dejared-mcp)
|
|
2
2
|
[](LICENSE)
|
|
3
3
|
[]()
|
|
4
|
-
[]()
|
|
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**
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
142
|
-
|
|
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
|
@@ -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
|
|
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
|
-
-
|
|
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**
|
|
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**
|
|
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**
|
|
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**
|
|
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**
|
|
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.
|
|
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**
|
|
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).
|