An MCP server providing 75 semantic analysis tools for Java, built directly on Eclipse JDT for compiler-accurate code understanding.
JavaLens exists because AI systems need compiler-accurate insights that reading source files cannot provide. When an AI uses grep or Read to find usages of a method, it cannot distinguish:
- A method call from a method with the same name in an unrelated class
- A field read from a field write
- An interface implementation from an unrelated class
- A cast to a type from other references to that type
This leads to incorrect refactorings, missed usages, and incomplete understanding of code behavior.
JavaLens provides compiler-accurate code analysis through Eclipse JDT—the same engine that powers Eclipse IDE. Unlike text search, JDT understands:
- Type resolution across inheritance hierarchies
- Method overloading and overriding
- Generic type arguments
- Import resolution and classpath dependencies
- Java source from version 1.1 through Java 25 (markdown Javadoc, module imports, compact source files, flexible constructor bodies)
- Lombok-generated members — a bundled agent makes
@Dataaccessors and the like resolve, so code using them is not flagged as undefined
Example: Finding all places where UserService.save() is called:
| Approach | Result |
|---|---|
grep "save(" |
Returns 47 matches including orderService.save(), saveButton, comments |
find_references |
Returns exactly 12 calls to UserService.save() |
⚠️ Important for AI developers and users
AI models may exhibit trained bias toward native tools (Grep, Read, LSP) over MCP server tools, even when semantic analysis provides better results. This happens because:
- Training data contains extensive grep/text-search patterns
- Native tools are "always available" in the model's experience
- The model may not recognize when semantic analysis is superior
To get the best results:
Add guidance to your project instructions or system prompt (e.g., CLAUDE.md for Claude Code):