Java Class Analyzer
Enables AI tools to analyze Java dependencies by scanning Maven projects, decompiling JAR files, and extracting detailed class information including methods, fields, and inheritance relationships. Solves the problem of AI hallucinations when generati
What is Java Class Analyzer?
Java Class Analyzer is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables ai tools to analyze java dependencies by scanning maven projects, decompiling jar files, and extracting detailed class information including methods, fields, and inheritance relationships. sol...
Enables AI tools to analyze Java dependencies by scanning Maven projects, decompiling JAR files, and extracting detailed class information including methods, fields, and inheritance relationships. Solves the problem of AI hallucinations when generati
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Enables AI tools to analyze Java dependencies by scanning Ma
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx java-class-analyzer-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Java Class Analyzer
Java Class Analyzer MCP Server gives AI coding assistants accurate, ground-truth knowledge about Java codebases by scanning Maven project dependencies, decompiling JAR files with the CFR decompiler, and extracting detailed class information including methods, fields, constructors, and inheritance chains. Instead of hallucinating method signatures or guessing API shapes, tools like Claude can query the actual bytecode structure of any library in your Maven repository. Backend Java developers use it when writing code that integrates third-party or internal libraries where the source is unavailable or the Javadoc is sparse.
Prerequisites
- Node.js 16+ and npm installed
- Java JDK 8+ installed (required for CFR decompilation; set JAVA_HOME if not on PATH)
- A Maven project with a populated local repository at ~/.m2/repository
- An MCP-compatible client such as Claude Desktop or VS Code with MCP extension
Install the package globally
Install java-class-analyzer-mcp-server globally via npm to make the java-class-analyzer-mcp command available system-wide.
npm install -g java-class-analyzer-mcp-serverVerify Java and Maven paths
The server uses JAVA_HOME to locate the JVM for decompilation and MAVEN_REPO to find JAR files. Check these are set correctly before configuring the MCP client.
echo $JAVA_HOME
ls ~/.m2/repositoryGenerate a starter MCP config file
The CLI includes a config generator that outputs a ready-to-use JSON snippet with the correct command and default environment variables.
java-class-analyzer-mcp config -o mcp-client-config.json
cat mcp-client-config.jsonAdd the server to your MCP client config
Open claude_desktop_config.json and add the java-class-analyzer entry. Set MAVEN_REPO to your local Maven repository path and JAVA_HOME to your JDK installation.
{
"mcpServers": {
"java-class-analyzer": {
"command": "java-class-analyzer-mcp",
"args": ["start"],
"env": {
"MAVEN_REPO": "/Users/yourname/.m2/repository",
"JAVA_HOME": "/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home"
}
}
}
}Restart Claude Desktop and scan a project
After restarting, ask Claude to scan a Maven project. Point it at a pom.xml file — the server will index all declared dependencies and build a class-to-JAR mapping index.
Java Class Analyzer Examples
Client configuration
Full claude_desktop_config.json entry for Java Class Analyzer with MAVEN_REPO and JAVA_HOME environment variables.
{
"mcpServers": {
"java-class-analyzer": {
"command": "java-class-analyzer-mcp",
"args": ["start"],
"env": {
"MAVEN_REPO": "/Users/yourname/.m2/repository",
"JAVA_HOME": "/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home"
}
}
}
}Prompts to try
Example prompts that trigger the three core tools: scan_dependencies, decompile_class, and analyze_class.
- "Scan the Maven dependencies in /projects/my-app/pom.xml and show me what JARs are indexed"
- "Decompile the class com.example.UserService from the my-app project"
- "Analyze the class structure of org.springframework.web.servlet.DispatcherServlet — show all methods and fields"
- "What does the HttpClient class in Apache HttpComponents look like? Show the method signatures"
- "Which classes in my project extend AbstractEntity and what fields do they have?"Troubleshooting Java Class Analyzer
Decompilation fails with 'java command not found'
Set the JAVA_HOME environment variable in your MCP config to the full path of your JDK installation (not just the JRE). On macOS you can find the correct path with: /usr/libexec/java_home -v 17
scan_dependencies returns empty results
The MAVEN_REPO path must point to the root of the Maven local repository containing the .m2/repository directory structure. Verify the path contains artifact directories like 'org' and 'com', and that your Maven project has been built at least once with 'mvn compile' to populate the local repo.
analyze_class returns 'class not found in index'
Run scan_dependencies first to build the class-to-JAR mapping index before calling analyze_class. The index must be built for each Maven project you want to analyze.
Frequently Asked Questions about Java Class Analyzer
What is Java Class Analyzer?
Java Class Analyzer is a Model Context Protocol (MCP) server that enables ai tools to analyze java dependencies by scanning maven projects, decompiling jar files, and extracting detailed class information including methods, fields, and inheritance relationships. solves the problem of ai hallucinations when generati It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Java Class Analyzer?
Follow the installation instructions on the Java Class Analyzer GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Java Class Analyzer?
Java Class Analyzer works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Java Class Analyzer free to use?
Yes, Java Class Analyzer is open source and available under the Apache 2.0 license. You can use it freely in both personal and commercial projects.
Java Class Analyzer Alternatives — Similar Developer Tools Servers
Looking for alternatives to Java Class Analyzer? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Java Class Analyzer in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Java Class Analyzer?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.