Get the FREE Ultimate OpenClaw Setup Guide →

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.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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):

  1. Install uv (if not already installed):

  2. Install the JVM MCP Server package: uv pip install jvm-mcp-server

  3. (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 .

  4. 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

Sponsor this space

Reach thousands of developers