
Dejared
io.github.hqkh4nh由 GitHub 账号 hqkh4nh 发布v1.2.2更新于 Nov 7, 2026
Java decompiler MCP server. Explore, search, and decompile JAR, WAR, EAR, and AAR bytecode.
概览
本地运行的 MCP 服务器,让编程助手打开 Java 归档、浏览和搜索字节码,并把类反编译回 Java 源码。
- 可以做什么
- 浏览归档内容:列出包及类数量、某个包中的类,以及非类资源文件
- 读取归档内嵌的文本资源,如 YAML、XML、properties 和 JSON
- 按类名或按字节码中的字符串字面量(URL、SQL、错误信息)搜索
- 不反编译即可快速提取类元数据,并支持按包批量提取
- 将单个类反编译为 Java 源码,可在 CFR、Vineflower 和 Procyon 之间选择
- 适用场景
- 适用于依赖未附带源码、需要弄清第三方库实际行为时;顺着堆栈跟踪进入没有源码的库;从归档中找回内嵌的配置或清单文件;或检查混淆过的插件与模组。可替代手动执行 jar、unzip、javap 等命令。
- 运行要求
- 以 stdio 方式作为本地进程运行。npm 包需要 Node.js 20 或更高版本以及 Java 17 或更高版本(JRE 即可);包装器首次运行时会下载并缓存服务器 JAR,因此首次需要网络访问。也可直接用 java 运行该 JAR。若 Java 不在 PATH 中,需设置 DEJARED_JAVA_PATH。
安装
在 SourceWeft 中
- 打开 控制台中的 Dejared,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
[Java] [Node.js] [npm version] [npm downloads] [License: MIT]
dejared-mcp: Java decompiler MCP server
dejared-mcp is a Java decompiler and JAR analyzer that speaks the Model Context
Protocol. It lets an AI coding agent (Claude Code, Codex, Cursor, VS Code)
open a .jar, .war, .ear, or .aar, list what is inside, search its
bytecode, and decompile any class back to Java source using CFR, Vineflower,
or Procyon.
[Claude Code] [Codex] [Install in VS Code] [Add to Cursor]
Table of Contents
- Overview
- Prerequisites
- Quick Start
- Install as a plugin (recommended)
- Install as an MCP server
- Features
- Decompiler Engines
- Custom Java Path
- Server Configuration
- How It Works
- FAQ and Troubleshooting
- Contributing
- Third-Party Licenses
- License
Overview
dejared-mcp is a Java-based MCP server distributed as an npm package.
It provides nine tools organized into three categories: discovery, hunting,
and deep analysis. AI assistants use these tools to navigate JAR file
structures, search for classes and string literals in bytecode, and
decompile .class files back to readable Java source code.
Reach for it whenever a dependency ships without sources: reading what a
third-party library actually does, recovering an application.yml or
MANIFEST.MF embedded in a JAR, following a stack trace into a library you
have no source for, or inspecting an obfuscated plugin or mod. It replaces
hand-running jar tf, unzip, javap, or a desktop decompiler.
Any ZIP-based Java archive works: .jar, .war, .ear, .aar, and
Spring Boot fat-jars.
The npm package acts as a thin wrapper that downloads and caches the
server JAR on first run, then spawns it via java -jar using stdio
transport.
Prerequisites
- Node.js 20 or later
- Java 17 or later (JRE is sufficient)
Quick Start
The best install is the plugin. One command pair gives your agent both halves:
the nine MCP tools, and the jar-analysis skill that tells it when to
reach for them instead of shelling out to jar tf, unzip, or javap.
Codex carries the same bundle. See Install as a plugin. Every other client takes the plain MCP config.
Install as a plugin (recommended)
The MCP server on its own gives an agent nine tools. It does not tell the agent
when to use them, so most agents keep reaching for jar tf, unzip -p, and
javap -p out of habit and never touch the tools you installed.
A plugin ships both parts together:
Two tools support that bundle today. Everything else is MCP-only.
Claude Code
Inside a session, the same commands work as /plugin marketplace add ... and
/plugin install .... If the install summary says Run /reload-plugins to activate, run it.
Codex
Start a new session afterwards so the bundled skill and server load. Check with
codex mcp list. dejared should be listed as enabled.
Install as an MCP server
For clients without a plugin system. You get the tools, but not the skill that steers the agent toward them.
Most clients accept this standard config:
From the command line
If your tool has a CLI, one line is enough:
Where the config file lives
Drop the standard config into the file for your tool:
A few setups need more than the standard config. Expand those below.
Codex: TOML instead of JSON
The -- matters: everything after it is the server's launch command.
Or edit ~/.codex/config.toml (global) or .codex/config.toml (project):
VS Code (GitHub Copilot): uses servers, not mcpServers
Create or edit .vscode/mcp.json:
After saving, click Start above the server entry, then use Agent mode in Copilot Chat.
opencode: command is an array
Edit ~/.config/opencode/opencode.json:
Pure Java (no Node.js required)
If you prefer to run the server JAR directly without Node.js:
-
Download the latest JAR from GitHub Releases.
-
Run it:
-
Configure your MCP client to use the JAR directly instead of
npx:
Features
Discovery
Browse and read JAR contents.
Hunting
Search inside JAR files.
Deep Analysis
Inspect metadata and decompile classes.
Decompiler Engines
dejared-mcp supports three decompiler engines. The engine can be
specified per request via the dejared_decompile_class tool.
Custom Java Path
If Java is not in your system PATH, set the DEJARED_JAVA_PATH environment variable in your MCP config. This applies to all npx-based configurations:
Server Configuration
How It Works
The npm package is a thin Node.js wrapper. On first run it:
- Checks the platform cache directory for a cached JAR matching the current version.
- Linux:
$XDG_CACHE_HOME/dejared-mcp(defaults to~/.cache/dejared-mcp) - macOS:
~/Library/Caches/dejared-mcp - Windows:
%LOCALAPPDATA%\dejared-mcp
- Linux:
- Downloads the JAR from GitHub Releases if not cached.
- Spawns
java -jarwith stdio inherited for MCP transport.
The server communicates over stdio using the Model Context Protocol.
FAQ and Troubleshooting
Q: Java is installed but the server cannot find it.
Set the DEJARED_JAVA_PATH environment variable in your MCP
configuration. See Custom Java Path.
Q: The server fails to start with a permission error.
Ensure that the cached JAR file is readable. The cache location depends on your platform. See How It Works for the cache directory paths.
Q: Decompilation times out or returns an error.
Some classes are difficult to decompile. Try a different engine
by specifying vineflower or procyon in the dejared_decompile_class
tool. The default timeout is 30 seconds and can be adjusted via
dejared.security.decompile-timeout-seconds.
Q: Which Java version do I need?
Java 17 or later. A JRE is sufficient; you do not need a full JDK.
Q: Can I run the server without Node.js?
Yes. Download the JAR from GitHub Releases and run it directly
with java -jar. See the "Pure Java" section under
Install as an MCP server.
Contributing
Contributions are welcome. Please follow these guidelines:
- Fork the repository and create a feature branch from
main. - Ensure your changes compile and pass existing tests.
- Write clear commit messages describing the purpose of each change.
- Open a pull request against
mainwith a description of what the change does and why.
The release version is maintained in package.json. Gradle and the JAR runner
read it directly. To bump the version and synchronize the plugin and registry
manifests, run:
Review and commit all changed manifests together. Create the matching vX.Y.Z
tag only when ready to publish: pushing that tag starts the release workflow.
If you edit package.json manually, run npm run sync-version afterward.
CI and the release workflow reject mismatched versions without modifying files.
Project Structure
Building from Source
Reporting Issues
Open an issue on GitHub Issues with steps to reproduce the problem, your Java version, and your Node.js version.
Third-Party Licenses
This project uses the following open-source libraries:
License
This project is licensed under the MIT License.
来源:README.md,提交 0c272ab
工具
0版本历史
2- v1.2.2最新Nov 7, 2026
- v1.2.1Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分