java-debug-mcp
An MCP server that turns an LLM into a Java debugger via JDI — pre-declare the values you want before a breakpoint fires and get back a compact ▎ structured snapshot, no heap dumps.
Install / Use
claude mcp add ylw-a -- npx -y github:ylw-a/java-debug-mcpIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AI & Machine LearningSupported Platforms
Tags
Our assessment of java-debug-mcp
java-debug-mcp scores 77/100 on our quality scale, 818th of 945 AI & Machine Learning skills we index.
Its MCP Server is 10 KB long, well organised into 19 sections with 12 code examples: a thorough specification that gives an agent plenty to work with.
It has 3 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated about 4 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 90/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
java-debug-mcp compared with similar skills
All 4 of these similar skills score higher than java-debug-mcp; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| java-debug-mcp (this skill)by ylw-a | 77 | 3 | 4mo ago | MCP Server |
| claude-memby thedotmack | 100 | 110.2k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 107.8k | 1d ago | CLAUDE.md |
| Understand-Anythingby Egonex-AI | 100 | 89.7k | 7d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 78.6k | today | CLAUDE.md |
Frequently asked questions
- How do I install java-debug-mcp?
- Run
claude mcp add ylw-a -- npx -y github:ylw-a/java-debug-mcp. The install tabs above show the steps for each supported agent. - Which AI agents does java-debug-mcp work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is java-debug-mcp safe to use?
- It is MIT-licensed and scores 90/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is java-debug-mcp still maintained?
- The repository was last updated about 4 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
Skill content
View source on GitHubjdb-mcp — Let your LLM debug Java (JDB / JDI over MCP, for Claude Code & any MCP client)
jdb-mcp turns an LLM into a Java debugger. It exposes JDI — the same engine behind jdb
and the JDWP protocol — as an MCP server, so AI agents like Claude Code can set
breakpoints, step through code, capture exceptions, and inspect a live JVM. The core advantage:
the AI pre-declares exactly which values it wants before the breakpoint fires, and jdb-mcp
returns only those as a compact structured snapshot — no heap dumps, no stack-dredging, no
context blowup. Just the data the hypothesis needs, on demand.
Keywords:
LLM·AI agent·Java DEBUG·JDB·JDI·JDWP·MCP·Claude Code·breakpoint·live JVM inspection
Why jdb-mcp?
- LLM-friendly by design. Capture-then-snapshot means the model never sees a raw heap — only the few fields/paths it named. Keeps token cost and hallucination risk low.
- Two debug modes. Mode A: fire-and-buffer in the background, poll snapshots later. Mode B:
arm a breakpoint non-blocking, then
resumeblocks until the hit so the AI canexplore/step/get_variablesinteractively. - Expression engine. Read paths like
this.user.id,args[0].items,arr.length,list[i],sorted[mid],obj.getX()— with null-break reporting (you learn where a path went null). - Anti-addiction. A session counter warns after 8+ debug actions — debugging is costly, so the tool steers the AI toward logs/tests first.
- Zero-config. No config file, no env vars. Pass target info to
start_session; the npm launcher auto-detects your JDK 17+. - Production-safe option.
safeMode=truedisables all method invocation (no toString/getter side effects) — field reads and array indexing only.
Design
analyze code -> form hypothesis ("I suspect user.id is null") -> set breakpoint + declare captures
-> tool extracts exactly what was declared -> AI gets structured result -> verify/fix
Two modes:
- Mode A (default, non-blocking): breakpoint fires in the background, capture is stored
into a HitBuffer, thread auto-resumes. AI polls
list_hitsfor snapshots. - Mode B (interactive):
set_breakpoint(mode=B)arms non-blocking and returns immediately. The AI triggers its request (curl/manual), then callsresumewhich blocks until the hit — the JVM suspends for inspection viaexplore,get_frames,get_variables,step, oreval(dangerous), thenresumeagain to continue. One interactive hit perset_breakpoint(mode=B); later hits degrade to mode A (buffered) — re-arm mode B to inspect again.set_breakpointnever blocks;resumedoes the waiting.
DEBUG SPARINGLY. Debugging is costly (target-JVM time + context). Only use with a concrete hypothesis that logs, inspection, and tests cannot resolve. The server instructions and every tool description emphasize this with a session-level counter that warns after 8+ debug actions.
Quick Start
Via npm (recommended — no source, no build)
npm install -g jdb-mcp
Requires: JDK 17+ and Node.js 16+. That's it — no Maven, no source, no config file.
The jdb-mcp command auto-detects your JDK (JAVA_HOME → PATH → common install locations) and
launches the bundled debug server over stdio. If your JDK isn't on the PATH, point JAVA_HOME
at it:
# Linux / macOS
export JAVA_HOME=/path/to/jdk-17
jdb-mcp
# Windows (Git Bash / cmd / PowerShell)
set JAVA_HOME=F:\path\to\jdk-17
jdb-mcp
Via npx (no global install)
npx -y jdb-mcp
From source (for development)
Requires JDK 17+ and Maven 3.6+ on your PATH.
git clone https://github.com/ylw/jdb-mcp.git
cd java-debug
export JAVA_HOME=/path/to/jdk-17
mvn package -DskipTests
# fat jar: jdb-mcp/target/jdb-mcp-1.0.0.jar
java -jar jdb-mcp/target/jdb-mcp-1.0.0.jar
Claude Code Wiring
With npx (auto-install, recommended)
No npm install needed — npx -y fetches jdb-mcp from the registry on first run and caches it.
Default Java is JDK 17+ (auto-detected by the launcher):
{
"mcpServers": {
"jdb-mcp": {
"command": "npx",
"args": ["-y", "jdb-mcp"]
}
}
}
Default Java is NOT JDK 17+ — point JAVA_HOME at your JDK 17 with the env field:
{
"mcpServers": {
"jdb-mcp": {
"command": "npx",
"args": ["-y", "jdb-mcp"],
"env": { "JAVA_HOME": "XXX/jdk17" }
}
}
}
Replace
XXX/jdk17with your actual JDK 17 path. The launcher checksJAVA_HOMEfirst (highest priority), thenjavaonPATH, then common install locations.
With global install
After npm install -g jdb-mcp:
{
"mcpServers": {
"jdb-mcp": {
"command": "jdb-mcp"
}
}
}
If your default Java is not JDK 17, add "env": { "JAVA_HOME": "XXX/jdk17" } as above.
Direct jar
{
"mcpServers": {
"jdb-mcp": {
"command": "XXX/jdk17/bin/java",
"args": ["-jar", "XXX/jdb-mcp-1.0.0.jar"]
}
}
}
No config file required (optional JDB_MCP_LOG for log level). The AI passes target info
directly to start_session.
Tool List (17 tools)
| Tool | Purpose |
|---|---|
| start_session | Step 1. Launch target (jar or mainClass+classpath) or attach to running JVM. Zero-config: pass params directly. |
| stop_session | Detach and terminate target. Clears all breakpoints and hits. |
| configure | Adjust session limits/budgets mid-session (anti-addiction: raises above default are tracked). |
| session_status | Attachment state, breakpoints, hit counts, limits, budgets. |
| list_debuggable_jvms | Pre-attach discovery. Scan running JVMs with JDWP agents (jps -lv). No session needed. |
| resolve_class | Fuzzy-resolve a class name to confirm FQCN before set_breakpoint. |
| list_classes | Paginated enumeration of loaded classes (prefix filter, offset/limit). |
| set_breakpoint | Core. Pre-declare captures + mode A/B. Per-bp limit overrides supported. |
| set_exception_breakpoint | Fire when an exception is thrown. Captures use e root for the exception object. |
| list_hits | Poll snapshots for a breakpoint (mode-A retrieval). limit + compact to keep output small. |
| remove_breakpoint | Disable and remove a breakpoint (also clears its captured hits). |
| resume | After set_breakpoint(mode=B): block until the hit. After inspecting: continue. |
| get_frames | Mode B. Full call stack of suspended thread. |
| get_variables | Mode B. Local variables for a frame, with optional expand_paths. |
| step | Mode B. Step over/out/into (budgeted, default 5/suspend). |
| explore | Mode B. Evaluate a read-path on suspended frame (budgeted). |
| eval | Mode B. Dangerous: invoke arbitrary no-arg method (disabled by default, needs allowEval=true). |
Expression Grammar (captures, explore, expand_paths)
this current object
this.field / obj.field field read
a.b.c.d.e nested path (default max 5 dereferences)
obj.getX() / obj.isX() no-arg getter (get*/is* + size/isEmpty/length/toString)
args[N] method parameter by position
arr[i] / list[i] array index, or java.util.List index (uses get(int))
arr.length array length (mirrored as int)
sorted[mid] index by named local variable (resolved at runtime)
e.getMessage() exception root (exception breakpoints only)
The root is one of: this, args[N], e (exception bp), or a named local variable.
Null-break: intermediate null -> status=null_break, nullBreakAt="<segment>" — you know WHERE it broke.
Limits (defaults, adjustable via configure or start_session):
- path depth: 5, toString: 500 chars, collection: 20 elements, fields: 50
- render node budget: 1000 per capture (explosion guard; bare
thisrenders shallow — direct fields only) - Mode B budgets: explore 5, eval 2, step 5 per suspend
Safe mode (safeMode=true): no method invocation at all — no getters, no toString, no
List expansion. Only field reads and array indexing. Recommended for production debugging
to avoid unpredictable side effects from toString/equals implementations.
Tests
export JAVA_HOME=/path/to/jdk-17
mvn -pl jdb-mcp -am test
DebugSessionIT(integration, 17 tests): mode A (null-break, collection truncation, getter paths, List indexing, named param, this fields, boxed primitives, safe_mode), mode B (non-blocking arm + resume blocks + explore + get_frames/get_variables/step), resolve_class, exception breakpoint (e.getMessage/e.reason), list_debuggable_jvms, configure, remove_breakpoint clears hits, list_classes substring filter, shallow bare-root render, render-budget truncation, array.length capture,[var]index resolution.ExprCaptureTest(3 unit tests): valid expressions, malformed, whitespace.
Project Structure
java-debug/
pom.xml # parent pom (modules: demo, jdb-mcp)
README.md
LICENSE # MIT
demo/ # debug target (executable jar)
jdb-mcp/
pom.xml # mcp, slf4j-simple; shade fat jar
src/main/java/com/ylw/jdbmcp/
Main.java # entry: stdio MCP server, zero-config
Defaults.java # default constants
StartParams.java # start_session parameters
mcp/ # MCP layer (ToolDefs, McpJson, ToolResponses)
debug/ # JDI core (DebugSession, JdiEventLoop, SessionConfig,
# BreakpointManager, Breakpoint, ClassResolver, ProxyFilter,
# ExprCapture, ExprEval, TargetLauncher, TargetSpec, CommandBus)
snapshot/ # POJO models (Hit, HitBuffer, ValueNode, CaptureResult)
src/test/java/... # integration + unit tests
Package naming: com.ylw.jdbmcp (.mcp / .debug / .snapshot).
License
MIT License — the most permissive open-source license. Use it commercially, fork it, modify it, ship it, no strings attached. Attribution appreciated but not required.
See LICENSE for the full text.
Copyright © 2026 ylw.
Related Skills
claude-mem
110.2kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Agent-Reach
107.8kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
Understand-Anything
89.7kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
headroom
78.6kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
