javaperf MCP server
io.github.theSharque/javaperf·v1.4.2·10 starsJava profiling MCP via jcmd/jfr/jps. Diagnose performance, analyze threads, inspect JFR recordings.
10 stars352 downloads/wk
Reviews
Write oneNobody has reviewed javaperf yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
javaperf tools (26, 1 write)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
analyze_threadsThread dump (jstack -l). Default: plain text. Set structured=true for JSON lock-wait chains (live snapshot). Historical contention: profile_jfr_locks. Deadlock cycle: check_deadlock.
check_deadlockChecks for Java-level deadlocks in the specified process. Parses jcmd Thread.print output and returns structured JSON: which threads are involved, what locks they hold/wait for, and the deadlock cycle. Use for automated analysis and reports.
compiler_codecachejcmd Compiler.codecache — code heap usage and related JVM output.
compiler_queuejcmd Compiler.queue — methods queued for JIT compilation.
gc_class_statsjcmd GC.class_stats (class loader / metaspace style stats where supported—often JDK 21+). On older JDK returns error hint; use heap_info or heap_histogram instead.
gc_efficiencyGC efficiency from .jfr: pause time vs freed bytes per collector/cause. Use after stop_profiling; complements profile_memory and heap_info. Not a general JFR summary (see parse_jfr_summary).
gc_finalizer_infojcmd GC.finalizer_info — finalizer queue diagnostics for the live process.
heap_dumpwrite actionCreates .hprof for Eclipse MAT / VisualVM. After heap_live_histogram_diff picks a growing class, use MAT Path to GC Roots (exclude weak/soft). Saved to recordings/heap_dump.hprof. Warning: large file.
heap_histogramStatic class histogram (jcmd GC.class_histogram). For live growth over time use heap_live_histogram_diff instead.
heap_infoBrief heap usage summary: capacities, used, committed regions. Quick snapshot without full dump.
heap_live_histogram_diffTwo GC.class_histogram snapshots spaced by intervalSeconds; returns classes whose instance count grew most. Use first in memory-leak workflow; then profile_memory and heap_dump (MAT path-to-GC-roots). Each snapshot walks the heap and may pause the app.
list_java_processesLists all running Java processes on the machine. Returns an array of objects with pid, mainClass, and args. Use this tool first to discover the target process PID before calling start_profiling or analyze_threads. Data is obtained via jps -l -m.
list_jfr_recordingsLists active and recent JFR recordings for a Java process (jcmd JFR.check). Returns recording id, duration, state (running/stopped), and filename. Use before stop_profiling to get the correct recordingId.
native_memory_summaryjcmd VM.native_memory summary=true. Requires JVM started with -XX:NativeMemoryTracking=summary or detail; otherwise explains how to enable.
parse_jfr_summaryParses a .jfr file and returns a structured summary: top methods by CPU samples, GC statistics, thread allocation stats, and anomaly hints (e.g. high GC count). Use for a quick high-level overview of the recording before diving into specific profiles.
profile_frequencyCall frequency profile from a .jfr file. Counts methods that appear at the leaf (top) of the stack in ExecutionSample events — i.e. methods that were actively executing when sampled. Returns the most frequently sampled methods (exclusive, not cumulative). Use when looking for hot spots or the most often executed code paths.
profile_jfr_file_ioSummarize file read/write events (jdk.FileRead, jdk.FileWrite): counts, bytes, top paths, stack hotspots. Events must exist in recording; configure via start_profiling preset or settingsFile (.jfc).
profile_jfr_locksLock contention from JFR: synchronized monitors (JavaMonitorBlocked) and j.u.c parking (ThreadPark). Live wait chains: analyze_threads structured=true. Deadlocks: check_deadlock. Enable events via custom .jfc if missing.
profile_jfr_nativeCPU-style cumulative hotspots from jdk.NativeMethodSample stacks. Recording must enable NativeMethodSample (often requires custom .jfc).
profile_jfr_networkSummarize JDK socket I/O from a .jfr (jdk.SocketRead, jdk.SocketWrite): event counts, total bytes read/written where available, top endpoints (host:port / address), and cumulative stack hotspots. Recording must include those events (custom .jfc or preset that enables them). If emptyEvents, use start_profiling settingsFile.
profile_memoryJFR memory profile: top allocators by bytes/count, allocation stacks, OldObjectSample by class (allocation site, not GC roots). Pair with heap_live_histogram_diff, gc_efficiency, heap_dump+MAT. Requires profile preset recording.
profile_timeCPU time (bottleneck) profile from a .jfr file. Uses bottom-up aggregation: each method is counted in every sample where it appears in the stack, including time spent in callees. Returns methods consuming the most CPU time. Use when the goal is to find performance bottlenecks and slow code paths.
start_profilingStarts JFR on the target PID. Rotates recordings (old_profile.jfr ← new_profile.jfr). Default preset is profile. Optional preset or settingsFile (.jfc, cwd-relative or absolute)—mutually exclusive. Builtin presets may omit socket/I/O/native/locks; use a custom .jfc for jdk.SocketRead/Write, FileRead/Write, JavaMonitorBlocked, jdk.ThreadPark, NativeMethodSample. Then list_jfr_recordings and stop_pr
stop_profilingStops an active JFR recording and saves it to recordings/new_profile.jfr. Use recordings/new_profile.jfr for current data, recordings/old_profile.jfr for previous (before/after comparison).
trace_methodBuilds a call tree for a specific method from a .jfr file. Filters ExecutionSample events to find stack traces containing the given class and method, then aggregates call paths. Use when you want to see who calls a particular method and from where. Limitation: JFR sampling (~10 ms) may miss very fast methods.
vm_infoJVM information: uptime, version, and flags. Useful for environment verification.
Public scan report
scanner v0.1.9 · 2026-09-27 · same rubric, same numbers if you re-run it
- Code scan108 source files scanned25/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitylocal package, no credentials required12/15
- Maintenancelast push 0 days ago15/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
How javaperf compares
Against every graded MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 92/100
- higher than 93% of 48,243 servers
- Tools
- 26
- the typical server has 7
- Tools that change things
- 4%
- typical: 0%. Fewer write tools means less an agent can break
- GitHub stars
- 10
- more than 88% of 28,706 servers
- Downloads a week
- 352
- more than 83% of 12,306 servers with a package
What its tools let an agent do: 23 read · 1 change · 2 run or deploy
Release history: 2 versions in the registry since 2026-05-23, latest 2026-09-27, typically one every 127 days.
Install javaperf in Claude Code, Cursor or VS Code
Runs npx -y javaperf on your machine. Read the scan report first; the gateway never runs local packages.
claude mcp add javaperf -- npx -y javaperf
What the publisher says
From the javaperf repository's README, as published. We do not edit it. Read it on GitHub
javaperf
MCP (Model Context Protocol) 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.
📦 Install: npm install -g javaperf or use via npx 🌐 npm: https://www.npmjs.com/package/javaperf
How to connect to Claude Desktop / IDE
Add the server to your MCP config. Example for claudedesktopconfig.json:
macOS: ~/Library/Application Support/Claude/claudedesktopconfig.json Windows: %APPDATA%\Claude\claudedesktopconfig.json Linux: ~/.config/Claude/claudedesktopconfig.json
{
"mcpServers": {
"javaperf": {
"command": "npx",
"args": ["-y", "javaperf"]
}
}
}For Cursor IDE: Settings → Features → Model Context Protocol → Edit Config, then add the same block inside mcpServers. See the Integration section for more options (local dev, custom JAVA_HOME, etc.).
Requirements
- Node.js v18+
- JDK 8u262+ or 11+ with JFR support
JDK tools (jps, jcmd, jfr) are auto-detected via JAVAHOME or which java. If not found, set JAVAHOME to your JDK root.
Quick Start
For Users (using npm package)
# No installation needed - use directly in Cursor/Claude Desktop
# Just configure it as described in Integration section belowFor Developers
- Clone the repository:
git clone https://github.com/theSharque/mcp-jperf.git
cd mcp-jperf- Install dependencies:
npm install- Build the project:
npm run buildUsage
Development Mode
npm run devProduction Mode
npm startMCP Inspector
Debug and test with MCP Inspector:
npx @modelcontextprotocol/inspector node dist/index.jsIntegration
Cursor IDE
- Open Cursor Settings → Features → Model Context Protocol
- Click "Edit Config" button
- Add one of the configurations below
Option 1: Via npm (Recommended)
Installs from npm registry automatically:
{
"mcpServers": {
"javaperf": {
"command": "npx",
"args": ["-y", "javaperf"]
}
}
}Option 2: Via npm link (Development)
For local development with live changes:
{
"mcpServers": {
"javaperf": {
"command": "javaperf"
}
}
}Requires: cd /path/to/mcp-jperf && npm link -g
Option 3: Direct path
{
"mcpServers": {
"javaperf": {
"command": "node",
"args": ["dist/index.js"],
"cwd": "${workspaceFolder}",
"env": {
"JAVA_HOME": "/path/to/your/jdk"
}
}
}
}If listjavaprocesses fails with "jps not found", the MCP server may not inherit your shell's JAVA_HOME. Add the env block above with your JDK root path (e.g. /usr/lib/jvm/java-17 or ~/.sdkman/candidates/java/current).
Claude Desktop
Edit ~/Library/Application Support/Claude/claudedesktopconfig.json (macOS) or %APPDATA%\Claude\claudedesktopconfig.json (Windows):
{
"mcpServers": {
"javaperf": {
"command": "npx",
"args": ["-y", "javaperf"]
}
}
}Continue.dev
Edit .continue/config.json:
{
"mcpServers": {
"javaperf": {
"command": "npx",
"args": ["-y", "javaperf"]
}
}
}Tools
Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
javaperf: common questions
- Is javaperf MCP server safe?
- Yes, by our scan: it is graded A (92/100). Read the javaperf safety report
- How do I install javaperf?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does javaperf need an API key?
- Not as far as the registry entry and our scan can tell: no credentials are declared or required.
- Is javaperf maintained?
- The last commit was 39 days ago (2026-09-27). The latest release is v1.4.2.
- How does javaperf compare with other MCP servers?
- safety score 92/100 (higher than 93% of 48,243 servers); tools 26 (the typical server has 7); tools that change things 4% (typical: 0%. Fewer write tools means less an agent can break). Full comparison.