
Mcp Mat
io.github.codelipenghuiPublished by GitHub account codelipenghuiv0.1.0Updated Oct 24, 2026
Headless Eclipse MAT MCP server for Java heap dump analysis
Overview
Headless Eclipse MAT MCP server that lets an assistant analyze Java heap dumps: run reports, OQL queries and built-in MAT commands.
- What you can do
- Check MAT and Java runtime availability and whether index artifacts exist for a heap dump, and get OQL parser guidance and supported patterns. Run predefined MAT reports such as leak suspects and system overview. Execute OQL queries and return results inline. Run built-in MAT analysis commands covering dominator trees, GC root paths, histograms, leak detection, threads, collections, references, finalizers, retained sets, top consumers, strings and heap overview. Export heap dumps and run comparison reports against a baseline dump.
- When to use it
- Useful when investigating Java memory problems from a heap dump: finding leaks, dominator trees, GC root paths, thread and collection analysis, or comparing two dumps. Meant for developers and operators who already have Eclipse MAT installed and a .hprof file to inspect.
- Requirements
- Runs locally as a Node.js process (npm package mcp-mat, or built from source). Needs a Java runtime (JAVA_PATH, default java) and an Eclipse MAT installation (MAT_HOME, or MAT_LAUNCHER). Optional settings include MAT_XMX_MB (default 4096), MAT_TIMEOUT_SEC (default 1800) and working directories under /tmp. Desktop only.
Installation
In SourceWeft
- Open Mcp Mat in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
mcp-mat
Headless MCP server for Eclipse MAT using direct java -jar org.eclipse.equinox.launcher_*.jar execution.
Features
mat_healthcheck— Validate MAT launcher and Java runtime availabilitymat_parse_report— Run predefined MAT reports (leak suspects, system overview, etc.)mat_oql_query— Execute OQL queries and return inline resultsmat_run_command— Execute 56 built-in MAT analysis commands (histogram, dominator_tree, path2gc, thread_overview, etc.)mat_index_status— Check whether MAT index artifacts exist for a heap dumpmat_oql_spec— Return OQL parser guidance and supported patterns
Supported Commands (mat_run_command)
Dominator tree analysis
dominator_tree, show_dominator_tree, immediate_dominators, big_drops_in_dominator_tree
Path to GC roots
path2gc, merge_shortest_paths, gc_roots
Histogram & object listing
histogram, delta_histogram*, list_objects, group_by_value, duplicate_classes
Leak detection
leakhunter, leakhunter2, find_leaks, find_leaks2, reference_leak
Thread analysis
thread_overview, thread_details, thread_stack
Collection analysis
collection_fill_ratio, collections_grouped_by_size, array_fill_ratio, arrays_grouped_by_size, hash_entries, map_collision_ratio, extract_list_values, hash_set_values, primitive_arrays_with_a_constant_value
Reference analysis
references_statistics, weak_references_statistics, soft_references_statistics, phantom_references_statistics, finalizer_references_statistics
Finalizer analysis
finalizer_overview, finalizer_thread, finalizer_queue, finalizer_in_processing, finalizer_thread_locals
Retained set
show_retained_set, customized_retained_set
Component & top consumers
component_report, component_report_top, top_consumers, top_consumers_html, pie_biggest_objects
String & memory waste
find_strings, waste_in_char_arrays
Heap info & misc
heap_dump_overview, unreachable_objects, system_properties, class_references, comparison_report*
Eclipse/OSGi specific
bundle_registry, leaking_bundles
Export
export_hprof
* Requires a baseline heap dump (second .hprof file).
OQL mode notes
- This server normalizes client OQL input and wraps it for MAT parse-app command mode.
- You can send OQL with or without outer quotes.
- For class ranking and top consumers, prefer
mat_parse_reportwithorg.eclipse.mat.api:overviewand parseClass_Histogram*.txt. - For object inspection, use simple field-level OQL patterns (
INSTANCEOF,OBJECTS 0x...).
Environment
All environment variables are optional:
MAT_HOMEMAT_LAUNCHERJAVA_PATH(defaultjava)MAT_XMX_MB(default4096)MAT_TIMEOUT_SEC(default1800)MAT_CONFIG_DIR(default/tmp/mat-config)MAT_DATA_DIR(default/tmp/mat-workspace)MAT_DEBUG(defaultfalse)MAT_DEBUG_LOG_DIR(default/tmp/mcp-mat-logs)MAT_PRIVACY_MODE(defaultfalse)MAT_OQL_MAX_BYTES(default16384)MAT_RESULT_PREVIEW_LINES(default20)MAT_STDIO_TAIL_CHARS(default4000)
Run
Test
Install via npx
No build step required. Install directly from npm:
Claude Code
Add to ~/.claude/settings.json or project .claude/settings.json:
Codex
Install in Claude Code (from source)
Add the MCP server to Claude Code settings (~/.claude/settings.json or project .claude/settings.json):
Install in Codex (from source)
Build first:
Add MCP server to Codex:
Verify:
If you need to update the entry:
Equivalent ~/.codex/config.toml entry:
Source: README.md at commit 681cc67
Tools
0Version history
1- v0.1.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts