JVM MCP Server
by xzq-xu
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
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 Server
基于Arthas的JVM监控MCP服务器实现,提供了一个给ai监控和分析Java进程的mcp。
功能特点
- 自动下载和管理Arthas工具
- 支持本地和远程Java进程监控
- 提供Java进程列表查询
- 实时获取JVM线程信息
- 监控JVM内存使用情况
- 获取线程堆栈信息
- 查询类加载信息
- 支持类和方法的反编译
- 支持方法调用监控
- 支持日志级别动态调整
- 支持AI驱动的JVM性能分析
系统要求
- Python 3.10+
- Java Runtime Environment (JRE) 8+
- 网络连接(用于下载Arthas)
- 如果使用远程模式,需要目标服务器的SSH访问权限
安装与环境配置
1. 安装uv工具
Copy
2. 克隆项目
Copy
3. 使用uv初始化项目环境
Copy
4. 配置环境变量(可选,用于远程连接)
Copy
创建.env
文件并添加以上环境变量
快速开始
- 使用uv启动服务器:
Copy
- 在Python代码中使用:
Copy
- 使用MCP工具:
使用配置文件
Copy
不使用配置文件,将读取系统环境变量的值,如果没有将监听本地线程
Copy
可用工具
注意事项
- 确保运行环境中已安装Java
- 首次运行时会自动下载Arthas工具(arthas将被下载的家目录下,可以提前下载(命名为arthas-boot.jar))
- 需要目标Java进程的访问权限
- 远程模式需要SSH访问权限和适当的用户权限
- 建议在开发环境中使用,生产环境使用需谨慎评估
问题反馈
如遇到问题,请提交Issue或Pull Request。
许可证
This server cannot be installed
A JVM monitoring and control platform server based on Arthas that provides a Python interface for monitoring and analyzing Java processes with capabilities for thread analysis, memory monitoring, and performance diagnostics.