Java Class Analyzer

v1.0.0Developer Toolsstable

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

cfrdecompilerjava-classmcp-servertypescript
Share:
37
Stars
0
Downloads
0
Weekly
0/5

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

Analyze Java dependencies by scanning Maven projects and decompiling JAR files. Extract class methods, fields, and inheritance information.
handsomestWei

Maintainer

LicenseApache 2.0
Languagetypescript
Versionv1.0.0
UpdatedMay 15, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx java-class-analyzer-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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-server
2

Verify 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/repository
3

Generate 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.json
4

Add 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"
      }
    }
  }
}
5

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.

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.

Quick Config Preview

{ "mcpServers": { "java-class-analyzer-mcp-server": { "command": "npx", "args": ["-y", "java-class-analyzer-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides