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 lightweight JVM monitoring and diagnostic MCP (Multi-Agent Communication Protocol) server implementation based on native JDK tools. Provides AI agents with powerful capabilities to monitor and analyze Java applications without requiring third-party tools like Arthas.
Features
Zero Dependencies: Uses only native JDK tools (jps, jstack, jmap, etc.)
Lightweight: Minimal resource consumption compared to agent-based solutions
High Compatibility: Works with all Java versions and platforms
Non-Intrusive: No modifications to target applications required
Secure: Uses only JDK certified tools and commands
Remote Monitoring: Support for both local and remote JVM monitoring via SSH
Related MCP server: MCP System Info Server
Core Capabilities
Basic Monitoring
Java process listing and identification
JVM basic information retrieval
Memory usage monitoring
Thread information and stack trace analysis
Class loading statistics
Detailed class structure information
Advanced Features
Method call path analysis
Class decompilation
Method search and inspection
Method invocation monitoring
Logger level management
System resource dashboard
System Requirements
Python 3.6+
JDK 8+
Linux/Unix/Windows OS
SSH access (for remote monitoring)
Installation
Using uv (Recommended)
Using pip
From Source
Quick Start
Starting the Server
Using uv (Recommended)
Using uvx
Using Python directly
Using with MCP Configuration
Available Tools
JVM-MCP-Server provides a comprehensive set of tools for JVM monitoring and diagnostics:
list_java_processes: List all Java processesget_thread_info: Get thread information for a specific processget_jvm_info: Get JVM basic informationget_memory_info: Get memory usage informationget_stack_trace: Get thread stack trace informationget_class_info: Get detailed class information including structureget_stack_trace_by_method: Get method call pathdecompile_class: Decompile class source codesearch_method: Search for methods in classeswatch_method: Monitor method invocationsget_logger_info: Get logger informationset_logger_level: Set logger levelsget_dashboard: Get system resource dashboardget_jcmd_output: Execute JDK jcmd commandsget_jstat_output: Execute JDK jstat commands
For detailed documentation on each tool, see Available Tools.
Architecture
JVM-MCP-Server is built on a modular architecture:
Command Layer: Wraps JDK native commands
Executor Layer: Handles local and remote command execution
Formatter Layer: Processes and formats command output
MCP Interface: Exposes functionality through FastMCP protocol
Key Components
BaseCommand: Abstract base class for all commandsCommandExecutor: Interface for command execution (local and remote)OutputFormatter: Interface for formatting command outputJvmMcpServer: Main server class that registers all tools
Development Status
The project is in active development. See Native_TODO.md for current progress.
Completed
Core architecture and command framework
Basic commands implementation (jps, jstack, jmap, jinfo, jcmd, jstat)
Class information retrieval system
MCP tool parameter type compatibility fixes
In Progress
Caching mechanism
Method tracing
Performance monitoring
Error handling improvements
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add some amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgements
JDK tools documentation
FastMCP protocol specification
Contributors and testers