jvm
This is an implementation project of a JVM-based MCP (Model Context Protocol) server. The project aims to provide a standardized MCP server implementation for the JVM platform, enabling AI models to better interact with the Java ecosystem.
claude mcp add --transport stdio xzq-xu-jvm-mcp-server uv run jvm-mcp-server
How to use
JVM-MCP-Server provides a lightweight, zero-dependency way to monitor and diagnose Java applications using native JDK tools (such as jps, jstack, jmap, jinfo, jcmd, jstat) without requiring agent installation. It exposes a suite of tools for listing Java processes, inspecting JVM information, memory and thread analysis, class details, method tracing, and dynamic control of logger levels, all through a FastMCP interface. The server supports both local and remote monitoring (via SSH) and can be run via uv, uvx, or directly from Python, making it flexible for different environments. Tools are organized into categories such as Basic Monitoring, Advanced Features, and System Resource Dashboards, enabling rapid access to targeted diagnostics like memory usage, thread stacks, class information, and decompilation.
How to install
Prerequisites:
- Python 3.6+ and a compatible JDK (8+)
- SSH access for remote monitoring if needed
- uv (Astral UV) is recommended for local/remote operation
Installation steps (recommended uv):
-
Install uv (if not already installed):
- Linux/macOS: curl -LsSf https://astral.sh/uv/install.sh | sh
- Windows: powershell -ExecutionPolicy ByPass -c " irm https://astral.sh/uv/install.ps1 | iex "
-
Install the JVM MCP Server package: uv pip install jvm-mcp-server
-
(Optional) Clone from source and set up in development mode: git clone https://github.com/your-repo/jvm-mcp-server.git cd jvm-mcp-server uv venv uv sync uv pip install -e .
-
Verify installation by listing available commands or running a quick start as shown in the Quick Start section.
Notes:
- If you plan to monitor remote JVMs, ensure SSH access is properly configured and that the environment variables for SSH (SSH_HOST, SSH_PORT, SSH_USER, SSH_PASSWORD or SSH_KEY) are set when needed.
Additional notes
Tips and common considerations:
- For remote monitoring, ensure the target JVM processes are accessible and that SSH credentials are configured either via environment variables or a credentials file.
- The available tools rely on native JDK commands; permission issues may require running the MCP server with elevated privileges or configuring attach permissions on the target JVM.
- If you encounter permission errors when attaching to a process, consider the solutions documented in the project (e.g., running as the same user as the target Java process or using sudo for local runs).
- When deploying in Docker, ensure the container has sufficient permissions (e.g., --privileged or appropriate /proc mount) to attach to Java processes on the host if remote monitoring is intended.
- The MCP server can be controlled via the provided commands and environment-file options to support reproducible remote configurations.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP