MCP server for scanning Maven dependencies and decompiling Java classes
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":"java-class-analyzer-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 Class Analyzer MCP 一个基于 Model Context Protocol (MCP) 的 Java 类分析服务,可以扫描 Maven 项目依赖、反编译 Java 类文件、获取 class 方法列表等详细信息,并提供给 LLM 进行代码分析。 ## 适用场景 Cursor 等 AI 工具直接生成调用二方(内部调用)、三方包(外部调用)接口的代码,但因 AI 无法读取未在当前工程中打开的依赖源码,导致生成的代码错误频出,甚至出现幻觉式编码。 为解决此问题,一般会直接拷贝源码内容喂给 LLM;或者先将源码文件放到当前工程内,再在对话中引用。 而使用本地反编译 MCP 方案最有效,能精准解析 jar 包中的类与方法,显著提升代码生成的准确性和可用性。 ## 功能特性 - **使用方便**:基于 Python 实现,通过 `pip install` 一键安装,内置 CFR 反编译工具,无需手动下载 - **依赖扫描**:自动扫描 Maven 项目的所有依赖 JAR 包 - **类索引**:建立类全名到 JAR 包路径的映射索引 - **反编译**:使用内置 CFR 工具实时反编译 .class 文件为 Java 源码 - **类分析**:分析 Java 类的结构、方法、字段、继承关系等 - **智能缓存**:按包名结构缓存反编译结果,支持缓存控制 - **自动索引**:执行分析前自动检查并创建索引 - **LLM 集成**:通过 MCP 协议为 LLM 提供 Java 代码分析能力 ## 安装说明 ### 环境要求 - Python 3.11+ - Java Development Kit (JDK) 8+(用于运行 CFR 反编译工具) - Maven 3.6+ ### 安装 ```bash pip install java-class-analyzer-mcp ``` CFR 反编译工具已内置于包中,无需手动下载。 ## MCP 服务配置 ### Cursor / 通用 MCP 客户端配置 在 MCP 客户端配置文件中添加以下内容: ```json { "mcpServers": { "java-class-analyzer": { "command": "java-class-analyzer-mcp", "env": { "LOG_LEVEL": "INFO", "MAVEN_REPO": "~/.m2/repository", "JAVA_HOME": "/path/to/your/jdk", "CFR_PATH": "" } } } } ``` ### OpenCode 配置示例 ```json { "mcp": { "java-class-analyzer": { "command": ["java-class-analyzer-mcp"], "enabled": true, "environment": { "LOG_LEVEL": "INFO", "MAVEN_REPO": "~/.m2/repository", "JAVA_HOME": "", "CFR_PATH": "", "CLASS_PACKAGE_PREFIXES": "" }, "type": "local" } } } ``` ### 环境变量说明 | 变量 | 说明 | 默认值 | |------|------|--------| | `LOG_LEVEL` | 日志级别(`INFO` 静默,`DEBUG` 详细) | `INFO` | | `MAVEN_REPO` | Maven 本地仓库路径 | `~/.m2/repository` | | `JAVA_HOME` | Java 安装路径(留空则使用 PATH 中的 java) | 空 | | `CFR_PATH` | CFR jar 包路径(留空则使用内置 jar) | 空 | | `CLASS_PACKAGE_PREFIXES` | 只索引指定包名前缀的类,多个用逗号分隔(如 `com.example,org.foo`);留空则索引全部类 | 空 | #…
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.