JVM MCP Server

JVM MCP Server

Lightweight multi-agent protocol server for JVM monitoring and diagnostics.

71
Stars
15
Forks
71
Watchers
2
Issues
JVM MCP Server provides a lightweight, zero-dependency server that implements the Multi-Agent Communication Protocol for monitoring and diagnosing Java applications. It leverages native JDK tools to enable powerful AI agent interactions for gathering JVM metrics, analyzing memory and threads, and performing advanced diagnostics without relying on third-party software. The server supports both local and remote Java environments through SSH, ensuring cross-platform compatibility and secure operation.

Key Features

Zero dependencies using native JDK tools
Supports both local and remote JVM monitoring via SSH
Process listing and JVM information retrieval
Memory usage and thread stack trace analysis
Class loading statistics and structure inspection
Method invocation monitoring and call path analysis
Real-time logger level management
System resource dashboard
Lightweight and non-intrusive operation
Cross-platform compatibility (Linux/Unix/Windows)

Use Cases

Automated JVM process and health monitoring in production environments
Remote diagnostics of Java applications without direct access
Memory leak detection through analysis of memory and thread dumps
Troubleshooting application performance and deadlocks
Security auditing by monitoring JVM behavior through native tools
Providing AI agents with runtime insights for optimizing Java workloads
Visualizing system resource utilization for capacity planning
Non-intrusive monitoring for compliance or regulated systems
Assisting developers in debugging live JVMs remotely
Managing JVM logging levels dynamically in distributed applications

README

JVM MCP Server

English | 中文

MseeP.ai Security Assessment Badge

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

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)

bash
# 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

Using pip

bash
pip install jvm-mcp-server

From Source

bash
# 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 .

Quick Start

Starting the Server

Using uv (Recommended)

bash
# Local mode
uv run jvm-mcp-server

# Using environment variables file for remote mode
uv run --env-file .env jvm-mcp-server

# In specific directory
uv --directory /path/to/project run --env-file .env jvm-mcp-server

Using uvx

bash
# Local mode
uvx run jvm-mcp-server

# With environment variables
uvx run --env-file .env jvm-mcp-server

Using Python directly

python
from jvm_mcp_server import JvmMcpServer

# Local mode
server = JvmMcpServer()
server.run()

# Remote mode (via environment variables)
# Set SSH_HOST, SSH_PORT, SSH_USER, SSH_PASSWORD or SSH_KEY
import os
os.environ['SSH_HOST'] = 'user@remote-host'
os.environ['SSH_PORT'] = '22'
server = JvmMcpServer()
server.run()

Using with MCP Configuration

json
{
  "mcpServers": {
    "jvm-mcp-server": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/jvm-mcp-server",
        "run",
        "--env-file",
        "/path/to/jvm-mcp-server/.env",
        "jvm-mcp-server"
      ]
    }
  }
}

Available Tools

JVM-MCP-Server provides a comprehensive set of tools for JVM monitoring and diagnostics:

  • list_java_processes: List all Java processes
  • get_thread_info: Get thread information for a specific process
  • get_jvm_info: Get JVM basic information
  • get_memory_info: Get memory usage information
  • get_stack_trace: Get thread stack trace information
  • get_class_info: Get detailed class information including structure
  • get_stack_trace_by_method: Get method call path
  • decompile_class: Decompile class source code
  • search_method: Search for methods in classes
  • watch_method: Monitor method invocations
  • get_logger_info: Get logger information
  • set_logger_level: Set logger levels
  • get_dashboard: Get system resource dashboard
  • get_jcmd_output: Execute JDK jcmd commands
  • get_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:

  1. Command Layer: Wraps JDK native commands
  2. Executor Layer: Handles local and remote command execution
  3. Formatter Layer: Processes and formats command output
  4. MCP Interface: Exposes functionality through FastMCP protocol

Key Components

  • BaseCommand: Abstract base class for all commands
  • CommandExecutor: Interface for command execution (local and remote)
  • OutputFormatter: Interface for formatting command output
  • JvmMcpServer: 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.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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

Star History

Star History Chart

Repository Owner

xzq-xu
xzq-xu

User

Repository Details

Language Python
Default Branch main
Size 317 KB
Contributors 5
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

Python
100%

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • VictoriaMetrics MCP Server

    VictoriaMetrics MCP Server

    Model Context Protocol server enabling advanced monitoring and observability for VictoriaMetrics.

    VictoriaMetrics MCP Server implements the Model Context Protocol (MCP) to provide seamless integration with VictoriaMetrics, allowing advanced monitoring, data exploration, and observability. It offers access to almost all read-only APIs, as well as embedded documentation for offline usage. The server facilitates comprehensive metric querying, cardinality analysis, alert and rule testing, and automation capabilities for engineers and tools.

    • 87
    • MCP
    • VictoriaMetrics-Community/mcp-victoriametrics
  • Maven Tools MCP Server

    Maven Tools MCP Server

    Universal Maven Central dependency intelligence server for JVM build tools via the Model Context Protocol.

    Maven Tools MCP Server provides an MCP-compliant API delivering rich Maven Central dependency intelligence for JVM build tools like Maven, Gradle, SBT, and Mill. It enables AI assistants to instantly analyze, interpret, and recommend updates, health checks, and maintenance insights by reading maven-metadata.xml directly from Maven Central. With Context7 integration, it supports orchestration and documentation, enabling bulk analysis, stable version filtering, risk assessment, and rapid cached responses. Designed for seamless integration into AI workflows via the Model Context Protocol.

    • 14
    • MCP
    • arvindand/maven-tools-mcp
  • Last9 MCP Server

    Last9 MCP Server

    Enables AI agents to access real-time production observability data for automated code fixes.

    Last9 MCP Server is an implementation of the Model Context Protocol (MCP) designed to provide seamless integration between AI agents and production observability data. It allows tools and agents to fetch live logs, metrics, traces, events, and alerts from Last9 systems, supporting a range of development environments and IDEs. This enables faster debugging, automated code fixes, and insightful context directly within local development workflows.

    • 46
    • MCP
    • last9/last9-mcp-server
  • MCP System Monitor

    MCP System Monitor

    Real-time system metrics for LLMs via Model Context Protocol

    MCP System Monitor exposes real-time system metrics, such as CPU, memory, disk, network, host, and process information, through an interface compatible with the Model Context Protocol (MCP). The tool enables language models to retrieve detailed system data in a standardized way. It supports querying various hardware and OS statistics via structured tools and parameters. Designed with LLM integration in mind, it facilitates context-aware system monitoring for AI-driven applications.

    • 73
    • MCP
    • seekrays/mcp-monitor
  • Mifos MCP - Model Context Protocol (MCP)

    Mifos MCP - Model Context Protocol (MCP)

    Enabling AI agents to access and operate on financial data in the Mifos X ecosystem using Model Context Protocol.

    Mifos MCP provides a Model Context Protocol (MCP) interface tailored for the Mifos X ecosystem, empowering AI agents to interact with financial data and perform operations within the platform. It offers a Java (Quarkus) implementation, with easy configurability via environment variables and native executable support. Developers can test and debug deployments with the MCP Inspector, and detailed instructions ensure smooth setup and integration. Comprehensive examples demonstrate practical banking and financial automation workflows.

    • 17
    • MCP
    • openMF/mcp-mifosx
  • Vibe Check MCP

    Vibe Check MCP

    Plug & play agent oversight tool to keep LLMs aligned, reflective, and safe.

    Vibe Check MCP provides a mentor layer over large language model agents to prevent over-engineering and promote optimal, minimal pathways. Leveraging research-backed oversight, it integrates seamlessly as an MCP server with support for STDIO and streamable HTTP transport. The platform enhances agent reliability, improves task success rates, and significantly reduces harmful actions. Designed for easy plug-and-play with MCP-aware clients, it is trusted across multiple MCP platforms and registries.

    • 315
    • MCP
    • PV-Bhat/vibe-check-mcp-server
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results