Lists all running Java processes on the target system
Retrieves detailed thread information from a Java process
Retrieves memory usage information from a Java process
Retrieves stack trace information for threads in a Java process
Retrieves information about loaded classes in a Java process
Decompiles a Java class from a running process
Decompiles a specific method from a Java class
Monitors method calls in a Java process
Dynamically changes the log level for a logger in a Java process
JVM Monitoring provides a comprehensive interface for monitoring and analyzing Java applications. Built on top of the powerful Arthas diagnostic tool, it enables developers and operations teams to inspect running Java processes, monitor JVM performance metrics, and troubleshoot issues in both local and remote environments. This tool bridges the gap between AI assistants and the Java ecosystem, allowing for real-time analysis of thread states, memory usage, class information, and method execution. With support for both local and remote Java processes, it's a versatile solution for Java application monitoring and debugging.
JVM Monitoring is a Model Context Protocol (MCP) server that provides AI assistants with the ability to monitor and analyze Java applications. It leverages Arthas, a powerful Java diagnostic tool, to offer deep insights into running JVM processes.
First, you need to install the UV package manager, which is used to manage the Python environment:
Linux/macOS:
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows (PowerShell):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Alternatively, you can install UV using pip:
pip install uv
git clone https://github.com/xzq-xu/jvm-mcp-server.git
cd jvm-mcp-server
# Create virtual environment
uv venv
# Install dependencies
uv sync
If you want to monitor Java processes on a remote server, create a .env
file in the project directory with the following content:
ARTHAS_SSH_HOST=user@remote-host
ARTHAS_SSH_PORT=22 # Optional, default is 22
ARTHAS_SSH_PASSWORD=your-password # If using password authentication
Local Mode:
uv run jvm-mcp-server
Remote Mode (with environment file):
uv run --env-file .env jvm-mcp-server
To use JVM Monitoring with AI assistants, you need to configure the MCP server in your AI assistant's configuration. The server will automatically download and manage the Arthas tool if it's not already present.
When first connecting to a Java process, the server will attach Arthas to it, allowing for non-intrusive monitoring and analysis.