# jvm-mcp-server

> MCP Server

This repository provides a JVM monitoring MCP server based on Arthas, offering a Python interface for analyzing Java processes locally or remotely. It supports real-time thread and memory monitoring, along

## Overview

- **Category:** System Tools
- **Language:** Python
- **Stars:** 89
- **Forks:** 6
- **Owner:** xzq-xu
- **GitHub:** https://github.com/xzq-xu/jvm-mcp-server
- **Created:** 2025-03-10T18:55:52+00:00
- **Updated:** 2025-03-28T12:58:06+00:00
- **Source:** https://model-context-protocol.com/servers/jvm-mcp-server-java-model-context

## Setup

## Setup

1. Install uv tool:

```bash
## linux shell
curl -LsSf https://astral.sh/uv/install.sh | sh
## or install using pip
pip install uv
## or install using pipx (if you have pipx installed)
pipx install uv 
## windows powershell
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```

2. Clone the project:

```bash
git clone https://github.com/xzq-xu/jvm-mcp-server.git
cd jvm-mcp-server
```

3. Initialize project environment using uv:

```bash
# Create virtual environment
uv venv
# Sync project dependencies
uv sync
```

4. Configure environment variables (Optional, for remote connections):

Create a `.env` file and add the following configurations:

```bash
# Linux/Mac
ARTHAS_SSH_HOST=user@remote-host
ARTHAS_SSH_PORT=22  # Optional, default is 22
ARTHAS_SSH_PASSWORD=your-password  # If using password authentication

# Windows PowerShell
$env:ARTHAS_SSH_HOST="user@remote-host"
$env:ARTHAS_SSH_PORT="22"  # Optional, default is 22
$env:ARTHAS_SSH_PASSWORD="your-password"  # If using password authentication
```

## Tools

## Available Tools

1. Automatic download and management of Arthas tools
2. Support for local and remote Java process monitoring
3. Java process list querying
4. Real-time JVM thread information
5. JVM memory usage monitoring
6. Thread stack trace information
7. Class loading information querying
8. Support for class and method decompilation
9. Method call monitoring
10. Dynamic log level adjustment
11. AI-driven JVM performance analysis
