JMX MCP Serverのロゴ

JMX MCP Server

コミュニティ
itz4blitz

A powerful Model Context Protocol (MCP) server that enables AI assistants like Claude Desktop to monitor and manage Java applications through JMX. Provides real-time MBean discovery, attribute management, and natural language JMX operations.

公開者itz4blitz
リポジトリJMX-MCP
言語Java
フォーク
3
スター
10
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    JMX MCP Serverは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには10件のスターと3件のフォークがあります。

JMX MCP Server

Java Spring Boot MCP License

A powerful Model Context Protocol (MCP) server that provides comprehensive JMX monitoring and management capabilities for AI assistants like Claude Desktop. Monitor Java applications, manage MBeans, and perform JMX operations through natural language interactions.

🎥 Demo Video

Watch the JMX MCP Server in action! See how Claude Desktop can monitor and manage Java applications through natural language:

https://github.com/user-attachments/assets/722e1885-5aeb-4584-8116-b93324e0abc1

The demo shows real-time JMX monitoring, MBean exploration, and AI-powered Java application management through Claude Desktop.

🚀 Features

🔍 Comprehensive JMX Integration

  • Real-time MBean Discovery: Automatically discovers and catalogs all available MBeans
  • Attribute Management: Read and write MBean attributes with full type safety
  • Operation Execution: Execute MBean operations with parameter validation
  • Domain Exploration: Browse and filter MBeans by domain

🤖 AI-Powered Monitoring

  • Natural Language Queries: Ask questions like "What's the current heap memory usage?"
  • Intelligent Analysis: AI can correlate metrics and identify performance issues
  • Automated Insights: Get recommendations based on JMX data patterns

🛡️ Enterprise-Ready

  • Security Validation: Built-in security controls and access validation
  • Connection Management: Robust local and remote JMX connection handling
  • Error Handling: Comprehensive error handling and recovery mechanisms
  • Production Logging: Configurable logging for different environments

🔌 MCP Protocol Compliance

  • Tools: 12 JMX management tools for AI interaction
  • Resources: All JMX attributes exposed as discoverable resources
  • STDIO Transport: Optimized for Claude Desktop integration
  • JSON-RPC 2.0: Full protocol compliance for reliable communication

📋 Prerequisites

  • Java 17+ (OpenJDK or Oracle JDK)
  • Maven 3.6+ for building
  • Claude Desktop or any MCP-compatible AI client

🛠️ Quick Start

1. Clone and Build

bash
git clone https://github.com/itz4blitz/JMX-MCP.git
cd JMX-MCP
mvn clean package

2. Test the Server

bash
# Test with comprehensive validation
python3 comprehensive-test.py

3. Configure Claude Desktop

Add to your Claude Desktop MCP configuration file:

Location:

  • macOS: ~/.config/claude/mcp_servers.json
  • Windows: %APPDATA%\Claude\mcp_servers.json

Configuration:

json
{
  "mcpServers": {
    "jmx-mcp-server": {
      "command": "java",
      "args": [
        "-Xmx512m",
        "-Xms256m",
        "-Dspring.profiles.active=stdio",
        "-Dspring.main.banner-mode=off",
        "-Dlogging.level.root=OFF",
        "-Dspring.main.log-startup-info=false",
        "-jar",
        "/path/to/your/jmx-mcp-server-1.0.0.jar"
      ],
      "env": {
        "JAVA_OPTS": "-Djava.awt.headless=true"
      }
    }
  }
}

4. Start Using with Claude

Restart Claude Desktop and try these queries:

"What JMX tools are available?"
"Show me the current heap memory usage"
"List all MBean domains"
"What's the garbage collection performance?"

🔧 Available Tools (12 Total)

Core JMX Operations

ToolDescriptionExample Usage
listMBeansList all discovered MBeans with optional domain filtering"Show me all memory-related MBeans"
getMBeanInfoGet detailed information about a specific MBean"Tell me about the Runtime MBean"
getAttributeRead the value of an MBean attribute"What's the current heap memory usage?"
setAttributeSet the value of a writable MBean attribute"Set the log level to DEBUG"
listDomainsList all available MBean domains"What domains are available?"

Connection Management

ToolDescriptionExample Usage
listJmxConnectionsList all configured JMX connections"Show me all available connections"
addJmxConnectionAdd a new JMX connection"Connect to the production server"
removeJmxConnectionRemove a JMX connection"Remove the old test connection"
switchJmxConnectionSwitch to a different JMX connection"Switch to the staging environment"
getConnectionInfoGet current JMX connection status and statistics"Is the JMX connection healthy?"

Service Discovery

ToolDescriptionExample Usage
discoverJmxServicesDiscover JMX-enabled Java applications on the system"Find all Java apps with JMX enabled"
autoRegisterDiscoveredConnectionsAutomatically register discovered JMX services"Auto-connect to all discovered Java apps"

📊 Available Resources

The server automatically exposes all JMX attributes as MCP resources, making them discoverable and accessible to AI assistants:

  • Memory Metrics: Heap usage, non-heap usage, memory pools
  • Garbage Collection: GC statistics, collection times, collection counts
  • Threading: Thread counts, deadlock detection, thread states
  • Runtime Information: JVM uptime, start time, system properties
  • Class Loading: Loaded classes, unloaded classes, class path
  • Operating System: CPU usage, system load, available processors

Resource URI Format:

jmx://domain:type=Type,name=Name/attributes/AttributeName

Example Resources:

jmx://java.lang:type=Memory/attributes/HeapMemoryUsage
jmx://java.lang:type=Runtime/attributes/Uptime
jmx://java.lang:type=GarbageCollector,name=G1_Young_Generation/attributes/CollectionCount

💬 Example Interactions

Memory Monitoring

User: "What's the current memory situation?"
Claude: I'll check the JMX memory metrics for you.

[Uses getAttribute tool to read HeapMemoryUsage]

The current heap memory usage is:
- Used: 245 MB
- Committed: 512 MB  
- Max: 2048 MB
- Usage: 12% of maximum heap

The application is running efficiently with low memory pressure.

Performance Analysis

User: "Are there any performance issues?"
Claude: Let me analyze the JMX performance metrics.

[Uses multiple tools to check GC, threads, and memory]

Performance analysis:
✅ Memory: Healthy (12% heap usage)
✅ GC: Efficient (avg 15ms collection time)
⚠️  Threads: High count (245 threads) - consider investigation
✅ CPU: Normal load

Recommendation: Monitor thread creation patterns.

🏗️ Architecture

┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐
│   Claude AI     │◄──►│  JMX MCP Server  │◄──►│  Java App JMX   │
│                 │    │                  │    │                 │
│ Natural Language│    │ • Tools (12)     │    │ • MBeans        │
│ Queries         │    │ • Resources(224+)│    │ • Attributes    │
│                 │    │ • JSON-RPC 2.0   │    │ • Operations    │
│                 │    │ • Multi-Connect  │    │ • Discovery     │
└─────────────────┘    └──────────────────┘    └─────────────────┘

Core Components

  • JMXConnectionManager: Manages local and remote JMX connections
  • MBeanDiscoveryService: Discovers and catalogs available MBeans
  • JmxService: Provides @Tool-annotated methods for AI interaction
  • JMXToMCPMapper: Maps JMX attributes to MCP resources
  • JmxSecurityValidator: Validates operations for security compliance

⚙️ Configuration Profiles

Default Profile

Standard configuration with full logging for development and debugging.

STDIO Profile

Optimized for Claude Desktop integration:

  • Silent Operation: No console output to avoid JSON-RPC interference
  • Minimal Logging: Error-only logging to prevent file system issues
  • Fast Startup: Optimized initialization for quick AI responses

🧪 Testing

Comprehensive Test Suite

bash
# Run the comprehensive integration test
python3 comprehensive-test.py

Test Coverage:

  • ✅ MCP Protocol compliance
  • ✅ JSON-RPC 2.0 communication
  • ✅ All 12 tools registration and execution
  • ✅ Multi-connection management
  • ✅ Service discovery and auto-registration
  • ✅ Resource discovery and access
  • ✅ Error handling and recovery

Unit Tests

bash
mvn test

🔒 Security

Built-in Security Features

  • ObjectName Validation: Prevents access to sensitive MBeans
  • Operation Filtering: Restricts dangerous operations
  • Type Safety: Validates attribute types before operations
  • Access Control: Configurable security policies

Security Configuration

yaml
jmx:
  security:
    enabled: true
    allowed-domains:
      - "java.lang"
      - "java.nio"
      - "com.myapp"
    blocked-operations:
      - "shutdown"
      - "restart"

🚀 Deployment

Local Development

bash
java -jar target/jmx-mcp-server-1.0.0.jar

Production Deployment

bash
java -Xmx1g -Xms512m \
     -Dspring.profiles.active=production \
     -jar jmx-mcp-server-1.0.0.jar

Docker Deployment

dockerfile
FROM openjdk:17-jre-slim
COPY target/jmx-mcp-server-1.0.0.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/app.jar"]

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass
  6. Submit a pull request

Code Style

  • Follow Java coding conventions
  • Use meaningful variable and method names
  • Add comprehensive JavaDoc comments
  • Maintain test coverage above 80%

📚 Documentation

🐛 Troubleshooting

Common Issues

Server won't start with Claude Desktop:

  • Verify Java 17+ is installed
  • Check the JAR path in configuration
  • Ensure STDIO profile is active

No tools/resources visible:

  • Restart Claude Desktop after configuration changes
  • Check server logs for errors
  • Verify MCP protocol compliance

Connection issues:

  • Confirm JMX is enabled on target application
  • Check network connectivity for remote connections
  • Validate security settings

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Quick Start for Contributors

bash
# Fork the repository on GitHub
git clone https://github.com/YOUR_USERNAME/JMX-MCP.git
cd JMX-MCP

# Build and test
mvn clean compile
mvn test

# Run the application
mvn spring-boot:run

Ways to Contribute

  • 🐛 Report bugs - Help us identify and fix issues
  • 💡 Suggest features - Share ideas for new functionality
  • 📝 Improve documentation - Help others understand the project
  • 🔧 Submit code - Fix bugs or implement new features
  • 🧪 Write tests - Improve test coverage and reliability
  • 🎨 UI/UX improvements - Enhance user experience

Community

  • GitHub Discussions: Ask questions and share ideas
  • Issues: Report bugs and request features
  • Pull Requests: Contribute code improvements
  • Wiki: Collaborative documentation

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Spring AI Team for the excellent MCP framework
  • Model Context Protocol for the standardized AI integration protocol
  • Anthropic for Claude Desktop and AI assistant capabilities
  • OpenJDK Community for the robust Java platform

📞 Support


Made with ❤️ for the AI and Java communities

JMX MCP ServerのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度JMX MCP Serverに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

JMX MCP Serverをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. JMX MCP ServerのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "jmx-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてJMX MCP ServerのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. JMX MCP ServerのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
JMX MCP Serverを使ってこのタスクを手伝ってもらえますか?
JMX MCP Server
はい、読みました。
JMX MCP Serverで調べた結果をお伝えします。

よくある質問

JMX MCP Server MCPサーバーは何に使いますか?

JMX MCP Serverは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでJMX MCP Server MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでJMX MCP Serverを利用できます。

TypingMindでJMX MCP Server MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。JMX MCP Serverを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

JMX MCP Server MCPをTypingMindに接続するにはどうすればよいですか?

JMX MCP ServerはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでJMX MCP Server MCPのどのようなツールを利用できますか?

JMX MCP ServerはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

JMX MCP Server MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。JMX MCP Serverで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇