mcp-jdwp-java CLAUDE.md

Project instructions for building a two-module Java Maven project that includes an MCP server and a debugging sandbox.

In plain words
What is it for?
For compiling the project, packaging the MCP server, running its real tests, or explicitly running the sandbox's debugging test flights.
Why use it?
They explain which commands build the project, which tests normally run, and why some sandbox tests are intentionally allowed to fail.

Instructions file

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 instructions/fgforrest/mcp-jdwp-java/claude-md
Clone the repo
git clone --depth 1 https://github.com/FgForrest/mcp-jdwp-java
Per session 1,387 This file is loaded in full into every session.
When invoked 1,387 The same file — it is already loaded in full.
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.01387 $0.01387
Opus 5 $0.00694 $0.00694
Sonnet 5 $0.00277 $0.00277
Haiku 4.5 $0.00139 $0.00139

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

Security

Grade A, and why

mcp-jdwp-java CLAUDE.md 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 2d ago.

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.

CLAUDE.md · 76 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Build Commands

# Run from the reactor root. Builds both modules.
# Prefer ./mvnw (the bundled Maven Wrapper) — it pins the Maven version and
# does not require Maven to be installed system-wide. Plain `mvn` works too
# if it is on PATH.
./mvnw compile                                    # Compile only
./mvnw clean package -DskipTests                  # Full build (produces jdwp-mcp-server/target/mcp-jdwp-java.jar)

# Build only the MCP server (skips the sandbox module entirely):
./mvnw -pl jdwp-mcp-server -am clean package -DskipTests

The repository is a 2-module Maven reactor:

  • jdwp-mcp-server/ — the real MCP server. Contains all genuine unit tests; ./mvnw -pl jdwp-mcp-server test runs them.
  • jdwp-sandbox/ — deliberately broken Java classes used as JDWP debugging targets ("test flights"). Sandbox tests are expected-to-fail by design and are skipped by default so a normal ./mvnw test stays green. Run them explicitly during a test flight with: ./mvnw -pl jdwp-sandbox test -DskipTests=false.

The compiler requires --add-modules jdk.jdi (configured in jdwp-mcp-server/pom.xml). At runtime, the JAR must also be launched with --add-modules jdk.jdi.

Architecture

This is a Spring Boot MCP Server that lets Claude Code inspect and control running Java applications via JDWP (Java Debug Wire Protocol). It connects directly to a target JVM's JDWP port (default 5005).

Claude Code ──MCP/STDIO──> Spring Boot MCP Server ──JDI──> Target JVM (port 5005)

Core Components

  • JDWPTools — Exposes ~30 MCP tools via @McpTool annotations. This is the main interface: connection, thread/stack/variable inspection, breakpoints, stepping, and watcher evaluation. All tool methods return formatted String responses.
  • JDIConnectionService — Singleton holding the persistent VirtualMachine (JDI) connection. Manages object caching (ConcurrentHashMap<Long, ObjectReference>) and smart collection rendering (ArrayList, HashMap, HashSet internals). Also drives classpath discovery for expression evaluation.
  • BreakpointTracker — Maintains a registry of breakpoints with synthetic integer IDs (since JDI BreakpointRequest has no user-facing ID). Tracks the last thread that hit a breakpoint.
  • JdiEventListener — Daemon thread consuming the JDI event queue. Updates BreakpointTracker on breakpoint/step events. Breakpoint events do NOT auto-resume — threads stay suspended for user inspection.

Read the full file on GitHub · 76 lines

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. 2d ago First seen · 76 lines · 1,387 tokens per session scan A c400464d039f

Subscribe to this mod's changes

mcp-jdwp-java CLAUDE.md is an instructions file published in the GitHub repository FgForrest/mcp-jdwp-java (24 stars, last pushed 1mo ago), licensed MIT. It adds 1,387 tokens to every session, about $0.0069 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.