MCP server for Java class and jar file decompilation using CFR
Wellknown found it in public sources; nobody has proven control of it yet. Claiming takes one click if the repository is under your GitHub account, or a small file on your domain otherwise. Verified owners get the badge, 15-minute checks, status alerts, edits that outrank crawled data, and a ranking boost.
Agents can do it too: POST https://wellknown.network/api/v1/claims with {"agent":"iflow-mcp-ruoji6-java-decompile-mcp","method":"well_known_file"} — machine-readable steps at claim.json, guide at /docs/claim.
Everything here was measured by our prober or read from a registry. Nothing is self-reported.
Attributed to the source that supplied each field. Treated as claims, not facts.
# Java Decompiler MCP Server 一个基于 MCP (Model Context Protocol) 的 Java 反编译工具,使用 CFR 反编译器对 `.class` 和 `.jar` 文件进行反编译。 ## 功能特性 - ✅ 单个文件反编译(.class / .jar) - ✅ 多个文件批量反编译 - ✅ 目录递归扫描反编译 - ✅ 自定义输出目录 - ✅ 自动下载 CFR 反编译器 - ✅ 直接保存到文件系统(避免 token 限制) - ✅ 实时进度显示 - ✅ 详细统计信息 - ✅ **多线程并发处理(大幅提升速度)** ## 改进亮点 ### 🚀 解决大文件/大量文件反编译问题 **问题:** 当反编译大量文件时,如果将所有结果作为字符串返回,可能超过 MCP 的 token 限制(例如 413,072 字符)。 **解决方案:** 1. **直接保存到文件系统**(推荐) - 新增 `save_to_file` 参数(默认 `true`) - 反编译结果直接写入指定目录 - 仅返回摘要信息(成功数、失败数、输出路径等) - 避免通过 MCP 传输大量内容 2. **实时进度显示** - 新增 `show_progress` 参数(默认 `true`) - 显示当前处理进度:`[1/46] 处理中: Controller.class` - 实时反馈处理状态 3. **详细统计报告** - 成功/失败/跳过文件数 - 生成的 .java 文件总数 - 输出目录路径 - 清晰的格式化输出 ### 使用示例 **场景 1:反编译大量文件(推荐方式)** ```python # 使用 8 个线程并发处理,大幅提升速度 decompile_directory( directory_path="/path/to/classes", output_dir="/path/to/output", save_to_file=True, # 默认值 show_progress=True, # 显示进度 max_workers=8 # 8 线程并发 ) ``` **场景 2:反编译少量文件并查看内容** ```python # 返回反编译内容(仅适用于小文件) decompile_file( file_path="/path/to/MyClass.class", save_to_file=False # 返回内容而不是保存 ) ``` **场景 3:静默批量处理** ```python # 不显示详细进度,仅返回统计,单线程处理 decompile_files( file_paths=[...], show_progress=False, # 仅显示统计信息 max_workers=1 # 单线程 ) ``` ## 环境要求 - Python >= 3.10 - Java Runtime Environment (JRE) - uv (Python 包管理器) ## 安装 ### 方式一:通过 uvx 直接使用(推荐) 无需安装,直接在 MCP 配置中使用(可让ai自动下载cfr-0.152.jar然后你手动配置路径): ```json { "mcpServers": { "java-decompiler": { "type": "stdio", "command": "uvx", "args": ["java-decompile-mcp"], "env": { "CFR_PATH": "/你的路径/cfr-0.152.jar" }, "disabled": false } } } ``` ### 方式二:本地开发 ```bash # 克隆项目 git clone <repository-url> cd java-decompile-mcp # 创建虚拟环境并安装依赖 uv venv source .venv/bin/activate # macOS/Linux # 或 .venv\Scripts\activate # Windows uv pip install "mcp>=1.0.0" ``` ## MCP 配置 ### 方式一:使用 uvx(推荐,已发布到 PyPI) 在 `.kiro/settings/mcp.json…
Mapped onto the structured taxonomy from declared text and observed tool names. Confidence shown for derived entries.
Every source is kept verbatim. Field changes are logged as events.