JVM MCP Server

Integrations

  • Allows configuration of environment variables for remote connections through a .env file.

  • Used to clone the project repository.

  • Repository hosting for the JVM MCP Server project.

JVM MCP 服务器

English |中文

基于 Arthas 的 JVM 监控 MCP 服务器实现,提供简单易用的 Python 接口用于监控和分析 Java 进程。

特征

  • Arthas 工具的自动下载和管理
  • 支持本地和远程Java进程监控
  • Java进程列表查询
  • 实时JVM线程信息
  • JVM内存使用情况监控
  • 线程堆栈跟踪信息
  • 类加载信息查询
  • 支持类和方法反编译
  • 方法调用监控
  • 动态日志级别调整
  • AI驱动的JVM性能分析

系统要求

  • Python 3.10+
  • Java 运行时环境 (JRE) 8+
  • 网络连接(用于下载 Arthas)
  • SSH 访问目标服务器(如果使用远程模式)

安装和环境设置

1.安装uv工具

## 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.克隆项目

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

3. 使用 uv 初始化项目环境

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

4.配置环境变量(可选,用于远程连接)

创建.env文件,添加以下配置:

# 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

快速入门

  1. 使用 uv 启动服务器:
# Start in local mode uv run jvm-mcp-server # Start with environment file (if remote connection is configured) uv run --env-file .env jvm-mcp-server # Start in a specific directory (if needed) uv --directory /path/to/project run --env-file .env jvm-mcp-server
  1. 在 Python 代码中使用:
from jvm_mcp_server import JvmMcpServer server = JvmMcpServer() server.run()
  1. 使用 MCP 工具:

使用配置文件:

{ "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" ] } } }

如果不使用配置文件,它将读取系统环境变量,如果不存在,它将监视本地线程:

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

可用工具

可用工具列表

重要提示

  1. 确保运行环境中安装了 Java
  2. 首次运行时会自动下载Arthas工具(arthas会下载到主目录,可以提前下载并命名为arthas-boot.jar)
  3. 需要目标 Java 进程的访问权限
  4. 远程模式需要 SSH 访问和适当的用户权限
  5. 建议在开发环境中使用,生产使用应仔细评估

反馈

如果您遇到任何问题,请提交问题或拉取请求。

执照

MIT 许可证

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

基于 Arthas 的 JVM 监控和控制平台服务器,提供用于监控和分析 Java 进程的 Python 接口,具有线程分析、内存监控和性能诊断功能。

  1. Features
    1. System Requirements
      1. Installation and Environment Setup
        1. 1. Install uv tool
        2. 2. Clone the project
        3. 3. Initialize project environment using uv
        4. 4. Configure environment variables (Optional, for remote connections)
      2. Quick Start
        1. Available Tools
          1. Important Notes
            1. Feedback
              1. License

                Related MCP Servers

                • -
                  security
                  A
                  license
                  -
                  quality
                  A Python-based server allowing seamless integration with JIRA for managing and interacting with projects through custom APIs.
                  Last updated -
                  2
                  Python
                  Apache 2.0
                  • Apple
                  • Linux
                • -
                  security
                  A
                  license
                  -
                  quality
                  A Model Context Protocol server that allows execution of Python code within Daytona workspaces, providing a secure and isolated environment for executing and managing Python scripts.
                  Last updated -
                  1
                  8
                  Python
                  Apache 2.0
                  • Apple
                • A
                  security
                  A
                  license
                  A
                  quality
                  A server monitoring and inspection tool collection that provides remote utilities for checking network interfaces, service statuses, and firewall configurations on servers.
                  Last updated -
                  19
                  11
                  Python
                  MIT License
                  • Linux
                  • Apple
                • -
                  security
                  F
                  license
                  -
                  quality
                  A Python server that enables interaction with macOS native applications (Contacts, Notes, Mail, Messages, Reminders, Calendar, and Maps) through AppleScript, featuring asynchronous operations and type-safe interfaces.
                  Last updated -
                  5
                  Python
                  • Apple

                View all related MCP servers

                ID: 5soe3xcxfw