Skip to main content
Glama
idachev

MCP Java Decompiler Server

by idachev

decompile-from-jar

Decompiles a specified Java class from a JAR file into readable source code. Provide the JAR file path and fully qualified class name to inspect the bytecode.

Instructions

Decompiles a Java class from a JAR file

Using mcp_javadc with Maven Repository

When you need to decompile Java classes from dependencies in the M2 repository, follow these steps:

Step 1: Find the JAR file location

First, search for the dependency JAR in the local Maven repository:

find ~/.m2 -name "*dependency-name*jar" | grep -v source | grep -v javadoc

Notes:

  • Replace dependency-name with the artifact name

  • Filter out source and javadoc JARs using grep

  • Look for the correct version based on the project's POM file

Step 2: Use the correct mcp_javadc function

Once you have the JAR path, use this function:

For specific class decompilation:

  • jarFilePath: The absolute path to the JAR (from Step 1)

  • className: Fully qualified class name to decompile

For contextual exploration: If needed, first try to find all available classes in the JAR: jar tf /path/to/the.jar | grep .class | sort

Example workflow:

  1. Read the POM file to identify dependency version

  2. Search the M2 repository for the JAR

  3. Use mcp_javadc to decompile relevant classes

  4. If multiple versions exist, select the one matching the project's version requirement

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
classNameYesFully qualified class name to decompile from the JAR (e.g., "com.example.MyClass")
jarFilePathYesThe absolute path to the JAR file
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the full burden of behavioral disclosure. It only states the core function and provides usage workflow; it does not describe what the decompilation returns, whether it creates files, requires special permissions, or how errors are handled. For a tool with no annotation safety profile, this is a significant transparency gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is structured with a clear one-sentence overview followed by a multi-section guide with headings, code blocks, and notes. While organized, it is lengthy for a simple function and includes details like 'grep -v source' that may be beyond the tool's core usage. The repeated mention of 'mcp_javadc' (a different name) and the Maven-specific workflow add unnecessary verbosity, though the structure is readable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has two parameters, no output schema, and no annotations. The description provides a complete workflow for the Maven repository use case, which is valuable, but it does not explain the output format (decompiled source code) or address non-Maven JAR usage. It also lacks differentiation from sibling tools beyond the source type. This is adequate for a clear use case but incomplete for general application.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%—both parameter descriptions already explain the values clearly. The description adds some contextual meaning by showing how to locate the jarFilePath via Maven commands and gives an example of className format, but these are supplemental rather than essential. Baseline 3 is appropriate because the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening line 'Decompiles a Java class from a JAR file' clearly states the verb (decompiles), resource (Java class), and source (JAR file). This immediately distinguishes it from sibling tools decompile-from-path and decompile-from-package by specifying the input type. The additional detail about fully qualified class names further clarifies the exact purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes a detailed 'Using mcp_javadc with Maven Repository' section that explains when to use this tool: when decompiling classes from dependency JARs in the M2 repository. It provides step-by-step instructions including finding the JAR and using the function. However, it does not explicitly mention alternatives or when not to use this tool, so it misses the exclusion part, though the context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/idachev/mcp-javadc'

If you have feedback or need assistance with the MCP directory API, please join our Discord server