Professional-grade Java codebase analysis and Maven dependency management skill...
JLens is a Model Context Protocol (MCP) server designed for AI Agents. It provides deep understanding of Java projects through real reflection analysis and bytecode parsing. Unlike simple text search, JLens can identify class inheritance, method signatures, visibility modifiers, and complex Maven dependency topologies.
Interaction Logic:
status: "SUCCESS": Parsing successful. Read decompiledSource for logic, and methods/fields for structure.status: "LOCAL_SOURCE": Important! The target class belongs to the current workspace. Ignore metadata and directly read the source code using the read_file tool via the provided sourceFile path.status: "NOT_FOUND": Class does not exist. Check the suggestion field; you might need to run build_module first.bypassCache: If class structure seems outdated (e.g., after recent source changes), set to true to bypass GAV cache for real-time parsing.Pagination Protocol:
hasMore is true in the response, you must record the nextCursor.cursor: "<nextCursor>" in the next call until hasMore is false. Results are sorted by fully qualified name for stability.Metadata Parsing:
scope field (e.g., test, provided) to determine if a class is available at runtime.list_module_dependencies to check if multiple versions of Jars contain conflicting classes.methods lists to find missing methods.build_module to refresh the local repository and verify the build passes.search_java_class with wildcards (e.g., com.api.*Service) to find all relevant interfaces.list_class_fields to quickly extract private fields of all implementation classes to evaluate state storage.LOCAL_SOURCE is detected, automatically switch to read_file to modify code.jlens-mcp-server exists in the environment.call_tool requests.If no service is found, the Agent must autonomously use shell tools to execute:
NPM Mode (Preferred):
npx -y @bhxch/jlens-mcp-server --tool <tool_name> --args '<json_arguments>'
Python Mode:
uvx jlens-mcp-server --tool <tool_name> --args '<json_arguments>'
GroupId:ArtifactId:Version. Parsing results for third-party libraries (like Spring) are shared across projects, usually responding within 100ms.search_java_class on large projects may trigger full indexing (~60s). Subsequent requests are millisecond-level.