Java Decompiler

Java Decompiler

Decompile Java bytecode into readable source code from .class files, package names, or JAR archives using CFR decompiler

12
Stars
3
Forks
0
Releases

Overview

An MCP server that exposes a Java bytecode decompiler for use with the Model Context Protocol. It enables AI assistants and MCP-compatible tools to decompile Java class files from various sources (individual .class files, package-qualified names, or JAR archives) into readable Java source code. The server uses a JavaScript port of CFR (@run-slicer/cfr) and runs on Node.js, with no Java runtime required. It provides three MCP tools: decompile-from-path (decompiles a class file from a file path), decompile-from-package (decompiles a class by package name, with an optional classpath), and decompile-from-jar (decompiles a class from a JAR by specifying jarFilePath and className). A full MCP-compatible API and stdio transport are supported for seamless integration with MCP clients. Features include clean error handling and temporary file management for JAR extraction. Installation options cover running via npx, global npm installation, or from source. The README also includes usage examples with MCP clients and environment configuration (e.g., CLASSPATH) and describes the workflow: read class data, decompile with CFR, and return formatted source, using a temporary directory for JAR extraction when needed.

Details

Owner
idachev
Language
JavaScript
License
ISC License
Updated
2025-12-07

Features

Decompile from path

Decompile a Java .class file from a file path.

Decompile from package

Decompile a Java class from a fully-qualified package name (with optional classpath).

Decompile from jar

Decompile a Java class from a JAR file.

Extract specific class from jar

Specify which class to extract from a JAR file.

Full MCP-compatible API

Provides the MCP API for integration with MCP clients.

Stdio transport

Supports standard I/O transport for seamless integration.

Clean error handling

Graceful error handling for decompilation operations.

Temporary file management

Creates and cleans up temporary directories when processing JARs.

Audience

AI assistants and MCP-compatible toolsDecompile Java bytecode from .class files/JARs into readable Java source for MCP clients.

Tags

MCPJava DecompilerCFRBytecodeJARClass FileNode.jsJavaScript portDecompilationMCP ClientAI AssistantDecompiler Service