pzalutski-pixel avatar

JavaLens

pzalutski-pixel/javalens-mcp

Built on Eclipse JDT, this exposes 63 semantic analysis tools that understand Java code the way a compiler does, not just as text. You get type-aware navigation like find_references that distinguishes UserService.save() from every other save() method, find_implementations that follows inheritance chains, and refactoring operations that know about scope and bindings. It answers questions grep can't: where is this field written versus read, what casts to this type, which private methods are unused. Runs as a standalone process with stdio transport, stores JDT indexes in a separate workspace directory to keep your source tree clean. Requires Java 21 runtime but analyzes Java 1.1 through 23. When you need to understand call graphs, dependency cycles, or perform safe renames across a codebase, this gives AI agents compiler-accurate answers instead of pattern matching.

GitHub stars
46
tools
75
transport
STDIO
env vars
3
last updated
Oct 18, 2026

Tools

75 tools

Public tool metadata for what this MCP can expose to an agent.

search_symbolsSearch types, methods, fields by glob pattern

Search types, methods, fields by glob pattern

No parameter schema in public metadata yet.

go_to_definitionNavigate to symbol definition

Navigate to symbol definition

No parameter schema in public metadata yet.

find_referencesFind all usages of a symbol

Find all usages of a symbol

No parameter schema in public metadata yet.

find_implementationsFind interface/class implementations

Find interface/class implementations

No parameter schema in public metadata yet.

get_type_hierarchyGet inheritance chain

Get inheritance chain

No parameter schema in public metadata yet.

get_document_symbolsGet all symbols in a file

Get all symbols in a file

No parameter schema in public metadata yet.

get_symbol_infoGet detailed symbol information at position

Get detailed symbol information at position

No parameter schema in public metadata yet.

get_type_at_positionGet type details at cursor

Get type details at cursor

No parameter schema in public metadata yet.

get_method_at_positionGet method details at cursor

Get method details at cursor

No parameter schema in public metadata yet.

get_field_at_positionGet field details at cursor

Get field details at cursor

No parameter schema in public metadata yet.

find_annotation_usagesFind all @Annotation usages

Find all @Annotation usages

No parameter schema in public metadata yet.

find_type_instantiationsFind all new Type() calls

Find all new Type() calls

No parameter schema in public metadata yet.

find_castsFind all (Type) expr casts

Find all (Type) expr casts

No parameter schema in public metadata yet.

find_instanceof_checksFind all x instanceof Type

Find all x instanceof Type

No parameter schema in public metadata yet.

find_throws_declarationsFind all throws Exception in signatures

Find all throws Exception in signatures

No parameter schema in public metadata yet.

find_catch_blocksFind all catch(Exception e) blocks

Find all catch(Exception e) blocks

No parameter schema in public metadata yet.

find_method_referencesFind all Type::method expressions

Find all Type::method expressions

No parameter schema in public metadata yet.

find_type_argumentsFind all List<Type> usages

Find all List<Type> usages

No parameter schema in public metadata yet.

find_reflection_usageFind Class.forName(), Method.invoke(), and other reflection calls

Find Class.forName(), Method.invoke(), and other reflection calls

No parameter schema in public metadata yet.

get_diagnosticsGet compilation errors and warnings

Get compilation errors and warnings

No parameter schema in public metadata yet.

validate_syntaxFast syntax-only validation

Fast syntax-only validation

No parameter schema in public metadata yet.

get_call_hierarchy_incomingFind all callers of a method

Find all callers of a method

No parameter schema in public metadata yet.

get_call_hierarchy_outgoingFind all methods called by a method

Find all methods called by a method

No parameter schema in public metadata yet.

find_field_writesFind where fields are mutated

Find where fields are mutated

No parameter schema in public metadata yet.

find_testsDiscover JUnit/TestNG test methods

Discover JUnit/TestNG test methods

No parameter schema in public metadata yet.

find_unused_codeFind unused private members

Find unused private members

No parameter schema in public metadata yet.

find_unreachable_codeProject-wide dead code — members unreachable from any main method or test, over the whole-program call graph

Project-wide dead code — members unreachable from any main method or test, over the whole-program call graph

No parameter schema in public metadata yet.

find_affected_testsThe tests that exercise a symbol, directly or transitively — the set to run after changing it

The tests that exercise a symbol, directly or transitively — the set to run after changing it

No parameter schema in public metadata yet.

find_possible_bugsDetect null risks, empty catches, resource leaks

Detect null risks, empty catches, resource leaks

No parameter schema in public metadata yet.

get_hover_infoGet documentation/signature for symbol

Get documentation/signature for symbol

No parameter schema in public metadata yet.

get_javadocGet parsed Javadoc

Get parsed Javadoc

No parameter schema in public metadata yet.

get_signature_helpGet method signature at call site

Get method signature at call site

No parameter schema in public metadata yet.

get_enclosing_elementGet containing method/class at position

Get containing method/class at position

No parameter schema in public metadata yet.

analyze_change_impactBlast radius — direct call sites by depth, or the full transitive closure over the project graph (transitive=true)

Blast radius — direct call sites by depth, or the full transitive closure over the project graph (transitive=true)

No parameter schema in public metadata yet.

analyze_data_flowVariable read/write/declaration tracking within a method; opt-in followCalls tracks null/taint facts across calls to sinks

Variable read/write/declaration tracking within a method; opt-in followCalls tracks null/taint facts across calls to sinks

No parameter schema in public metadata yet.

analyze_control_flowBranching, loops, return/throw points, nesting depth

Branching, loops, return/throw points, nesting depth

No parameter schema in public metadata yet.

get_di_registrationsFind Spring DI registrations (@Component, @Bean, @Autowired, @Inject)

Find Spring DI registrations (@Component, @Bean, @Autowired, @Inject)

No parameter schema in public metadata yet.

get_jpa_modelAssembled JPA entity model — tables, id fields, relationships with resolved targets and mappedBy sides

Assembled JPA entity model — tables, id fields, relationships with resolved targets and mappedBy sides

No parameter schema in public metadata yet.

get_http_endpointsAssembled HTTP route table — Spring and JAX-RS paths composed from class prefixes, mapped to handler methods

Assembled HTTP route table — Spring and JAX-RS paths composed from class prefixes, mapped to handler methods

No parameter schema in public metadata yet.

analyze_fileGet imports, types, diagnostics in one call

Get imports, types, diagnostics in one call

No parameter schema in public metadata yet.

analyze_typeGet members, hierarchy, usages, diagnostics

Get members, hierarchy, usages, diagnostics

No parameter schema in public metadata yet.

analyze_methodGet signature, callers, callees, overrides

Get signature, callers, callees, overrides

No parameter schema in public metadata yet.

get_type_usage_summaryGet instantiations, casts, instanceof counts

Get instantiations, casts, instanceof counts

No parameter schema in public metadata yet.

rename_symbolRename across entire project

Rename across entire project

No parameter schema in public metadata yet.

organize_importsSort and clean imports

Sort and clean imports

No parameter schema in public metadata yet.

extract_variableExtract expression to local variable

Extract expression to local variable

No parameter schema in public metadata yet.

extract_methodExtract code block to new method

Extract code block to new method

No parameter schema in public metadata yet.

extract_constantExtract to static final field

Extract to static final field

No parameter schema in public metadata yet.

extract_interfaceCreate interface from class methods

Create interface from class methods

No parameter schema in public metadata yet.

extract_superclassMove a member into a newly created superclass

Move a member into a newly created superclass

No parameter schema in public metadata yet.

inline_variableReplace variable with its initializer

Replace variable with its initializer

No parameter schema in public metadata yet.

inline_methodReplace call with method body

Replace call with method body

No parameter schema in public metadata yet.

change_method_signatureModify params/return, update all callers

Modify params/return, update all callers

No parameter schema in public metadata yet.

convert_anonymous_to_lambdaConvert anonymous class to lambda

Convert anonymous class to lambda

No parameter schema in public metadata yet.

encapsulate_fieldGenerate accessors and rewrite all direct field accesses

Generate accessors and rewrite all direct field accesses

No parameter schema in public metadata yet.

pull_upMove a member into the superclass

Move a member into the superclass

No parameter schema in public metadata yet.

push_downMove a member into the subclasses

Move a member into the subclasses

No parameter schema in public metadata yet.

introduce_parameter_objectBundle a method's parameters into a new class, updating callers

Bundle a method's parameters into a new class, updating callers

No parameter schema in public metadata yet.

move_type_to_new_fileMove a nested type into its own top-level file

Move a nested type into its own top-level file

No parameter schema in public metadata yet.

suggest_importsFind import candidates for unresolved type

Find import candidates for unresolved type

No parameter schema in public metadata yet.

get_quick_fixesList available fixes for problem at position

List available fixes for problem at position

No parameter schema in public metadata yet.

apply_quick_fixApply fix by ID (add import, remove import, add throws, try-catch)

Apply fix by ID (add import, remove import, add throws, try-catch)

No parameter schema in public metadata yet.

apply_cleanupApply one of 10 JDT clean-ups (convert loops, pattern matching, switch expressions, text blocks, ...) and return rewritten source

Apply one of 10 JDT clean-ups (convert loops, pattern matching, switch expressions, text blocks, ...) and return rewritten source

No parameter schema in public metadata yet.

diagnose_and_fixDiagnose a file and return each problem's top quick-fix edits in one call

Diagnose a file and return each problem's top quick-fix edits in one call

No parameter schema in public metadata yet.

get_complexity_metricsCyclomatic/cognitive complexity, LOC per method

Cyclomatic/cognitive complexity, LOC per method

No parameter schema in public metadata yet.

get_dependency_graphPackage/type dependencies as nodes and edges

Package/type dependencies as nodes and edges

No parameter schema in public metadata yet.

find_circular_dependenciesDetect package cycles using Tarjan's SCC algorithm

Detect package cycles using Tarjan's SCC algorithm

No parameter schema in public metadata yet.

find_large_classesFind types exceeding method/field/line count thresholds

Find types exceeding method/field/line count thresholds

No parameter schema in public metadata yet.

find_naming_violationsCheck against Java naming conventions

Check against Java naming conventions

No parameter schema in public metadata yet.

health_checkServer status and capabilities

Server status and capabilities

No parameter schema in public metadata yet.

load_projectLoad Maven/Gradle/Bazel/plain Java project

Load Maven/Gradle/Bazel/plain Java project

No parameter schema in public metadata yet.

get_project_structureGet package hierarchy

Get package hierarchy

No parameter schema in public metadata yet.

get_classpath_infoGet classpath entries

Get classpath entries

No parameter schema in public metadata yet.

get_type_membersGet members by type name

Get members by type name

No parameter schema in public metadata yet.

get_super_methodFind overridden method in superclass

Find overridden method in superclass

No parameter schema in public metadata yet.

Sponsors

Configuration

JAVA_PROJECT_PATH

Auto-load project on startup

JAVALENS_TIMEOUT_SECONDS

Time limit on each tool call in seconds (5-300); unset means no limit

JAVALENS_LOG_LEVELdefault: INFO

Log level: TRACE, DEBUG, INFO, WARN, ERROR

Readme

JavaLens: AI-First Code Analysis for Java

GitHub release License: MIT Java 21

An MCP server providing 75 semantic analysis tools for Java, built directly on Eclipse JDT for compiler-accurate code understanding.

Built for AI Agents

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.

Compiler-Accurate Analysis


View the full README on GitHub

Details

Repository
github.com/pzalutski-pixel/javalens-mcp
Package
javalens-mcp
Transport
STDIO
Registry
MCP registry, active

More from pzalutski-pixel