list_java_processesLABSCO 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.10 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. The client configuration the README publishes runs from a clone of the repository with uv (uv sync, then uv --directory … run jvm-mcp-server); the package is also on PyPI as 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
Build from source
USE CASES
A Java service has stopped responding
List the running processes, pull thread stacks and filter to the threads that are blocked or waiting on a lock.
Suspecting a memory leak
Read heap usage, then look at which classes hold the most instances.
Watching garbage collection over a few minutes
Run jstat with an option, an interval and a sample count, and read the series back in the conversation.
Checking a process on a server you are not logged into
Set the SSH variables and run the same diagnostics against the remote host.
Confirming which build is actually deployed
Read the JVM's flags and system properties, and search the loaded classes for the ones you expect.
15 tools
Listed in project docs. Your client may show a different list.
get_thread_infoget_jvm_infoget_memory_infoget_stack_traceget_class_infoget_stack_trace_by_methoddecompile_classsearch_methodwatch_methodget_logger_infoset_logger_levelget_dashboardget_jcmd_outputget_jstat_outputBEFORE YOU INSTALL
What to know first
Tools you get
15 tools named in the project's documentation.
Requires
- git on PATH
- uv on PATH
- Python 3.10+
- JDK 8+ (jps, jstack, jmap, jinfo, jcmd, jstat)
INSTALLATION
Connect your client
MCP Clients
Any MCP client — From Source
git clone https://github.com/xzq-xu/jvm-mcp-server.git
cd jvm-mcp-server
uv venv
uv syncThe block passes --env-file .env from this folder: for remote mode, put SSH_HOST, SSH_PORT, SSH_USER and SSH_PASSWORD or SSH_KEY in that .env; local mode needs no values
{
"mcpServers": {
"jvm-mcp-server": {
"command": "uv",
"args": [
"--directory",
"<YOUR_PATH_TO_JVM_MCP_SERVER>",
"run",
"--env-file",
"<YOUR_PATH_TO_JVM_MCP_SERVER>/.env",
"jvm-mcp-server"
]
}
}
}