Java Inspector
Decompiles Hibernate classes from Maven dependencies into readable Java source, allowing AI agents to analyze Hibernate internals.
Decompiles Spring framework classes (e.g., JpaRepository, ObservationRegistry) into readable Java source code, enabling AI agents to inspect internal implementations of Spring dependencies.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Java Inspector Show me the source of ObservationRegistry"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Java Inspector
Java Inspector is an MCP server that gives AI agents fast, read-only access to code and metadata inside Maven dependencies, local JARs, executable JARs, WARs, and the JDK.
The server starts accepting MCP calls immediately. Maven dependency scanning continues in the background, while an interactive query can promote the JAR it needs to a foreground queue and return without waiting for the complete project index.
Requirements
Node.js 16 or newer
Java 17 or newer (
javaandjavap); required by bundled Vineflower 1.11.2Maven for Maven project discovery and dependency resolution
Vineflower 1.11.2 is bundled in lib/.
Related MCP server: MCP Java Decompiler Server
Install and configure
npm install -g @mustafagoksever/java-inspector{
"mcpServers": {
"java-inspector": {
"command": "java-inspector",
"args": ["start"]
}
}
}For local development:
npm ci
npm run build
node dist/cli.js startStartup discovery
After the MCP transport connects, Java Inspector performs non-blocking discovery:
If
cwd/pom.xmlexists, that Maven project is used.Otherwise directories are searched breadth-first.
Every
pom.xmlat the first matching depth is selected.Deeper POMs are not independently scanned.
Maven classpaths are resolved and their JARs enter the background light-scan queue.
Directories such as .git, node_modules, .gradle, target, build, and out are excluded from POM discovery.
Local, non-Maven JARs are not scanned at startup. They are found and indexed only when a tool call supplies a path, directory, or filename prefix.
Tools
Tool | Purpose |
| Start, refresh, or poll the non-blocking Maven scan. |
| Find an artifact by path, filename, prefix, substring, or Maven coordinates without opening it. |
| Inspect manifest, Maven metadata, packages, classes, resources, and nested artifacts. |
| Search the live partial index and foreground-scan relevant JARs on a miss. |
| Search methods, fields, annotations, references, or string constants without mass decompilation. |
| Find direct or transitive implementations/subtypes from lazy deep indexes. |
| Return source, API, hierarchy, bytecode, or all views for a class. |
| Run a filtered Maven dependency tree for a selected artifact. |
| Search resource paths or bounded text content. |
| Read an exact text resource with line pagination. |
Every tool supports text, json, and toon output where applicable.
Artifact selectors
Class, JAR, and resource tools share the same selection model:
jarPath: exact absolute JAR path; fastest and unambiguous.jarDirectory+jarNamePrefix: useful for Maven-free projects withlib/directories.workspacePath+jarNamePrefix: search the Maven classpath and workspace.workspacePath: use the live partial index and bounded lazy fallback.coordinates:groupId:artifactId[:version[:classifier]].
When no selector is supplied, tools use the server's current working directory. If Maven classpath resolution is still running, searches return complete: false instead of reporting a definitive miss. Per-JAR scan failures are returned in errors; an unreadable exact jarPath fails the tool call.
If multiple JARs or classes match, the server returns candidates instead of silently choosing one.
Inspect a class from a local JAR
{
"className": "com.vendor.Client",
"jarPath": "C:\\project\\lib\\vendor-client-2.1.jar",
"view": "source"
}Find an exception message
{
"query": "Connection refused",
"kind": "string",
"workspacePath": "C:\\project",
"mode": "balanced"
}Find implementations
{
"className": "com.vendor.Transport",
"workspacePath": "C:\\project",
"transitive": true
}Inspect a JDK class
{
"className": "java.util.ArrayList",
"view": "all"
}JDK source is read from src.zip when available. API and bytecode views use javap.
Foreground and background scheduling
All JAR reads pass through a shared coordinator:
Up to eight JAR reads run concurrently.
Background scanning may occupy at most six slots.
Two slots remain available for interactive foreground work.
A foreground request promotes a queued background JAR.
Concurrent requests for the same JAR share one Promise and one cache write.
Light scans time out after 30 seconds; deep scans time out after 60 seconds.
The background scan builds a light index from ZIP entries. More expensive class-file metadata is generated only when search_code or find_implementations needs it.
Context-wide deep searches are intentionally bounded. A partial response includes complete, scannedJarCount, and remainingJarCount. Calling the tool again continues using the already cached deep indexes.
Class inspection
inspect_class supports:
source: local*-sources.jar, embedded.java, or Vineflower decompilation.api: fields, methods, constructors, modifiers, superclass, and interfaces viajavap.hierarchy: resolved superclass chain.bytecode:javap -c -l -p -soutput.all: all available views.
Source responses support methodName, paramTypes, offset, and limit.
The decompiler executable cannot be overridden by a tool argument. Java Inspector uses the bundled Vineflower JAR or the operator-controlled DECOMPILER_PATH environment variable.
JAR layouts
Light indexing understands:
Ordinary and shaded JARs
Multi-release entries under
META-INF/versions/Spring Boot classes under
BOOT-INF/classesWAR classes under
WEB-INF/classesJMOD class paths under
classes/Nested artifact metadata under
BOOT-INF/lib,WEB-INF/lib, andlibMaven
pom.properties, manifests, source JARs, and text resources
Nested JAR contents are extracted and scanned only when explicitly needed.
Cache
Cache data is stored under:
~/.cache/java-inspector/<context>_<hash>/Important entries include:
classpath.json
class-index.jsonl
scan-state.json
jar-indexes-v3/
results-v3/
server-<pid>.logPer-JAR caches use resolved path, size, and modification time as their fingerprint. Nested artifacts additionally use their parent fingerprint and ZIP entry identity. JSONL project indexes remain append-only and crash-safe, with cross-process locks protecting writes.
Environment variables
Variable | Purpose |
| Enables additional development logging. |
| Locates |
| Locates Maven. |
| Overrides the Maven executable. |
| Overrides the local Maven repository path. |
| Overrides the bundled Vineflower JAR. |
Maven command resolution order is MAVEN_CMD, mvnd, MAVEN_HOME/bin/mvn, then mvn from PATH.
Development
npm run build
npm test
npm run devThe project is ES modules and emits JavaScript, declarations, and source maps to dist/.
License
Apache-2.0
Available Tools
10 toolsexplain_dependencyB
Run a filtered Maven dependency tree and explain why an artifact is present.
Inputs: workspacePath (required), format, jarPath, coordinates.
find_implementationsB
Find direct or transitive implementations/subtypes using lazy deep class metadata.
Inputs: className (required), mode, limit, format, +6 more.
find_jarA
Find JAR paths by exact path, filename, prefix, substring, or Maven coordinates without opening the JAR.
Inputs: limit, match, format, jarPath, +4 more.
inspect_classB
Resolve and inspect a class from Maven, a local JAR, or the JDK. Views: source, API, hierarchy, bytecode, or all.
Inputs: className (required), view, limit, format, +9 more.
inspect_jarB
Inspect one JAR: manifest, Maven coordinates, layout, packages, classes, resources, and nested JAR metadata.
Inputs: limit, query, format, offset, +5 more.
read_resourceB
Read an exact text resource with safe line pagination. Binary resources are rejected.
Inputs: resourcePath (required), limit, format, offset, +5 more.
scan_projectA
Start, refresh, or poll the non-blocking Maven dependency scan. Startup automatically calls this for the highest-level pom.xml files.
Inputs: workspacePath (required), format, forceRefresh.
search_classB
Search the live partial index, then foreground-scan only relevant JARs without waiting for background scan completion.
Inputs: query (required), mode, limit, format, +6 more.
search_codeC
Find method/field declarations, annotations, references, and real string constants from lazy class-file metadata.
Inputs: kind (required), query (required), mode, limit, +6 more.
search_resourcesB
Search resource paths or bounded text resource content in selected JARs.
Inputs: limit, format, jarPath, pathQuery, +5 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool targets a distinct resource and action: project scanning, JAR discovery, JAR inspection, class search, code search, implementation lookup, class inspection, dependency explanation, resource search, and resource reading. No two tools have overlapping purposes; even search_class and search_code differ clearly by scope (indexed classes vs. code constructs).
All tool names follow a consistent verb_noun pattern with descriptive verbs (scan, find, inspect, search, explain, read). The pattern is uniform across the set, making it easy to predict tool behavior from the name alone.
The 10 tools are well-scoped for a Java inspector/analyzer server, covering project-level scanning, artifact lookup, detailed inspection, and search operations. Each tool serves a distinct purpose without redundancy, and the count is ideal for the domain.
The tool surface covers the full read/analyze lifecycle: scan, find, inspect, search, explain, and read. Minor gaps exist such as no explicit 'list_jar_contents' top-level tool or dependency listing shortcut, but these are accessible via inspect_jar and explain_dependency, so agents can work around them.
Maintenance
Related MCP Connectors
Ship better Java with your coding agent.
Codebase intelligence for AI agents — dead code, blast radius, ownership.
Package intelligence for AI agents across npm, PyPI, crates.io and deps.dev. No API keys.
Package intelligence for AI agents across npm, PyPI, crates.io and deps.dev. No API keys.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables 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 generating code that calls external dependencies by providing accurate class structures through decompilation.313 npm41Apache 2.0
- AlicenseAqualityDmaintenanceDecompiles Java .class files, packages, and JARs into readable source code, enabling AI assistants to inspect Java bytecode.354 npm20ISC
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to look up Java class definitions and list dependencies from Maven projects by analyzing local JAR files via the Model Context Protocol.14 npm4MIT
- AlicenseAqualityDmaintenanceEnables AI to analyze Java classes from Maven project dependencies, with support for decompilation strategies and configurable groupId mappings.38 npm5MIT