dejared-mcp 0.2.0 → 1.0.1

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.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "dejared-mcp-marketplace",
3
3
  "owner": {
4
- "name": "HuynhKhanh1402",
5
- "email": "huynhkhanh14022004@gmail.com"
4
+ "name": "hqkh4nh",
5
+ "email": "khanh@duck.com"
6
6
  },
7
7
  "metadata": {
8
8
  "description": "MCP server and Claude Code plugin for exploring, analyzing, and decompiling Java JAR files"
@@ -12,9 +12,9 @@
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.1",
16
16
  "author": {
17
- "name": "HuynhKhanh1402"
17
+ "name": "hqkh4nh"
18
18
  },
19
19
  "license": "MIT",
20
20
  "keywords": ["java", "jar", "decompiler", "bytecode", "reverse-engineering", "mcp"],
@@ -1,11 +1,11 @@
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.1",
5
5
  "author": {
6
- "name": "HuynhKhanh1402"
6
+ "name": "hqkh4nh"
7
7
  },
8
- "repository": "https://github.com/HuynhKhanh1402/dejared-mcp",
8
+ "repository": "https://github.com/hqkh4nh/dejared-mcp",
9
9
  "license": "MIT",
10
10
  "keywords": ["java", "jar", "decompiler", "bytecode", "reverse-engineering", "mcp"],
11
11
  "mcpServers": {
package/README.md CHANGED
@@ -174,7 +174,7 @@ Or add it to your project's `.mcp.json` using the standard config above.
174
174
  **Plugin (Marketplace)** installs both the MCP server and the `/jar-analysis` skill:
175
175
 
176
176
  ```bash
177
- claude plugin marketplace add HuynhKhanh1402/dejared-mcp
177
+ claude plugin marketplace add hqkh4nh/dejared-mcp
178
178
  claude plugin install dejared@dejared-mcp-marketplace
179
179
  ```
180
180
 
@@ -354,7 +354,7 @@ Open Windsurf settings, navigate to MCP servers, and add a new server using the
354
354
 
355
355
  If you prefer to run the server JAR directly without Node.js:
356
356
 
357
- 1. Download the latest JAR from [GitHub Releases](https://github.com/HuynhKhanh1402/dejared-mcp/releases).
357
+ 1. Download the latest JAR from [GitHub Releases](https://github.com/hqkh4nh/dejared-mcp/releases).
358
358
 
359
359
  2. Run it:
360
360
  ```bash
@@ -477,7 +477,7 @@ cd java-mcp
477
477
 
478
478
  ### Reporting Issues
479
479
 
480
- Open an issue on [GitHub Issues](https://github.com/HuynhKhanh1402/dejared-mcp/issues)
480
+ Open an issue on [GitHub Issues](https://github.com/hqkh4nh/dejared-mcp/issues)
481
481
  with steps to reproduce the problem, your Java version, and your
482
482
  Node.js version.
483
483
 
package/lib/jar-runner.js CHANGED
@@ -42,7 +42,7 @@ function getCacheDir() {
42
42
 
43
43
  const CACHE_DIR = getCacheDir();
44
44
  const JAR_PATH = path.join(CACHE_DIR, JAR_NAME);
45
- const DOWNLOAD_URL = `https://github.com/HuynhKhanh1402/dejared-mcp/releases/download/v${JAR_VERSION}/${JAR_NAME}`;
45
+ const DOWNLOAD_URL = `https://github.com/hqkh4nh/dejared-mcp/releases/download/v${JAR_VERSION}/${JAR_NAME}`;
46
46
 
47
47
  function log(msg) {
48
48
  process.stderr.write(`[dejared-mcp] ${msg}\n`);
@@ -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,7 +1,7 @@
1
1
  {
2
2
  "name": "dejared-mcp",
3
- "version": "0.2.0",
4
- "mcpName": "io.github.HuynhKhanh1402/dejared",
3
+ "version": "1.0.1",
4
+ "mcpName": "io.github.hqkh4nh/dejared",
5
5
  "description": "Explore, analyze, and decompile Java JAR files via MCP",
6
6
  "bin": {
7
7
  "dejared-mcp": "bin/dejared-mcp.js"
@@ -16,10 +16,10 @@
16
16
  "LICENSE"
17
17
  ],
18
18
  "license": "MIT",
19
- "author": "HuynhKhanh1402",
19
+ "author": "hqkh4nh",
20
20
  "repository": {
21
21
  "type": "git",
22
- "url": "https://github.com/HuynhKhanh1402/dejared-mcp"
22
+ "url": "https://github.com/hqkh4nh/dejared-mcp"
23
23
  },
24
24
  "keywords": [
25
25
  "mcp",
@@ -1,13 +1,40 @@
1
1
  ---
2
2
  name: jar-analysis
3
3
  description: >
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).
4
+ Explore, search, read, and decompile Java JAR, WAR, EAR, AAR, and
5
+ Spring Boot fat-jar files via the dejared MCP server. Use this skill
6
+ whenever the user references a `.jar` file path, asks what a
7
+ third-party Java library does, wants to read a config embedded in a
8
+ JAR (application.yml, spring.factories, MANIFEST.MF), needs class
9
+ metadata (superclass, annotations, method signatures), is chasing a
10
+ stack trace into a dependency without source, or is reverse-engineering
11
+ a plugin/mod/obfuscated artifact. Applies to artifacts in
12
+ `~/.m2/repository`, `~/.gradle/caches`, `build/libs/`, `target/`,
13
+ `lib/`, and `libs/`. Prefer the dejared MCP tools over `jar tf`,
14
+ `jar xf`, `unzip`, `javap -p`, `javap -c`, `javap -v`, or running a
15
+ decompiler manually — even if the user doesn't explicitly ask for
16
+ "the dejared tools" or "decompilation".
7
17
  ---
8
18
 
9
19
  # JAR Analysis
10
20
 
21
+ ## When This Skill Applies
22
+
23
+ Reach for these tools — never the shell — whenever the task touches the **inside** of a Java artifact:
24
+
25
+ | You would reach for... | Use this instead |
26
+ |----------------------------------------------|--------------------------------------------------------|
27
+ | `jar tf some.jar` | `dejared_list_packages` / `dejared_list_classes` |
28
+ | `jar tf some.jar \| grep -v .class` | `dejared_list_resources` |
29
+ | `unzip -p some.jar application.yml` | `dejared_read_resource` |
30
+ | `jar tf some.jar \| grep -i FooBar` | `dejared_search_class` |
31
+ | `strings some.jar \| grep http` | `dejared_search_string` |
32
+ | `javap -p com.foo.Bar` | `dejared_get_metadata` |
33
+ | `javap -p` across a package | `dejared_dump_package_metadata` |
34
+ | Running CFR / Vineflower / Procyon manually | `dejared_decompile_class` |
35
+
36
+ Applies to `.jar`, `.war`, `.ear`, `.aar` and any artifact under `~/.m2/repository`, `~/.gradle/caches`, `build/libs/`, `target/`, `lib/`, or `libs/`. All calls need an **absolute path** to the archive.
37
+
11
38
  ## Available Tools
12
39
 
13
40
  | Tool | Cost | Purpose |
@@ -15,7 +42,7 @@ description: >
15
42
  | `dejared_list_packages` | Cheap | List all packages with class counts |
16
43
  | `dejared_list_classes` | Cheap | List classes in a package (`recursive=true` for sub-packages) |
17
44
  | `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) |
45
+ | `dejared_read_resource` | Cheap | Read a text resource file from inside a JAR (content-based detection, no extension restrictions) |
19
46
  | `dejared_dump_package_metadata` | Cheap | Batch metadata for multiple packages at once (annotations, fields, methods via ASM) |
20
47
  | `dejared_get_metadata` | Cheap | Single class metadata (ASM-based, no decompilation) |
21
48
  | `dejared_search_class` | Cheap | Find classes by name keyword (case-insensitive) |
@@ -25,7 +52,8 @@ description: >
25
52
  ## Shared Rules
26
53
 
27
54
  - All tool calls require the **absolute path** to the JAR file.
28
- - NEVER decompile a class without checking its metadata first.
55
+ - Prefer these MCP tools over shelling out to jar/javap/unzip/strings or asking the user to decompile manually — structured output is faster and safer for the agent to consume.
56
+ - Check metadata before decompiling — it often provides enough information without the cost of full decompilation.
29
57
  - Default decompiler: CFR. If output is broken, try `vineflower` or `procyon`.
30
58
  - Report results in structured format.
31
59
 
@@ -33,21 +61,21 @@ description: >
33
61
 
34
62
  ## Quick Use Cases
35
63
 
36
- **Quick Lookup** - find a class by name (`dejared_search_class`) or find a string in bytecode (`dejared_search_string`). One call, done.
64
+ **Quick Lookup** — find a class by name (`dejared_search_class`) or find a string in bytecode (`dejared_search_string`). One call, done.
37
65
 
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.)
66
+ **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
67
 
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.
68
+ **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
69
 
42
70
  ---
43
71
 
44
72
  ## Workflows
45
73
 
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.
74
+ **Explore** — top-down JAR mapping:
75
+ `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
76
 
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.
77
+ **Hunt** — search-driven investigation:
78
+ 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
79
 
52
- **Deep Analysis** - single class investigation:
80
+ **Deep Analysis** — single class investigation:
53
81
  `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).