mcp-jvm-diagnostics 0.1.11 → 0.1.13
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/build/index.js +9 -6
- package/build/parsers/gc-log.js +1 -0
- package/build/parsers/jfr-summary.js +2 -1
- package/build/reporting.js +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { parseJfrSummary } from "./parsers/jfr-summary.js";
|
|
|
13
13
|
import { generateReportFromThreadDump, analyzeThreadDumpMarkdown, } from "./reporting.js";
|
|
14
14
|
// Handle --help
|
|
15
15
|
if (process.argv.includes("--help") || process.argv.includes("-h")) {
|
|
16
|
-
console.log(`mcp-jvm-diagnostics v0.1.
|
|
16
|
+
console.log(`mcp-jvm-diagnostics v0.1.12 — MCP server for JVM diagnostics
|
|
17
17
|
|
|
18
18
|
Usage:
|
|
19
19
|
mcp-jvm-diagnostics [options]
|
|
@@ -33,7 +33,7 @@ Tools provided:
|
|
|
33
33
|
}
|
|
34
34
|
const server = new McpServer({
|
|
35
35
|
name: "mcp-jvm-diagnostics",
|
|
36
|
-
version: "0.1.
|
|
36
|
+
version: "0.1.12",
|
|
37
37
|
});
|
|
38
38
|
// --- Tool: analyze_thread_dump ---
|
|
39
39
|
server.tool("analyze_thread_dump", "Parse a JVM thread dump (jstack output) and analyze thread states, detect deadlocks, identify lock contention hotspots, and find thread starvation patterns. Handles both platform threads and virtual threads (Java 21+). Note: deadlock detection covers synchronized monitor locks only — java.util.concurrent.locks.ReentrantLock and other j.u.c lock types do not expose their waiters in thread dump lock info and will not be detected.", {
|
|
@@ -211,10 +211,13 @@ server.tool("analyze_heap_histo", "Parse jmap -histo output and detect memory le
|
|
|
211
211
|
server.tool("compare_heap_histos", "Compare two jmap -histo snapshots taken at different times to detect memory growth patterns, leak candidates, and new allocations. Captures what is growing between snapshots.", {
|
|
212
212
|
before: z
|
|
213
213
|
.string()
|
|
214
|
-
.describe("The FIRST (earlier) jmap -histo output"
|
|
214
|
+
.describe("The FIRST (earlier) jmap -histo output. Capture from a stable baseline — before the suspected leak window or after application startup has settled. " +
|
|
215
|
+
"Use `jmap -histo:live <pid>` to force a GC before capturing, ensuring unreachable objects are excluded and the snapshot reflects true live objects."),
|
|
215
216
|
after: z
|
|
216
217
|
.string()
|
|
217
|
-
.describe("The SECOND (later) jmap -histo output"
|
|
218
|
+
.describe("The SECOND (later) jmap -histo output. Capture after reproducing the suspected leak or after running under load. " +
|
|
219
|
+
"Allow at least 5-10 minutes between snapshots — short gaps may not accumulate enough growth to distinguish real leaks from normal allocation churn. " +
|
|
220
|
+
"Use the same `jmap -histo:live` flag as the before snapshot for a fair comparison."),
|
|
218
221
|
}, async ({ before, after }) => {
|
|
219
222
|
try {
|
|
220
223
|
const report = compareHeapHistos(before, after);
|
|
@@ -349,11 +352,11 @@ server.tool("diagnose_jvm", "Unified JVM diagnosis combining thread dump and GC
|
|
|
349
352
|
thread_dump: z
|
|
350
353
|
.string()
|
|
351
354
|
.optional()
|
|
352
|
-
.describe("Thread dump text (from jstack, kill -3, or VisualVM). Capture
|
|
355
|
+
.describe("Thread dump text (from jstack, kill -3, or VisualVM). Capture during active symptoms for meaningful cross-correlation — a dump from a healthy period will not correlate with GC pressure visible in the log."),
|
|
353
356
|
gc_log: z
|
|
354
357
|
.string()
|
|
355
358
|
.optional()
|
|
356
|
-
.describe("GC log text (from -Xlog:gc* for Java 9+, or -verbose:gc for Java 8).
|
|
359
|
+
.describe("GC log text (from -Xlog:gc* for Java 9+, or -verbose:gc for Java 8). Provide the portion covering the time window when the thread dump was taken — trim the log to the symptom window if it is large. Logs from a different time period produce spurious correlations."),
|
|
357
360
|
}, async ({ thread_dump, gc_log }) => {
|
|
358
361
|
try {
|
|
359
362
|
if (!thread_dump && !gc_log) {
|
package/build/parsers/gc-log.js
CHANGED
|
@@ -142,7 +142,8 @@ function analyzeJfrEvents(events, totalEvents, totalSize) {
|
|
|
142
142
|
.filter(Boolean)
|
|
143
143
|
.reduce((sum, e) => sum + e.count, 0);
|
|
144
144
|
if (ioCount > 5000) {
|
|
145
|
-
issues.push(`High I/O activity: ${ioCount.toLocaleString()} file/socket events
|
|
145
|
+
issues.push(`High I/O activity: ${ioCount.toLocaleString()} file/socket events recorded.`);
|
|
146
|
+
recommendations.push("Profile I/O call sites with async-profiler or VisualVM. Common causes: unbuffered writes, per-record DB queries, missing connection pooling. Consider batching writes and reads.");
|
|
146
147
|
}
|
|
147
148
|
// Check for compilation events
|
|
148
149
|
const compilation = byName.get("jdk.Compilation");
|
package/build/reporting.js
CHANGED
|
@@ -6,7 +6,7 @@ import { analyzeContention } from "./analyzers/contention.js";
|
|
|
6
6
|
import { detectDeadlocks } from "./analyzers/deadlock.js";
|
|
7
7
|
import { parseThreadDump } from "./parsers/thread-dump.js";
|
|
8
8
|
const PRODUCT_NAME = "jvm-diagnostics";
|
|
9
|
-
const TOOL_VERSION = "0.1.
|
|
9
|
+
const TOOL_VERSION = "0.1.12";
|
|
10
10
|
export const MISSING_LICENSE_INPUT_ERROR = "Missing required input: license_key";
|
|
11
11
|
export const MISSING_THREAD_DUMP_ERROR = "Missing required input: thread_dump";
|
|
12
12
|
export const MISSING_ENV_LICENSE_ERROR = "MCP_LICENSE_KEY environment variable is not set. generate_report requires a valid Pro license key. Free-tier analysis tools remain available without it.";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-jvm-diagnostics",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "MCP server for JVM diagnostics — analyze thread dumps, detect deadlocks, parse GC logs, and get JVM tuning recommendations",
|
|
5
5
|
"mcpName": "io.github.dmitriusan/mcp-jvm-diagnostics",
|
|
6
6
|
"author": "Dmytro Lisnichenko",
|