MCP JDWP Inspector
MCP server that gives AI agents full debugger control over running Java applications — inspect state, set breakpoints, evaluate expressions, and mutate values at runtime via JDWP/JDI.
Release notes — see CHANGELOG.md.
Built on the foundations of mcp-jdwp-java by Nicolas Vautrin — the original project that provided core JDI connectivity, thread/stack/variable inspection, stepping, and basic breakpoint management. Everything described below as "beyond standard JDWP" was built on top of that base.
What you get (TL;DR)
An MCP server that speaks JDWP — the same protocol IntelliJ / Eclipse / VS Code use to attach — and exposes the debugger to Claude Code and Codex as 50 tools + 2 MCP resources over STDIO. Once the agent attaches to your JVM, it can:
- See runtime state, not stack traces — read locals, fields, threads, the entire object graph
- Evaluate Java in the suspended frame — read private fields and invoke supported private methods through JDI
- Mutate the running program — set locals, write fields, test "what if?" without restart
- Stop on the bad case only — conditional breakpoints, exception breakpoints at the throw site, deferred BPs that arm before the class loads, chains that gate one BP on another
- Trace without stopping — line/exception/field logpoints write to an event log; the hitting thread pauses only while the server evaluates the expression, then runs on
- Probe hot code at full speed — with the user's consent, fast logpoints and fast breakpoints evaluate inside the target JVM: hits that do not match never reach the debugger, and the method stays JIT-compiled
- Catch the writer of a mutating field — watchpoints suspend at every bytecode store to the field, wherever it is; a write through reflection or
Unsafe is the one they cannot see, and the [VM_DEATH] reply's hit count shows when a watchpoint stayed silent
- Pure STDIO — no daemon, no extra port, no GUI
The agent gets the same power as IntelliJ's debugger, with extras that exist specifically because an agent isn't a human staring at a UI (filtering, blocking resume, one-shot context dumps, recursion guards, reconnect after a wedge).
Security & trust
This MCP server runs on your machine, as a child process of the agent:
- No phone-home — the server talks to the agent over STDIO and to the target JVM over a JDWP socket (local by default;
jdwp_wait_for_attach accepts another host). It sends no HTTP requests of its own: no telemetry, no analytics. Two things around it can use the network:
- Getting the JAR — see the next point.
- Maven, for expression evaluation — when the server attaches and the project directory holds a
pom.xml, it runs mvn dependency:build-classpath there in the background (./mvnw when the project has it) to find JARs the target's class loaders hide. Maven may download the project's dependencies from the repositories the project configures. Each run requests a private temporary output directory and removes it after discovery. A dependency plugin outputFile configured in the POM overrides that destination.
- Built from source, or the release JAR of this repository — under Claude Code, the plugin's SessionStart hook compiles the JAR on your machine from the sources in this repository (or build it yourself with
./mvnw clean package); the build fetches Maven and the dependencies from Maven Central on first use. Under Codex, the plugin's launcher downloads mcp-jdwp-java-<version>.jar from this repository's GitHub release of the installed version when the installed server sources are the ones tagged for that release (a copy without git history is trusted by its version number); otherwise, or when the download fails, it compiles from source like the hook. Every release attaches that JAR, built from the tagged sources by the release workflow in GitHub Actions.
- What it does to the target — what any debugger does: it reads and changes the target's state and runs code in it (expression evaluation defines small wrapper classes in the target). Rewriting the application's own bytecode — fast logpoints and fast breakpoints — requires the user's approval of a risk briefing. That approval covers the same probe on later JVMs at the same endpoint for the MCP server's lifetime. Clearing them,
jdwp_reset, jdwp_disconnect and a clean server shutdown restore the original bytecode; what a crashed server leaves behind is listed at the next attach (see Fast logpoints).
- Auditable — the full source is here. The server is a standard Spring Boot application with no obfuscation or native code. Try asking your agent: "audit these sources for anything that touches network or filesystem beyond the JVM target".
Quick start
Prerequisites