The JVM MCP Server is a lightweight, non-intrusive monitoring and diagnostic tool that enables AI agents to monitor and diagnose Java applications using native JDK tools.
Core Capabilities:
Java Process Management: List running Java processes with
list_java_processesand retrieve JVM information/statusMemory Monitoring: Track memory usage with
get_memory_infoThread Analysis: Get detailed thread information, stack traces, identify blocking/busy threads, and analyze method call paths with filtering and CPU sampling
Class & Method Inspection: Inspect class structures with
get_class_info, decompile source code, search methods with regex support, and monitor method invocations including parameters and return valuesLogger Management: Retrieve and dynamically set logger levels
System Resource Monitoring: Access real-time dashboards with
get_dashboardJDK Tool Integration: Execute native diagnostic commands including
jcmdandjstatRemote Monitoring: Support for monitoring JVMs on remote hosts via SSH connections
The server provides everything from basic JVM information to advanced method-level analysis, making it ideal for production debugging and performance monitoring.
Allows configuration of environment variables for remote connections through a .env file.
Used to clone the project repository.
Repository hosting for the JVM MCP Server project.
Supported as a target platform for running the JVM MCP Server.
Provides a Python interface for monitoring and analyzing Java processes.
Used for executing commands and configuring environment variables for remote connections.
JVM MCP Server
A JVM monitoring MCP server implementation based on Arthas, providing a simple and easy-to-use Python interface for monitoring and analyzing Java processes.
Features
Automatic download and management of Arthas tools
Support for local and remote Java process monitoring
Java process list querying
Real-time JVM thread information
JVM memory usage monitoring
Thread stack trace information
Class loading information querying
Support for class and method decompilation
Method call monitoring
Dynamic log level adjustment
AI-driven JVM performance analysis
System Requirements
Python 3.10+
Java Runtime Environment (JRE) 8+
Network connection (for downloading Arthas)
SSH access to target server (if using remote mode)
Installation and Environment Setup
1. Install uv tool
2. Clone the project
3. Initialize project environment using uv
4. Configure environment variables (Optional, for remote connections)
Create a .env file and add the following configurations:
Quick Start
Start the server using uv:
Use in Python code:
Using MCP tools:
Using configuration file:
Without using configuration file, it will read system environment variables, if not present it will monitor local threads:
Available Tools
Important Notes
Ensure Java is installed in the runtime environment
Arthas tool will be automatically downloaded on first run (arthas will be downloaded to home directory, can be downloaded in advance and named as arthas-boot.jar)
Requires access permissions to target Java process
Remote mode requires SSH access and appropriate user permissions
Recommended for use in development environment, production use should be carefully evaluated
Feedback
If you encounter any issues, please submit an Issue or Pull Request.
License
Related MCP Servers
- -security-license-qualityA Python-based server allowing seamless integration with JIRA for managing and interacting with projects through custom APIs.Last updated -4Apache 2.0
- AsecurityAlicenseAqualityA lightweight server that provides real-time system information including CPU, memory, disk, and GPU statistics for monitoring and diagnostic purposes.Last updated -1MIT License
- AsecurityAlicenseAqualityA server monitoring and inspection tool collection that provides remote utilities for checking network interfaces, service statuses, and firewall configurations on servers.Last updated -1943MIT License
- -securityFlicense-qualityAn advanced system monitoring solution that uses unsupervised machine learning algorithms to detect abnormal resource usage patterns in real-time, with features including anomaly detection, process analysis, and Discord integration.Last updated -1