npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

javaperf

v1.2.0

Published

MCP server for Java application profiling via JDK utilities (jcmd, jfr, jps)

Readme

javaperf

npm version

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 claude_desktop_config.json:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json Linux: ~/.config/Claude/claude_desktop_config.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 JAVA_HOME or which java. If not found, set JAVA_HOME 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 below

For Developers

  1. Clone the repository:
git clone https://github.com/theSharque/mcp-jperf.git
cd mcp-jperf
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Usage

Development Mode

npm run dev

Production Mode

npm start

MCP Inspector

Debug and test with MCP Inspector:

npx @modelcontextprotocol/inspector node dist/index.js

Integration

Cursor IDE

  1. Open Cursor Settings → Features → Model Context Protocol
  2. Click "Edit Config" button
  3. 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 list_java_processes 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/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "javaperf": {
      "command": "npx",
      "args": ["-y", "javaperf"]
    }
  }
}

Continue.dev

Edit .continue/config.json:

{
  "mcpServers": {
    "javaperf": {
      "command": "npx",
      "args": ["-y", "javaperf"]
    }
  }
}

Tools

| Tool | Description | |------|-------------| | list_java_processes | List running Java processes (pid, mainClass, args). Use topN (default 10) to limit. | | start_profiling | Start JFR recording with settings=profile. Pass pid, duration (seconds). Optional: memorysize (e.g. "20M"), stackdepth (default 128). | | list_jfr_recordings | List active JFR recordings for a process. Use before stop_profiling to get recordingId. | | stop_profiling | Stop recording and save to recordings/new_profile.jfr. Requires pid and recordingId. | | check_deadlock | Check for Java-level deadlocks. Returns structured JSON with threads, locks, and cycle. | | analyze_threads | Thread dump (jstack) with deadlock summary. Pass pid, optional topN (default 10). | | heap_histogram | Class histogram (GC.class_histogram). Pass pid, optional topN (20), all (triggers full GC — may pause app). | | heap_dump | Create .hprof heap dump for MAT/VisualVM. Pass pid. Saved to recordings/heap_dump.hprof. | | heap_info | Brief heap summary. Pass pid. | | vm_info | JVM info: uptime, version, flags. Pass pid. | | trace_method | Build call tree for a method from .jfr. Pass className, methodName. Optional: filepath (default new_profile), topN. | | parse_jfr_summary | Parse .jfr into summary: top methods, GC stats, anomalies. Optional: filepath (default new_profile), events, topN. | | profile_memory | Memory profile: top allocators, GC, potential leaks. Optional: filepath (default new_profile), topN. | | profile_time | CPU bottleneck profile (bottom-up). Optional: filepath (default new_profile), topN. | | profile_frequency | Call frequency profile (leaf frames). Optional: filepath (default new_profile), topN. |

Example Workflow

  1. List processeslist_java_processes
  2. Start recordingstart_profiling with pid and duration (e.g. 60)
  3. Wait for duration seconds (or let it run)
  4. Check recordings (optional) → list_jfr_recordings to get recordingId
  5. Stop and savestop_profiling with pid and recordingId
  6. Analyze → Use parse_jfr_summary, profile_memory, profile_time, profile_frequency, or trace_method (filepath defaults to new_profile)

Limitations

  • Sampling: JFR samples ~10ms; fast methods may not appear in ExecutionSample
  • Local only: Runs on the machine where MCP is started
  • Permissions: Must run as same user as target JVM for jcmd access