mcp-jvm-diagnostics
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-jvm-diagnostics Analyze this thread dump for deadlocks"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP JVM Diagnostics
A Model Context Protocol (MCP) server that gives AI assistants the ability to analyze JVM thread dumps and GC logs. It detects deadlocks, identifies lock contention hotspots, analyzes garbage collection pressure, and recommends JVM tuning parameters.
Why This Tool?
JVM diagnostic MCP servers exist (TDA, jfr-mcp, Arthas) — but they're all Java-based, requiring a JVM runtime just to diagnose JVM problems. This tool runs on Node.js via npx — no JVM, no Docker, no SSH.
It analyzes offline artifacts (thread dumps, GC logs, heap histograms) rather than requiring a running JVM. Paste a thread dump or GC log and get instant analysis.
Related MCP server: mcp-dotnet-diagnostics
Features
6 MCP tools for comprehensive JVM diagnostics
Thread dump analysis — deadlock detection, contention hotspots, thread state breakdown
GC log analysis — pause statistics, heap trends, memory leak detection
Heap histogram analysis — memory leak candidates, classloader leaks, finalization issues
JFR summary — Java Flight Recorder file analysis
Unified diagnosis — cross-correlates thread and GC data
Supports G1, ZGC, Parallel, Serial, and Shenandoah GC formats
No external dependencies — works on local text input, no API keys needed
Pro Tier
Generate exportable diagnostic reports (HTML + PDF) with a Pro license key.
Full JVM thread dump analysis report with actionable recommendations
PDF export for sharing with your team
Priority support
$9.00/month — Get Pro License
Pro license key activates the generate_report MCP tool in mcp-jvm-diagnostics.
Installation
npx mcp-jvm-diagnosticsOr install globally:
npm install -g mcp-jvm-diagnosticsConfiguration
Claude Desktop
Add to ~/.claude/claude_desktop_config.json:
{
"mcpServers": {
"jvm-diagnostics": {
"command": "npx",
"args": ["-y", "mcp-jvm-diagnostics"]
}
}
}No environment variables needed — this tool works on text input you provide.
Quick Demo
Try these prompts in Claude (paste your JVM output):
"Analyze this thread dump: [paste jstack output]" — Detects deadlocks, contention hotspots, and thread state breakdown
"Analyze this GC log: [paste GC log]" — Shows pause statistics, heap trends, and tuning recommendations
"Compare these heap histograms to find memory leaks: BEFORE: [paste] AFTER: [paste]" — Identifies growing classes, classloader leaks, and finalizer issues
Tools
analyze_thread_dump
Parse a JVM thread dump and analyze thread states, detect deadlocks, and identify lock contention.
Parameters:
thread_dump— The full thread dump text (fromjstack <pid>,kill -3, or VisualVM)
Example prompt: "Analyze this thread dump and tell me if there are any deadlocks"
analyze_gc_log
Parse a GC log and analyze garbage collection patterns, pause times, and memory pressure.
Parameters:
gc_log— The GC log text (from-Xlog:gc*or-verbose:gc)
Example prompt: "Analyze this GC log and tell me if there are any performance issues"
analyze_heap_histo
Parse jmap -histo output and detect memory leak candidates, object creation hotspots, and classloader leaks.
Parameters:
histo— The jmap -histo output text (fromjmap -histo <pid>orjmap -histo:live <pid>)
Example prompt: "Analyze this heap histogram and tell me if there are any memory leak candidates"
diagnose_jvm
Unified JVM diagnosis combining thread dump and GC log analysis for comprehensive root cause analysis.
Parameters:
thread_dump(optional) — Thread dump textgc_log(optional) — GC log text
Example prompt: "I have both a thread dump and GC log from the same time — diagnose what's wrong"
compare_heap_histos
Compare two jmap -histo snapshots taken at different times to detect memory growth patterns and leak candidates.
Parameters:
before— The first (earlier) jmap -histo outputafter— The second (later) jmap -histo output
Example prompt: "Compare these two heap histograms and tell me what's growing"
Detects:
Classes with growing instance/byte counts (leak candidates)
New classes that appeared between snapshots
Classes that disappeared (GC'd or unloaded)
Overall heap growth rate
Classloader leaks and finalizer queue growth
Collecting JVM Diagnostics
Thread Dump
# Using jstack
jstack <pid> > thread-dump.txt
# Using kill signal (Linux/Mac)
kill -3 <pid>
# Using jcmd
jcmd <pid> Thread.print > thread-dump.txtGC Log
Add these JVM flags to your application:
# Java 9+ (unified logging)
-Xlog:gc*:file=gc.log:time,level,tags
# Java 8
-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:gc.logContributing
Clone the repo
npm installnpm run buildnpm test
Limitations & Known Issues
Text input only: Thread dumps, GC logs, and heap histograms must be provided as text. The server cannot attach to a running JVM or capture data automatically.
Java 9+ GC logs: The GC log parser is optimized for unified logging format (
-Xlog:gc*). Legacy-verbose:gcformat (Java 8) has basic support but may miss some events.Shenandoah GC: Limited support. G1, ZGC, Parallel, and Serial are fully supported.
Virtual threads (Java 21+): Thread dump parser handles virtual threads but analysis recommendations are tuned for platform threads.
Heap histo comparison: Requires standard
jmap -histoorjcmd GC.class_histogramformat. Custom formats or truncated output may not parse correctly.Deadlock detection: Detects monitor-based deadlocks. ReentrantLock deadlocks may not be detected if lock addresses are not visible in the thread dump.
No historical analysis: Each analysis is a point-in-time snapshot. For trend analysis, compare multiple snapshots manually.
HotSpot/OpenJDK only: Parser targets HotSpot/OpenJDK thread dump format. GraalVM native-image or Eclipse OpenJ9 dumps may parse incompletely.
Classloader leak detection: Heap analysis flags growing ClassLoader instances but cannot definitively prove a leak without memory profiler data.
Part of the MCP Java Backend Suite
mcp-db-analyzer — PostgreSQL/MySQL/SQLite schema analysis
mcp-spring-boot-actuator — Spring Boot health, metrics, and bean analysis
mcp-redis-diagnostics — Redis memory, slowlog, and client diagnostics
mcp-migration-advisor — Flyway/Liquibase migration risk analysis
License
MIT
End-of-life: 2026-05-10.
This MCP server is no longer maintained or distributed. The Corporation
has pivoted to Apify marketplace actors. See
irrationalways on Apify and
irrcorp/bzp-poland-tenders for current Corporation work.
The npm package has been unpublished. The repository is archived for historical reference only.
Available Tools
7 toolsanalyze_gc_logA
Parse a JVM GC log and analyze garbage collection patterns, pause times, allocation rates, and memory pressure. Supports G1, ZGC, Parallel, Serial, and Shenandoah GC formats.
Inputs: gc_log (required).
analyze_heap_histoA
Parse jmap -histo output and detect memory leak candidates, object creation hotspots, classloader leaks, and heap composition issues.
Inputs: histo (required).
analyze_jfrA
Parse JDK Flight Recorder summary output and analyze event distribution, detect performance hotspots, GC pressure, lock contention, I/O patterns, and excessive allocations. Input must be the text printed to stdout by jfr summary <recording.jfr> — not the binary .jfr file itself.
Inputs: jfr_summary (required).
analyze_thread_dumpA
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.
Inputs: thread_dump (required).
compare_heap_histosA
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.
Inputs: after (required), before (required).
diagnose_jvmA
Unified JVM diagnosis combining thread dump and GC log analysis with cross-correlation. Detects deadlocks, lock contention, GC pressure, and GC-induced cascading thread blocks. When both inputs are provided from the same time window, cross-correlates high GC overhead with contention and flags long GC pauses causing thread starvation. Either input can be omitted for single-source analysis.
Inputs: gc_log, thread_dump.
generate_reportB
Generate an exportable diagnostic report (HTML + PDF) from JVM diagnostic data. Requires a valid Pro license key.
Inputs: license_key (required), thread_dump (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool targets a distinct JVM diagnostic source or operation (JFR, thread dumps, GC logs, heap histograms, comparison, reporting, unified diagnosis), with no functional overlap.
All tools follow a consistent verb_noun pattern in snake_case (e.g., analyze_jfr, generate_report, diagnose_jvm), making the toolset predictable and easy to navigate.
With 7 tools, the server covers the major diagnostic areas (JFR, thread dumps, GC logs, heap histograms, plus comparison and unified analysis) without being bloated or sparse.
The tool surface covers the core diagnostic workflows, but lacks explicit CPU profiling or memory leak tools beyond heap histograms; still, the set is largely complete for general JVM diagnostics.
Maintenance
Related MCP Connectors
Ship better Java with your coding agent.
AI-powered codebase analysis — call graphs, security, dead code, complexity. 150+ tools.
Lets AI agents analyze API metrics, request logs, and traces, and manage apps and alerts.
The Polar Signals MCP server enables AI assistants to connect directly with performance profiling data, allowing users to analyze application performance through natural language queries. Key capabilities include querying CPU performance and memory usage, exploring profiling metadata like profile types and labels, and providing AI-driven code optimization suggestions directly within development environments like Claude Code or Cursor.
Related MCP Servers
AlicenseNot gradedqualityBmaintenanceEnables LLMs to debug Java applications using JDB, supporting breakpoints, stepping, expression evaluation, thread analysis, and more.4Apache 2.0- AlicenseAqualityDmaintenanceLive .NET runtime diagnostics for AI assistants. Ask Claude to diagnose memory leaks, GC pressure, LOH fragmentation, and thread starvation in any running .NET process — no code changes required.72MIT
- AlicenseAqualityCmaintenanceEnables analysis of JVM thread dumps to detect deadlocks, CPU spikes, pool exhaustion, and virtual thread pinning, returning a health score and interactive report link.264 npmMIT
- AlicenseAqualityBmaintenanceLets AI agents diagnose and debug live Java applications by auto-discovering JVMs and attaching Arthas to run diagnostic commands like thread, trace, watch, and ognl.65MIT