BJ

brunoborges/jvm-diagnostics-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

73 stars 7 forks 质量 63 趋势 0MIT

brunoborges/jvm-diagnostics-mcp 是从 https://github.com/brunoborges/jvm-diagnostics-mcp. 导入的 MCP 服务器候选

概览

brunoborges/jvm-diagnostics-mcp 是从 https://github.com/brunoborges/jvm-diagnostics-mcp. 导入的 MCP 服务器候选

概述(AI 翻译)

这是一个MCP服务器,包裹了各种JVM诊断工具(CLI),如jstat、jcmd、jps,添加了一个很好的提示以改善它们的工作,并公开它们。

它能做什么?

它能够访问多种JVM诊断工具,因此可以执行以下任务:

  • 使用 jstat 监控 JVM 性能指标。
  • 通过jps检查和管理JVM进程。
  • 使用jcmd执行诊断命令。
  • 分析线程转储、堆转储及其他与JVM相关的诊断。

使用安全吗?

由于MCP服务器由大型语言模型驱动,我们建议谨慎并验证其生成的命令。如果你使用可靠的大型语言模型,如Claude 3.7或GPT-4o,这些工具在JVM工具上有出色的训练数据,我们的体验非常不错。

请阅读我们的许可证,上面写着“软件按原样提供,不保证任何形式”,因此使用该MCP服务器需自行承担风险。

它安全吗?我应该在远程服务器上运行吗?

简短回答:不。

这个MCP服务器会帮你运行JVM诊断命令,攻击者可能会利用它执行其他命令。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

JVM Diagnostics MCP

This is an MCP Server that wraps various JVM diagnostic tools (CLI) such as jstat, jcmd, jps, adds a nice prompt to improve how they work, and exposes them.

What can it do?

It has access to various JVM diagnostic tools, so it can perform tasks such as:

  • Monitoring JVM performance metrics using jstat.
  • Inspecting and managing JVM processes with jps.
  • Executing diagnostic commands with jcmd.
  • Analyzing thread dumps, heap dumps, and other JVM-related diagnostics.

Is it safe to use?

As the MCP server is driven by an LLM, we recommend being cautious and validating the commands it generates. If you’re using a reliable LLM like Claude 3.7 or GPT-4o, which has excellent training data on JVM tools, our experience has been very good.

Please read our License which states that “THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND”, so you use this MCP server at your own risk.

Is it secured, and should I run this on a remote server?

Short answer: NO.

This MCP server runs JVM diagnostic commands for you and could be exploited by an attacker to run other commands. The current implementation, as with most MCP servers at the moment, only works with the stdio transport: it’s supposed to run locally on your machine, using your JVM tools, as you would do by yourself.

In the future, it’s possible to have this MCP server support the http transport and token-based authentication, so that it could be used remotely by different persons. This will be considered once the MCP specification and SDK are more stable.

How do I install it?

This MCP server currently only works with the stdio transport, so it should run locally on your machine, using your JVM diagnostic tools.

This server can run as a Java application or inside a Docker container. If Java is installed on your machine, this first option is probably the easiest one. If you don’t have Java installed, or if you want to have something a bit more secure, you can use the second option.

Install and configure the server with Java

  • Make sure you have Java 17 or higher installed. You can check this by running java -version in your terminal.
  • Ensure that JVM diagnostic tools like jstat, jcmd, and jps are available in your environment.

Binaries are available on the GitHub Release page, here’s how you can download the latest one with the GitHub CLI:

  • Download the latest release: gh release download --repo brunoborges/jvm-diagnostics-mcp --pattern='jvm-diagnostics-mcp.jar'

To use the server from Claude Desktop, add the server to your claude_desktop_config.json file. Please note that you need to point to the location where you downloaded the jvm-diagnostics-mcp.jar file.

{
    "mcpServers": {
        "jvm-diagnostics": {
            "command": "java",
            "args": [
                "-jar",
在 GitHub 查看完整 README

安装

docker run -i --rm -e JAVA_HOME ghcr.io/brunoborges/jvm-diagnostics-mcp:latest
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "jvm-diagnostics": { "command": "java", "args": [ "-jar", "~/Downloads/jvm-diagnostics-mcp.jar" ] } } }