
JMX
STDIOJMX monitoring and management server for AI assistants via natural language
JMX monitoring and management server for AI assistants via natural language
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.
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.
git clone https://github.com/itz4blitz/JMX-MCP.git cd JMX-MCP mvn clean package
# Test with comprehensive validation python3 comprehensive-test.py
Add to your Claude Desktop MCP configuration file:
Location:
~/.config/claude/mcp_servers.json
%APPDATA%\Claude\mcp_servers.json
Configuration:
{ "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" } } } }
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?"
Tool | Description | Example Usage |
---|---|---|
listMBeans | List all discovered MBeans with optional domain filtering | "Show me all memory-related MBeans" |
getMBeanInfo | Get detailed information about a specific MBean | "Tell me about the Runtime MBean" |
getAttribute | Read the value of an MBean attribute | "What's the current heap memory usage?" |
setAttribute | Set the value of a writable MBean attribute | "Set the log level to DEBUG" |
listDomains | List all available MBean domains | "What domains are available?" |
Tool | Description | Example Usage |
---|---|---|
listJmxConnections | List all configured JMX connections | "Show me all available connections" |
addJmxConnection | Add a new JMX connection | "Connect to the production server" |
removeJmxConnection | Remove a JMX connection | "Remove the old test connection" |
switchJmxConnection | Switch to a different JMX connection | "Switch to the staging environment" |
getConnectionInfo | Get current JMX connection status and statistics | "Is the JMX connection healthy?" |
Tool | Description | Example Usage |
---|---|---|
discoverJmxServices | Discover JMX-enabled Java applications on the system | "Find all Java apps with JMX enabled" |
autoRegisterDiscoveredConnections | Automatically register discovered JMX services | "Auto-connect to all discovered Java apps" |
The server automatically exposes all JMX attributes as MCP resources, making them discoverable and accessible to AI assistants:
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
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.
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.
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ 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 │
└─────────────────┘ └──────────────────┘ └─────────────────┘
Standard configuration with full logging for development and debugging.
Optimized for Claude Desktop integration:
# Run the comprehensive integration test python3 comprehensive-test.py
Test Coverage:
mvn test
jmx: security: enabled: true allowed-domains: - "java.lang" - "java.nio" - "com.myapp" blocked-operations: - "shutdown" - "restart"
java -jar target/jmx-mcp-server-1.0.0.jar
java -Xmx1g -Xms512m \ -Dspring.profiles.active=production \ -jar jmx-mcp-server-1.0.0.jar
FROM openjdk:17-jre-slim COPY target/jmx-mcp-server-1.0.0.jar app.jar EXPOSE 8080 ENTRYPOINT ["java", "-jar", "/app.jar"]
We welcome contributions! Please see our Contributing Guide for details.
Server won't start with Claude Desktop:
No tools/resources visible:
Connection issues:
We welcome contributions! Please see our Contributing Guide for details.
# 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
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ for the AI and Java communities