Labsco
MCP SERVER

JVM MCP Server

by xzq-xu

Inspect a running Java process — threads, memory, loaded classes — using the JDK tools already on the box, locally or over SSH.

Runtime Debugging & Crash Analysis
Summary
Diagnose a JVM with what is already installed on the box.

The usual answer to "why is this Java service stuck" is to attach a profiler, which means getting something new onto a production host. This reaches for jps and jstack instead, so the same session can list the processes, pull the stacks and read memory without changing anything on the target. The trade-off is honest and visible in the tool reference: the basic monitoring group returns parsed results, while the method-tracing and logger tools are still filling in.

What it is

A Python MCP server that wraps the diagnostic commands shipped with the JDK — jps, jstack, jmap, jinfo, jcmd, jstat — so an assistant can look at a live Java process. Nothing is installed into the target application and no agent is attached, which is what makes it usable against a machine you did not prepare in advance.

What you get
  • Find the process to look at — list_java_processes returns pid, name and launch arguments
  • The state of one process — get_jvm_info, get_memory_info and get_thread_info
  • Thread stacks, with the option to show only blocked threads or to sample on an interval — get_stack_trace
  • Loaded classes and their structure, matched by wildcard or regular expression, with fields on request — get_class_info
  • Raw JDK commands when a named tool does not fit — get_jcmd_output takes any jcmd subcommand, get_jstat_output takes a jstat option with interval and count
  • A method-level group the tool reference marks as not yet returning structured output: get_stack_trace_by_method, decompile_class, search_method, watch_method, get_logger_info, set_logger_level and get_dashboard
Requirements

Python 3.6 or later and a JDK 8 or later on the machine that will run the commands — the JDK is the dependency that matters, since every tool shells out to it. Install with pip install jvm-mcp-server or uv pip install jvm-mcp-server. To read a remote host instead, set SSH_HOST, SSH_PORT, SSH_USER and either SSH_PASSWORD or SSH_KEY. Attaching to a JVM needs permission: list_java_processes uses jps and works unprivileged, but jstack, jmap, jinfo and jcmd fail unless the server runs as the same user as the target process, or under sudo.

Setup effort

One command — pip install jvm-mcp-server