ai newsMi., 25. Nov.
EilmeldungCan Claude’s storage webhooks miss an hour-long outage?

A javap alternative for AI agents: an MCP server that reads Java bytecode

When an AI coding agent needs to know what a dependency jar actually contains, it usually reaches for the tools a human would: unzip -l , javap , grep , sed . That works, but it is expensive. javap -c dumps the whole class, the agent pages through it with head , and a lot of tokens go to output it

dev.toSamstag 22:13 · 21.11.3 Min. Lesezeit
Bild: dev.to

When an AI coding agent needs to know what a dependency jar actually contains, it usually reaches for the tools a human would: unzip -l, javap, grep, sed. That works, but it is expensive. javap -c dumps the whole class, the agent pages through it with head, and a lot of tokens go to output it never needed.

jdx is an open-source (Apache-2.0) command line tool and MCP server that answers IDE-style questions about any JVM jar, -sources.jar, class directory, Maven coordinate or the JDK itself, and returns only the part you asked for.

The jdx README has a reproducible benchmark ( sh docs/bench-compare.sh ) for one task: list Gson's API, then show only toJson(Object) on gson-2.14.0.

The method body alone is 267 bytes from jdx, versus 60,590 bytes for javap -c on the class (226x) or 58,251 bytes for the full Gson.java (218x).

$ jdx body 'com.google.gson.Gson#toJson(Object)' --coord com.google.code.gson:gson:2.14.0 com.google.gson.Gson#toJson ( java.lang.Object ) source: gson-2.14.0-sources.jar · com/google/gson/Gson.java:542-547 public String toJson ( Object src ) { if ( src == null ) { return toJson ( JsonNull.INSTANCE ); } return toJson ( src, src.getClass ( ) ); } next: jdx show com.google.gson.Gson Enter fullscreen mode Exit fullscreen mode Every answer says where it came from ( source: line). When there is no sources jar, jdx decompiles with Vineflower and labels the output ⚠ reconstructed; --engine javap still gives you raw bytecode when you want it.

It also refuses to guess. Ask for Gson#toJson without a signature and it exits with code 2 and lists all 8 overloads as paste-ready references, so an agent can pick the right one instead of reading the wrong method.

jdx mcp exposes 27 typed tools (v1.7.0): jdx_members, jdx_body, jdx_source, jdx_signature, jdx_usages, jdx_callers, jdx_implementors, jdx_hierarchy, jdx_diff, jdx_literals, jdx_resources and more. Generic config:

{ "mcpServers": { "jdx": { "command": "jdx", "args": [ "mcp" ] } } } Enter fullscreen mode Exit fullscreen mode Or wire it into your agent in one command:

jdx setup --agent claude-code --scope project Enter fullscreen mode Exit fullscreen mode Supported agents: Claude Code, Cursor, Codex CLI, GitHub Copilot CLI, OpenCode, Kilo Code, Cline ( --scope system ), Antigravity, Windsurf and Aider. Per-agent guides: integrations.

Through the daemon/MCP server answers are warm (about 20 ms, per the docs), versus roughly 250 ms for a cold one-shot CLI call.

jdx parses bytecode with ASM and never loads or executes the classes it inspects. It only touches the network when you pass --fetch (or run jdx upgrade / jdx kotlin install ). Inside a Gradle or Maven project it finds sources and dependency jars from the local caches without running the build.

For Kotlin jars it reads @Metadata and shows true signatures (suspend, properties, default arguments, nullability). Minecraft modders can inspect mod jars from the terminal; jdx does not remap, so pass the Loom-remapped jar with --jars. There is a guide: Inspect Minecraft mod jars from the terminal.

curl -fsSL https://raw.githubusercontent.com/MohammadMD1383/jdx/main/install-release.sh | bash jdx members java.util.HashMap --limit 5 Enter fullscreen mode Exit fullscreen mode Needs a Java 21+ runtime; works on Linux, macOS and Windows. Docs and quickstart: https://mohammadmd1383.github.io/jdx/ · Source: https://github.com/MohammadMD1383/jdx

Quelle: dev.to (dev.to). Original öffnen