A Model Context Protocol (MCP) server for analyzing Java heap dump files (.hprof). Provides tools that allow AI assistants to analyze Java heap dumps through a standardized MCP interface, backed by the NetBeans Profiler library.
HeapDump .hprof file analysis MCP server using NetBeans Profiler as a backend library
Sterne
9
Tools
—
Uptime
—
Class Analysis - Browse classes sorted by instance count/size, search by exact name, regex, or BM25 full-text ranking
Instance Analysis - Get instance details with field values, paginate through instances by class, compute retained size (separate tool to isolate costly computation)
References - Get all references to an instance with pagination
GC Root Analysis - View garbage collection roots with pagination
Heap Summary & Properties - Get overview statistics and JVM system properties from the heap dump
OQL Support - Execute Object Query Language queries on the heap
Reflection-based Tool Registration - Tools are automatically generated from @Tool-annotated methods
mvn test -Dtest=HeapDumpMcpTest
mvn test -Dtest=McpClientIntegrationTest
Usage Examples
In tools like Trae, opencode, or Qwen CLI you can point to a .hprof file and ask e.g. "Find possible problems in this heap dump".
Typical Workflow
1. load_heap(file_path="dump.hprof") → Load the dump
2. get_summary() → Overview statistics
3. get_classes_by_max_instances_count() → Top classes by count
4. get_class_by_name(name="com.example.MyLeakyClass") → Inspect a suspicious class
5. get_instances(class_name="com.example.MyLeakyClass", from=0, to=5) → Browse instances
6. get_instance_by_id(id=12345) → Full details of a specific instance
7. get_instance_retained_size(id=12345) → Compute retained size (costly, separate call)
8. get_all_references(id=12345) → Find what holds this instance
Tool Response Format
Most tools return results as newline-separated text. For example:
get_class_by_name:
Name: java.util.HashMap
Instances: 152
Total Size: 24320
Superclass: java.util.AbstractMap
Static Fields:
int DEFAULT_INITIAL_CAPACITY = 16
float loadFactor = 0.75 (Instance ID: 123456789)
Fields:
java.util.HashMap$Node[] table
int size
int threshold
float loadFactor
Reflection-based Tool Factory
Tools are defined via annotations on methods in HeapDumpTools and automatically registered by ToolsFactory:
@Tool(name = "my_tool", title = "My Tool", decription = "Does something")
@Printer(impl = MyPrinter.class)
public String myToolMethod(
@Required("param1") String param1,
@Default(name = "param2", value = "50") int param2) {
// implementation
}
See src/main/java/com/onpositive/analyzer/mcp/reflection/ for annotation definitions.
Noch keine Tool-Liste. Remote-Server erhalten eine nach dem ersten Health-Check.
FAQ
Fragen
Wie installiere ich Heap MCP Nb?
Kopieren Sie auf dieser Seite die stdio-Konfiguration für Cursor, Claude Desktop, Claude Code oder VS Code. Sie nutzt die Installation des Herausgebers, keinen PlugMCP-Proxy.
Benötigt Heap MCP Nb einen API-Schlüssel?
In diesem Eintrag ist keine erforderliche Umgebungsvariable aufgeführt.
Welchen Transport verwendet Heap MCP Nb?
Heap MCP Nb läuft lokal über stdio.
Wann wurde Heap MCP Nb zuletzt geprüft?
Zuletzt geprüft: 2026-10-26. HeapDump .hprof file analysis MCP server using NetBeans Profiler as a backend library