JVM
- python
74
GitHub Stars
python
Language
4 months ago
First Indexed
3 weeks ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"xzq-xu-jvm-mcp-server": {
"command": "uv",
"args": [
"run",
"jvm-mcp-server"
]
}
}
}You can monitor and diagnose Java applications remotely or locally using a lightweight MCP server that relies only on native JDK tools. It gives AI agents access to JVM insights without modifying target apps, while supporting secure remote access over SSH when needed.
How to use
Connect to the JVM MCP Server from your MCP client to start monitoring and diagnostics. You can run the server locally for development or in a remote environment. Use the client to list Java processes, fetch JVM information, inspect memory and threads, decompile classes, search and watch methods, and adjust logger levels. The MCP server exposes tools that let you gather runtime data and observe system resource usage through a consistent API.
How to install
Prerequisites you need before installing the MCP server:
-
Python 3.6+
-
JDK 8+
-
Linux/Unix/Windows operating system
-
SSH access if you plan to monitor remote JVMs
Step-by-step installation commands
# Install uv if not already installed
curl -LsSf https://astral.sh/uv/install.sh | sh # Linux/macOS
# or
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" # Windows
# Install the package
uv pip install jvm-mcp-server
# Or install directly with pip
pip install jvm-mcp-server
# From source (optional for development)
# Clone the repository
git clone https://github.com/your-repo/jvm-mcp-server.git
cd jvm-mcp-server
# Using uv (recommended)
uv venv # Create virtual environment
uv sync # Install dependencies
# Or install in development mode
uv pip install -e .
Starting the server
Choose a method to start the server. For local development or simple usage, the uv-based commands are recommended.
# Local mode with uv
uv run jvm-mcp-server
# Remote mode via environment file
uv run --env-file .env jvm-mcp-server
# In a specific directory
uv --directory /path/to/project run --env-file .env jvm-mcp-server
Using with MCP configuration
Configure your MCP client to reference the JVM MCP Server by supplying the execution command and any required environment configuration. The following settings showcase how to wire the server into an MCP configuration file.
{
"mcpServers": {
"jvm_mcp": {
"command": "uv",
"args": [
"run",
"jvm-mcp-server"
]
}
}
}
Notes on remote monitoring
Remote monitoring is supported via SSH when you provide the necessary SSH access details. Ensure SSH keys or credentials are available to connect to the JVM host, and configure the client to operate in remote mode using the appropriate env file or SSH configuration.
Available tools
list_java_processes
List all Java processes currently running on the target host, providing process IDs and basic metadata.
get_thread_info
Fetch thread information and live stack traces for a specific Java process.
get_jvm_info
Retrieve basic JVM information such as version, runtime arguments, and vendor.
get_memory_info
Report memory usage statistics including heap and non-heap usage.
get_stack_trace
Obtain stack traces for one or more threads to diagnose hangs or performance issues.
get_class_info
Provide detailed information about loaded classes, including structure and hierarchy.
get_stack_trace_by_method
Trace method call paths to analyze the sequence of invocations.
decompile_class
Decompile a class to view its source structure for inspection.
search_method
Search for methods across classes to locate relevant code paths.
watch_method
Monitor method invocations in real time to observe behavior under load.
get_logger_info
Retrieve current logger configurations and levels.
set_logger_level
Adjust logger levels for targeted packages or classes at runtime.
get_dashboard
Get a system resource dashboard showing CPU, memory, and I/O metrics.
get_jcmd_output
Execute JDK jcmd commands and return their output.
get_jstat_output
Execute JDK jstat commands to monitor memory and GC activity.