jvm-mcp-server

xzq-xu/jvm-mcp-server

3.5

If you are the rightful owner of jvm-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A JVM monitoring MCP server implementation based on Arthas, providing a simple and easy-to-use Python interface for monitoring and analyzing Java processes.

Tools

Functions exposed to the LLM to take actions

list_java_processes

列出所有Java进程

get_thread_info

获取指定进程的线程信息

get_jvm_info

获取JVM基础信息

get_memory_info

获取内存使用情况

get_stack_trace

获取线程堆栈信息

        Args:
            pid: 进程ID
            thread_id: 线程ID,如果指定则只显示该线程的堆栈
            top_n: 显示最忙的前N个线程
            find_blocking: 是否查找阻塞其他线程的线程
            interval: CPU使用率统计的采样间隔(毫秒),默认200ms
            show_all: 是否显示所有线程
        

get_class_info

获取类信息

        Args:
            pid: 进程ID
            class_pattern: 类名表达式匹配
            show_detail: 是否显示详细信息,默认false
            show_field: 是否显示成员变量信息(需要show_detail=True),默认false
            use_regex: 是否使用正则表达式匹配,默认false
            depth: 指定输出静态变量时属性的遍历深度,默认1
            classloader_hash: 指定class的ClassLoader的hashcode,默认None
            classloader_class: 指定执行表达式的ClassLoader的class name,默认None
            max_matches: 具有详细信息的匹配类的最大数量
        

get_jvm_status

获取JVM整体状态报告

        Args:
            pid: 可选的进程ID,如果不指定则自动选择第一个非arthas的Java进程
        
        Returns:
            包含JVM状态信息的字典
        

get_version

获取Arthas版本信息

get_stack_trace_by_method

获取方法的调用路径

        Args:
            pid: 进程ID
            class_pattern: 类名表达式匹配
            method_pattern: 方法名表达式匹配
            condition: 条件表达式,例如:'params[0]<0' 或 '#cost>10'
            use_regex: 是否开启正则表达式匹配,默认为通配符匹配
            max_matches: 指定Class最大匹配数量,默认值为50
            max_times: 执行次数限制
        

decompile_class

反编译指定类的源码

search_method

查看类的方法信息

        Args:
            pid: 进程ID
            class_pattern: 类名表达式匹配
            method_pattern: 可选的方法名表达式
            show_detail: 是否展示每个方法的详细信息
            use_regex: 是否开启正则表达式匹配,默认为通配符匹配
            classloader_hash: 指定class的ClassLoader的hashcode
            classloader_class: 指定执行表达式的ClassLoader的class name
            max_matches: 具有详细信息的匹配类的最大数量(默认为100)
        

watch_method

监控方法的调用情况

get_logger_info

获取logger信息

set_logger_level

设置logger级别

get_dashboard

获取系统实时数据面板

Prompts

Interactive templates invoked by user choice

No prompts

Resources

Contextual data attached and managed by the client

No resources