java-debug

A live debugger for running Java applications through JDWP, Java’s standard debugging connection. It lets you pause the application, inspect or change values, catch exception locations, and watch fields being read or written.

In plain words
What is it for?
Use it for failing tests, wrapped exceptions, incorrect values, race conditions, off-by-one errors, and other bugs that appear only while the program runs.
Why use it?
It helps investigate runtime bugs when code inspection or error messages do not show where a value changes or why an exception occurs. You can examine the running process without repeatedly adding print statements and restarting.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/fgforrest/mcp-jdwp-java/java-debug
Any agent
npx skills add FgForrest/mcp-jdwp-java --skill java-debug
Clone the repo
git clone --depth 1 https://github.com/FgForrest/mcp-jdwp-java

Made for: Claude Code, Codex.

Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,573 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00060 $0.08573
Opus 5 $0.00030 $0.04287
Sonnet 5 $0.00012 $0.01715
Haiku 4.5 $0.00006 $0.00857

Measured yesterday against content hash ca8b77aea530, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

java-debug scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/java-debug/SKILL.md · 342 lines

How it starts

The opening of the file, as written. The whole thing — 342 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Java Debug

Live debugging of a running JVM via JDWP. Replaces "add a println, re-run, repeat" with: set breakpoint -> hit it -> inspect everything -> mutate state -> resume.

Use when:

  • A test fails and the assertion message doesn't tell you why
  • An exception is buried under several layers of wrapping
  • A value is wrong but you can't tell where it changes
  • A bug only happens under specific conditions (race, off-by-one, edge case)
  • Stepping through code in your head doesn't match what the runtime does

Don't use when:

  • The bug is clear from code review alone
  • You already know the fix and just need to write it
  • It's a build/compile failure (not a runtime bug)

Prerequisites

The target JVM must be running with the JDWP agent. The port is whatever the developer (or their deployment) chose — port 5005 is only the convention for build-system test shortcuts. Long-running services very often expose JDWP on a different port (8003, 8000, 9009, …).

-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:<port>

suspend=y blocks the JVM at startup until you attach — use for tests and early-startup bugs. suspend=n lets the JVM run freely — use for long-running services where you attach on demand.

Two attach scenarios:

  1. Launch-and-debug (tests, reproducers): start a fresh JVM yourself, usually via one of the quick-launch shortcuts below.
  2. Attach-to-running (services already up): skip the launch step entirely — go straight to attach. The port follows the resolution priority in the next section.

Quick launch shortcuts (these all default to port 5005):

  • Maven Surefire: mvn test -Dtest=<TestClass> -Dmaven.surefire.debug
  • Gradle: ./gradlew test --tests "com.example.MyTest" --debug-jvm
  • Standalone: java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -jar app.jar

For build-system-specific gotchas (Surefire <argLine> overrides, Gradle maxParallelForks, bootRun) and the already-running-service workflow: see references/prerequisites.md.

Read the full file on GitHub · 342 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 342 lines · 60 tokens per session scan A ca8b77aea530

Subscribe to this mod's changes

java-debug is a skill published in the GitHub repository FgForrest/mcp-jdwp-java (24 stars, last pushed 1mo ago), licensed MIT. It adds 60 tokens to every session and 8,573 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

jdbg

Use when you need a Java program's real runtime state instead of reading source or adding print statements — the actual value of a variable/field/expression at a line, why an exception or NullPointerException is thrown (with stack + locals at the throw site), what a thread is blocked or deadlocked on, or how execution…

PieceOfFall/jdbg · 105 tokens

jdbg

Use the jdbg CLI to debug Java programs interactively from Pi when real runtime state is needed: variables, fields, expressions, exceptions, breakpoints, stepping, threads, locks, or JDWP attach. Pi should use the CLI because jdbg does not install an official Pi MCP server.

PieceOfFall/jdbg · 62 tokens

wxjava-api-contributor

按 WxJava 的 Maven 多模块、Java 8、公共 API 兼容性和 TestNG 约定,为微信官方接口新增或维护 SDK 支持。适用于新增 Service API、请求响应 Bean、序列化、HTTP 实现、Starter 配置或回归测试时。.

binarywang/WxJava · 68 tokens

run-tests

Run project tests using Maven (mvn). Use when the user asks to run tests.

Azure/azure-sdk-for-java · 21 tokens

tika-eval-h2-query

Query the tika-eval H2 database directly for counts and joins the canned reports do not compute — connection gotchas, key tables, example queries. Use when the xlsx/summary.md reports are not enough.

apache/tika · 51 tokens

search-m2

Search for Java classes inside Maven dependencies in /.m2. Use when the user asks to locate classes or inspect JARs. Cross-reference pom.xml files in the current directory to resolve dependency names/versions.

Azure/azure-sdk-for-java · 46 tokens