mcp-mat
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-mat run leak suspect report on /tmp/heapdump.hprof"
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-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
Related MCP server: heap-seance
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
npm install
npm run build
MAT_HOME=/path/to/mat node dist/src/server.jsTest
npm testInstall via npx
No build step required. Install directly from npm:
Claude Code
Add to ~/.claude/settings.json or project .claude/settings.json:
{
"mcpServers": {
"mat": {
"command": "npx",
"args": ["-y", "mcp-mat"],
"env": {
"MAT_HOME": "/Applications/MemoryAnalyzer.app/Contents/Eclipse"
}
}
}
}Codex
codex mcp add \
--env MAT_HOME=/Applications/MemoryAnalyzer.app/Contents/Eclipse \
mat \
npx -y mcp-matInstall in Claude Code (from source)
Add the MCP server to Claude Code settings (~/.claude/settings.json or project .claude/settings.json):
{
"mcpServers": {
"mat": {
"command": "node",
"args": ["/path/to/mcp-mat/dist/src/server.js"],
"env": {
"MAT_HOME": "/Applications/MemoryAnalyzer.app/Contents/Eclipse"
}
}
}
}Install in Codex (from source)
Build first:
cd /path/to/mcp-mat
npm install
npm run buildAdd MCP server to Codex:
codex mcp add \
--env MAT_HOME=/Applications/MemoryAnalyzer.app/Contents/Eclipse \
mat \
node /path/to/mcp-mat/dist/src/server.jsVerify:
codex mcp list
codex mcp get mat --jsonIf you need to update the entry:
codex mcp remove mat
# then run codex mcp add ... againEquivalent ~/.codex/config.toml entry:
[mcp_servers.mat]
command = "node"
args = ["/path/to/mcp-mat/dist/src/server.js"]
[mcp_servers.mat.env]
MAT_HOME = "/Applications/MemoryAnalyzer.app/Contents/Eclipse"Available Tools
5 toolsmat_healthcheckC
Validate MAT launcher and Java runtime availability.
Inputs: mat_home, java_path.
mat_index_statusB
Report whether MAT index artifacts already exist for a heap dump.
Inputs: heap_path (required).
mat_oql_queryC
Execute a single MAT OQL query and return result artifacts.
Inputs: oql (required), heap_path (required), limit, unzip, +3 more.
mat_oql_specA
Return MAT OQL parser-mode guidance, supported patterns, and known limitations.
Inputs: no named parameters.
mat_parse_reportC
Run a predefined MAT report headlessly and return generated artifacts.
Inputs: heap_path (required), report_id (required), xmx_mb, options, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool serves a distinct purpose: environment validation, index checking, OQL query execution, OQL specification guidance, and report parsing. No overlaps or ambiguities exist.
All tool names follow a consistent 'mat_' prefix with snake_case, and each verb clearly indicates the action. The naming pattern is uniform and predictable.
With 5 tools covering essential MAT operations, the count is well-scoped. It is neither too sparse nor bloated for the server's purpose.
Core workflows (health, indexing, OQL queries, reports) are covered. A minor gap is the lack of tools to list or define custom reports, but the surface is otherwise complete.
Maintenance
Related MCP Connectors
The MCP server for Azure DevOps, bringing the power of Azure DevOps directly to your agents.
MCP Server for JFrog, providing tools for development and artifact management.
Repository knowledge graph MCP server for codebase understanding and debugging.
MCP server to assist with JxBrowser development.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server based on Puppeteer and Chrome DevTools Protocol for advanced browser debugging, performance analysis, and memory detection. It enables users to inspect DOM elements, monitor console errors, capture screenshots, and perform heap snapshot analysis through persistent browser connections.107 npm1MIT
- AlicenseDqualityDmaintenanceMCP server that provides 8 tools for Java memory leak investigation: \- Class histograms, GC pressure snapshots, JFR recordings, heap dumps, MAT leak suspects analysis, async-profiler allocation profiles \- Structured confidence-based verdicts (none/low/medium/high) requiring independent signal corroboration \- Designed for use inside Claude Code with two slash commands84Apache 2.0
- AlicenseAqualityCmaintenanceMCP server for profiling Java applications via JDK utilities (jcmd, jfr, jps). Enables AI assistants to diagnose performance, analyze threads, and inspect JFR recordings without manual CLI usage.26124 npm10MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server for Windows process memory inspection/editing and crash dump analysis, enabling live memory scanning, patching, pointer resolution, disassembly, and offline dump examination via structured tool calls.MIT