# xzq.xu/jvm-mcp-server [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/xzq-xu/jvm-mcp-server  
**GitHub Stars:** 91  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/xzq-xu-jvm-mcp-server

## Description
An implementation project of a JVM-based MCP (Model Context Protocol) server.

## Tools
Capabilities this server exposes over MCP:

- **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

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "jvm-mcp-server": {
    "command": "uvx",
    "args": ["jvm-mcp-server"],
    "env": {
      "SSH_HOST": "",
      "SSH_PORT": "",
      "SSH_USER": "",
      "SSH_PASSWORD": "",
      "SSH_KEY": ""
    }
  }
}
```

**Requires environment variables:** `SSH_HOST`, `SSH_PORT`, `SSH_USER`, `SSH_PASSWORD`, `SSH_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What xzq.xu/jvm-mcp-server does

The xzq.xu/jvm-mcp-server MCP server connects an MCP client to Java Virtual Machine processes and exposes monitoring and diagnostic actions. It can enumerate Java processes, retrieve basic JVM and memory information, inspect threads and stack traces, and return detailed class information.

For application investigation, the tool set also includes method-path analysis, class decompilation, method search, and method-invocation monitoring. Logger information and logger-level changes are available alongside a system resource dashboard. Direct output from JDK `jcmd` and `jstat` commands can also be requested.

The project is intended for local or remote JVM work. Remote monitoring uses SSH, while local mode runs commands against JVMs on the host where the server is started. Its stated design uses native JDK tools rather than requiring a separate tool such as Arthas.

## How it works

The xzq.xu/jvm-mcp-server MCP server is organized into command, execution, formatting, and MCP interface layers. The command layer wraps native JDK utilities. An executor handles either local commands or SSH-based remote commands, and a formatter processes their output before the MCP interface returns it to the client.

The package exposes the functionality through a FastMCP-based server. Start it with the `jvm-mcp-server` command using `uv`, `uvx`, or Python code that creates `JvmMcpServer`. An MCP client can then invoke the registered tools and provide a process identifier or other operation-specific parameters.

## Setup and configuration

The project requires Python 3.6 or newer and JDK 8 or newer. Installation is documented with either `uv pip install jvm-mcp-server`, `pip install jvm-mcp-server`, or a source checkout installed through the project environment.

Local startup can use `uv run jvm-mcp-server` or the equivalent `uvx` command. A client configuration can launch the server through `uv`, specify the project directory, and optionally load an environment file. Python callers can instantiate `JvmMcpServer` directly and call `run()`.

Remote mode uses SSH settings. The documented variables are `SSH_HOST`, `SSH_PORT`, `SSH_USER`, `SSH_PASSWORD`, and `SSH_KEY`; the example sets the host and port before starting the server. The material does not define default values for these settings.

## Tools and capabilities

The xzq.xu/jvm-mcp-server MCP server provides these tool groups:

- Process and JVM inspection: `list_java_processes`, `get_jvm_info`, and `get_memory_info`.
- Thread diagnostics: `get_thread_info` and `get_stack_trace`.
- Class and method analysis: `get_class_info`, `get_stack_trace_by_method`, `decompile_class`, and `search_method`.
- Runtime observation and logging: `watch_method`, `get_logger_info`, and `set_logger_level`.
- Resource and JDK command access: `get_dashboard`, `get_jcmd_output`, and `get_jstat_output`.

These tools support investigation of running Java applications, including process discovery, runtime state inspection, class inspection, and selected logger or method operations.

## Limitations and notes

Some diagnostic commands, including `jstack`, `jmap`, `jinfo`, and `jcmd`, need sufficient permission to attach to the target JVM. Permission errors can occur when the server user differs from the process owner or when the process has exited.

`list_java_processes` uses `jps` and does not require the same special permissions described for the other diagnostics. Remote use additionally depends on SSH access. The project is in active development; caching, method tracing, performance monitoring, and error-handling improvements are listed as ongoing work.

_Full upstream README: https://allmcps.com/mcp/xzq-xu-jvm-mcp-server/readme_

