MCP Java Decompiler Server
About
Decompile Java class files from file paths, package names, or JAR files using a JavaScript port of the CFR decompiler.
Details
- Author
- idachev
- Categories
- Developer Tools, Other
Jump to
Setup
Install MCP Java Decompiler Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/idachev/mcp-javadc
Follow the installation instructions in the repository README, then restart your MCP client.
A Model Context Protocol (MCP) server for decompiling Java class files. This server allows AI assistants and tools that implement the MCP protocol to decompile Java bytecode into readable source code.
- Decompile Java .class files from file path
- Decompile Java classes from package name (e.g., java.util.ArrayList)
- Decompile Java classes from JAR files
- Specify which class to extract from JAR files
- Full MCP-compatible API
- Stdio transport for seamless integration
- Clean error handling
- Temporary file management
- Node.js 16+
- npm
- No Java requirement (using JavaScript port of CFR decompiler)
You can run the server directly with npx without installing:
# Run the server npx -y @idachev/mcp-javadc
# Install globally npm install -g @idachev/mcp-javadc # Run the server mcpjavadc
# Clone the repository git clone https://github.com/idachev/mcp-javadc.git cd mcp-javadc # Install dependencies npm install # Run the server npm start
To use with an MCP client (like Claude or another MCP-compatible AI assistant):
# Configure the MCP client to use this server npx some-mcp-client --server "node /path/to/mcp-javadc/index.js"
claude mcp add javadc -s project -- npx -y @idachev/mcp-javadc
{ "mcpServers": { "javaDecompiler": { "command": "npx", "args": ["-y", "@idachev/mcp-javadc"], "env": { "CLASSPATH": "/path/to/java/classes" } } } }
Decompiles a Java .class file from a file path.
- classFilePath: Absolute path to the Java .class file
{ "jsonrpc": "2.0", "id": "1", "method": "mcp.tool.execute", "params": { "tool": "decompile-from-path", "args": { "classFilePath": "/path/to/Example.class" } } }
Decompiles a Java class from a package name.
- packageName: Fully qualified Java package and class name (e.g., java.util.ArrayList)
- classpath: (Optional) Array of classpath directories to search
{ "jsonrpc": "2.0", "id": "2", "method": "mcp.tool.execute", "params": { "tool": "decompile-from-package", "args": { "packageName": "java.util.ArrayList", "classpath": ["/path/to/rt.jar", "/path/to/classes"] } } }
Decompiles a Java class from a JAR file.
- jarFilePath: Absolute path to the JAR file (required)
- className: Fully qualified class name to extract from the JAR (required) (e.g., "com.example.MyClass")
{ "jsonrpc": "2.0", "id": "3", "method": "mcp.tool.execute", "params": { "tool": "decompile-from-jar", "args": { "jarFilePath": "/path/to/example.jar", "className": "com.example.MyClass" } } }
The CFR decompiler (@run-slicer/cfr) is a JavaScript port of the popular CFR Java decompiler. It works well with:
- Standard Java class files
- Classes that are part of a known package structure
- Modern Java features (all Java versions)
- JAR files containing Java classes
If you encounter issues with a specific class file, try:
- Using thedecompile-from-packagetool with explicit classpath
- Using thedecompile-from-jartool with explicit class name
- Ensuring the class file is a valid Java bytecode file
- Checking for corrupt class files or JAR archives
When working with JAR files from Maven repositories:
- Use thefind ~/.m2 -name "dependency-namejar"command to locate JAR files
- Filter out source and javadoc JARs usinggrep -v source | grep -v javadoc
- Usejar tf your-jar-file.jar | grep .classto list available classes in a JAR
- Check that class names match the package structure in the JAR
- CLASSPATH: Java classpath for finding class files (used when no classpath is specified)
# Run in development mode npm run dev # Create test fixtures (creates sample Java class for testing) npm run test:setup # Run tests npm test # Run linting npm run lint # Fix linting issues npm run lint:fix # Format code npm run format # Run with MCP Inspector for interactive testing npx @modelcontextprotocol/inspector node ./index.js
You can use the official MCP Inspector tool to test the server functionality interactively:
# Install and run the MCP Inspector with the decompiler server npx @modelcontextprotocol/inspector node ./index.js
The Inspector provides a user-friendly web interface that allows you to:
- List all available tools
- Execute the decompilation tools with custom parameters
- View and explore the decompiled output
- Test different inputs and error scenarios
This is especially useful for debugging and understanding the MCP server's capabilities before integrating it with other applications.
- The server uses the CFR decompiler (@run-slicer/cfr - a JavaScript port of the popular CFR Java decompiler)
- When a decompile request is received, the server:
- Reads the class file data directly or extracts it from a JAR file
- Processes the class file with CFR decompiler
- Returns the formatted source code
- Creates a temporary directory for extraction
- Extracts the JAR contents
- Decompiles the specified class (or first class if none specified)
- Cleans up the temporary directory
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
Fast lightweight Java MCP server framework - Build Model Context Protocol servers with minimal boilerplate and full TypeScript SDK compatibility
A Java plugin that exposes the Jadx decompiler API over HTTP for interaction with MCP clients.
Specialized tools for analyzing and migrating Java applications from Java EE 8 (javax.) to Jakarta EE 9+ (jakarta.).
Java Archive Reader Protocol MCP server - Give AI agents X-ray vision into compiled Java code by decompiling JAR/WAR/EAR files and Maven/Gradle dependencies
A Model Context Protocol (MCP) server for searching Java documentation. This server enables AI assistants to search and retrieve Java API documentation from JSON files.
Allows AI assistants to remotely drive the JetBrains debugger via MCP, including breakpoints, stepping, and variable inspection.
Resolves your Gradle project’s real classpath and returns Java source, method signatures, and class structure for any dependency class—using the version your build actually uses, not random files from ~/.gradle/caches.
Legacy Java to Microservices Refactoring
A community gateway to migrate legacy Jakarta EE monoliths into Spring Boot using AST parsing.
Search for and retrieve detailed information, including READMEs and metadata, for Maven packages from Maven Central.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





