jvmsrc
Queries the Gradle build tool to resolve the exact classpath for a project, enabling accurate source and signature lookups.
Provides source and structure information for Kotlin libraries on the classpath, on a best-effort basis.
Provides source and structure information for Scala libraries on the classpath, on a best-effort basis.
Targets Spring Boot projects, providing accurate classpath resolution for Spring Boot dependencies.
Click on "Install 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., "@jvmsrcget the structure of AbstractTradingService"
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.
jvmsrc — Give your coding agent a Java IDE
An MCP server and CLI that gives your coding agent the one thing it's missing on JVM codebases: the actual classpath.
The Problem
You use an IDE to write Java. Your coding agent doesn't have one.
When your agent hits an unfamiliar library type — say, a superclass from a proprietary internal library — it spends 25+ turns walking ~/.gradle/caches, opening JARs by hand with jar tf, picking one by guesswork, and trying to answer a question your IDE would answer in one keystroke: does this superclass have a public utility method called X?
The Solution
jvmsrc queries your build tool (Gradle) for this project's resolved classpath, then hands your agent real source, real signatures, and real structure — for the exact version your build actually uses.
As an MCP server – Connect to Claude Code, Cursor, Windsurf, or any other MCP host and equip your agent with six purpose-built classpath tools.
As the
jvmsrcCLI – Same engine, scriptable, pipe-friendly, and useful on its own when you just want to read a class.
What it saves, daily
On JVM projects with private libraries and no public Javadocs, jvmsrc is a force multiplier:
~50K tokens saved per "what's on this external class" investigation — roughly 70% reduction in cost.
15+ agent panic loops avoided daily — no grinding through Gradle caches, opening wrong JARs, or giving up.
Unlock delegation for complex tasks touching internal SDKs that you previously had to do yourself.
Related MCP server: codeweave-mcp
The Difference in Action
Without jvmsrc (The 25-turn blind grind)
User: Override the audit hook from
AbstractTradingService— is there a public utility method on it we should reuse?Agent:
Searches workspace for AbstractTradingService.java ➔
0 hitsRuns:
find ~/.gradle -name "trading-core*"Finds 4 versions:
2.1.0,2.3.0,2.4.1,3.0.0-SNAPSHOTGuesses: Picks
trading-core-2.4.1.jar(the project actually uses3.0.0-SNAPSHOT!)Runs:
jar tfandjavap -pon the wrong JAR[22 turns later] "I don't see a utility method, you'll have to implement it yourself."
Reality:
3.0.0-SNAPSHOTaddedmaskSensitiveFields()as a protected helper exactly for this case. The agent didn't hallucinate — it was just blind.
With jvmsrc (The 3-turn instant resolution)
User: Override the audit hook from
AbstractTradingService— is there a public utility method on it we should reuse?Agent:
search_classes("AbstractTradingService")➔ Finds FQN & exact resolved library.
get_class_structure(scope: "overview")➔ DiscoversmaskSensitiveFields()in3.0.0-SNAPSHOT.
get_method_signature("maskSensitiveFields")➔ Gets accurate signature and generics.Result: Writes the override correctly on the first try. No cache walking, no guessing, no wrong version.
How It Works
Build Tool Inquiry:
jvmsrcqueries your active build tool (e.g., Gradle) for the exact resolved classpath configuration.Intelligent Caching: It caches the resolved classpath, tracking changes to build files to stay current.
Precision AI Tools: Instead of full-code dumping, it exposes precise, high-granularity tools (signatures, structure, search) to keep context windows small and token usage ultra-low.
Installation & Quick Start
1. Install CLI
npm install -g jvmsrc
# or use it directly via npx: npx jvmsrc <command>
Requires Node ≥ 20 and Java on PATH (for CFR decompiler + javap).
2. Configure for your Workspace (MCP)
Generate a paste-ready MCP configuration for your project:
jvmsrc config --project /path/to/gradle-projectPaste this configuration into your AI assistant config (Claude Code, Cursor, Windsurf, etc.), restart the host, and you are ready to go!
MCP Server Reference
The MCP server runs over stdio via jvmsrc mcp. Add this to your host config:
{
"mcpServers": {
"jvmsrc": {
"command": "jvmsrc",
"args": ["mcp"]
}
}
}Tools your agent gets
Tool | What it does |
| Find a class by simple name or glob; returns compact FQN + lib name lists |
| Retrieves class overview (purpose + method names) or declared signatures |
| Fetches real overloads for a method, with parameter names and generics |
| Performs regex or substring searches inside a resolved class |
| Retrieves method bodies or line ranges (used as a last resort) |
| Analyzes the actual dependency graph this project uses |
Every source response includes sourceAvailable: true for real sources (Javadoc, parameter names, generics), false for CFR decompilation (structure reliable, names may be synthetic).
How It Compares
Tool | Approach | Gap |
Cache Indexers / | Scan global caches | No per-project resolved version |
Static Parsers (e.g., | Parse declarations only | Misses transitive dependencies, BOMs, dynamic versions |
| User supplies manual JAR paths | No automatic build/classpath resolution |
Gradle MCP (Tooling API) | Task/build focused | Not optimized for classpath-accurate FQN source lookup |
| Queries actual build tool & caches | Version-correct sources and signatures for agents |
Target Audience
Primarily Java + Spring Boot projects on Gradle. Other JVM languages (Kotlin, Scala) and Android work today on a best-effort basis and are on the roadmap as first-class targets — see ROADMAP.md.
If you're on Maven or Bazel, it's planned but not shipping yet. Star the repo or open an issue and I'll prioritize accordingly.
Detailed Reference
Runtime: Node.js ≥ 20, Java on PATH.
Project types: JVM codebases (Java, Kotlin, Scala, Groovy). jvmsrc calls the build tool, not your editor.
Build system | Status |
Gradle | Supported — multimodule included |
Maven, Bazel | Planned (SPEC.md) |
Point -p / projectRoot at the Gradle root (settings.gradle(.kts) or root build.gradle(.kts)). Uses ./gradlew when present, else gradle on PATH. Maven-only trees get an explicit unsupported error.
Early software; the supported path is narrow:
Area | Today |
Build tool | Gradle only |
Integration | Groovy init script ( |
Classpaths | Standard JVM + Kotlin MPP |
Output | Java-shaped |
Composite builds, Android-only layouts, and exotic configurations are not fully validated. See ROADMAP.md.
No telemetry.
Local only — caches and diagnostics stay on disk; never writes under your project root.
Subprocesses via argv only (no shell interpolation) — see SECURITY.md.
Optional
JVMSRC_ALLOWED_ROOTSto lock down which projects jvmsrc may resolve.
jvmsrc com.example.MyClass -p /path/to/gradle-project # shorthand for get
jvmsrc get com.example.MyClass -p /path/to/project -q > MyClass.java
jvmsrc resolve -p /path/to/project --force-refresh
jvmsrc config jdk-roots add /path/to/jdks # one-time JDK roots setup
jvmsrc doctor java -p /path/to/project # check JDK requirement + selection
jvmsrc diagnostics last # latest failure message
jvmsrc mcp # run as MCP serverUseful flags: -p / --project, --module (:core:api), --configuration, --include-test, --force-refresh, --verbose (Gradle stderr only), --method, --start-line / --end-line.
Repo fixture for testing:
test/fixtures/gradle-smoke —
jvmsrc get com.smoke.Core -p test/fixtures/gradle-smoke --module :core.
Resolution failures: Run
jvmsrc diagnostics last(orjvmsrc diagnostics last 5)Custom JDK install roots: Add once with
jvmsrc config jdk-roots add /path/to/jdksJDK mismatch debugging: Run
jvmsrc doctor java -p /path/to/projectAfter upgrading jvmsrc: Restart your MCP host
Stale classpath: Run
jvmsrc resolve --force-refresh
Variable | Purpose |
| Force JDK home for Gradle/CFR child processes |
| Global jvmsrc config directory (absolute) |
| Cache root (absolute) |
| Diagnostic logs (absolute) |
| Allowed |
| Max source body size (default 524288) |
| Gradle timeout |
| Custom CFR JAR |
Defaults follow env-paths conventions per OS. Full layout: SPEC.md §6.
When JVMSRC_JAVA_HOME is not set, jvmsrc auto-discovers local JDKs from common paths such as ~/.jdks (IntelliJ), ~/.gradle/jdks, SDKMan, jenv, asdf, and OS-specific system install directories, plus your global configured JDK roots from jvmsrc config jdk-roots ....
Finally, an MCP That Doesn't Make Me Decompile JARs
"This tool is a revelation for anyone tired of LLMs hallucinating non-existent Spring APIs. It actually reads bytecode, providing accurate class definitions and source lookups without the usual 'vibes-based' guesswork. The
search_classesfunctionality is incredibly precise, and the thoughtful implementation ofjavapfallback and granular scope controls (overview/declared/effective) makes navigating complex JARs painless. It’s fast, honest when it can't find a class, and handles cache management perfectly. A must-have for any dev struggling with dependency hell — it’s like having a senior engineer who actually enjoys reading documentation." — Claude (AI Reviewer)
Project Documentation
Document | Contents |
Schemas, contracts, CLI/MCP details | |
Build, test, PR notes | |
Branching, semver, npm releases | |
Version history | |
Status and planned work | |
Vulnerability reporting |
Building from Source
git clone https://github.com/Sintexer/jvm-source-lens.git
cd jvm-source-lens
bun install && bun run setup:cfr && bun run build
node dist/cli.js --versionFull contributor workflow: CONTRIBUTING.md.
I built jvmsrc because I kept running into the same wall: agents that are great at writing Java but blind to the actual classpath. If it saves you the same 25-turn grind it saved me, that's exactly why this exists. Found a bug, have an idea, or just want to say it helped? Open an issue or a PR — I read everything.
License
MIT — see LICENSE.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceAn MCP server for intelligently reading Java source code, supporting extraction from Maven dependencies and local projects with dual decompilers.Last updated154Apache 2.0
- Alicense-qualityBmaintenanceAn MCP server that gives AI agents structured code understanding and precise code intelligence via local indexing of AST, call graphs, and semantic search.Last updated964Apache 2.0
- AlicenseAqualityBmaintenanceA high-performance MCP server that bridges AI agents with Java codebases, providing professional-grade Java language intelligence via Eclipse JDT.LS.Last updated15352GPL 3.0
- AlicenseAqualityBmaintenanceAn MCP server that helps AI agents comprehend a codebase by providing tools for navigating, searching, and understanding code structure and history.Last updated10MIT
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
A MCP server built for developers enabling Git based project management with project and personal…
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Sintexer/jvm-source-lens'
If you have feedback or need assistance with the MCP directory API, please join our Discord server