
A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

An MCP server that scans Maven project dependencies, decompiles Java class files, and analyzes class structure for LLM code analysis.
Java Class Analyzer MCP Server is cataloged as an MCP server attributed to handsomestwei. An MCP server that scans Maven project dependencies, decompiles Java class files, and analyzes class structure for LLM code analysis. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.
Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for Java Class Analyzer MCP Server are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
If MAVEN_REPO is not set, it uses the default ~/.m2/repository path.
Yes, a CFR tool JAR path can be supplied via the cfrPath parameter as an additional version.
It creates a class index cache file, a decompilation cache directory, and a temporary files directory.
README.md · aeaca96cabac · Fetched 2026-11-13 09:09:50 UTC
Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.
Showing the last retrieved documentation snapshot; check the source for current changes.
一个基于Model Context Protocol (MCP)的Java类分析服务,可以扫描Maven项目依赖、反编译Java类文件、获取class方法列表等详细信息,并提供给LLM进行代码分析。
Cursor等AI工具直接生成调用二方(内部调用)、三方包(外部调用)接口的代码,但因AI无法读取未在当前工程中打开的依赖源码,导致生成的代码错误频出,甚至出现幻觉式编码。
为解决此问题,一般会直接拷贝源码内容喂给LLM;或者先将源码文件放到当前工程内,再在对话中引用。
而使用本地反编译MCP方案最有效,能精准解析jar包中的类与方法,显著提升代码生成的准确性和可用性。


npm install -g java-class-analyzer-mcp-server
安装后可以直接使用 java-class-analyzer-mcp 命令。
npm install java-class-analyzer-mcp-server
git clone https://github.com/handsomestWei/java-class-analyzer-mcp-server.git
cd java-class-analyzer-mcp-server
npm install
npm run build
运行以下命令生成配置模板:
java-class-analyzer-mcp config -o mcp-client-config.json
然后将生成的配置内容添加到你的MCP客户端配置文件中。
参考以下配置示例,添加到MCP客户端配置文件中:
全局安装后的配置:
{
"mcpServers": {
"java-class-analyzer": {
"command": "java-class-analyzer-mcp",
"args": ["start"],
"env": {
"NODE_ENV": "production",
"MAVEN_REPO": "D:/maven/repository",
"JAVA_HOME": "C:/Program Files/Java/jdk-11"
}
}
}
}
本地安装后的配置:
{
"mcpServers": {
"java-class-analyzer": {
"command": "node",
"args": [
"node_modules/java-class-analyzer-mcp-server/dist/index.js"
],
"env": {
"NODE_ENV": "production",
"MAVEN_REPO": "D:/maven/repository",
"JAVA_HOME": "C:/Program Files/Java/jdk-11"
}
}
}
}
command: 运行MCP服务器的命令,这里使用 nodeargs: 传递给Node.js的参数,指向npm run build编译后的dist文件夹内文件env: 环境变量设置NODE_ENV: 运行环境标识
production: 生产环境,减少日志输出,启用性能优化development: 开发环境,输出详细调试信息test: 测试环境MAVEN_REPO: Maven本地仓库路径(可选)
~/.m2/repository 路径JAVA_HOME: Java安装路径(可选)
${JAVA_HOME}/bin/java 执行Java命令(用于CFR反编译)java 命令CFR_PATH: CFR反编译工具的路径(可选,程序会自动查找)扫描Maven项目的所有依赖,建立类名到JAR包的映射索引。
参数:
projectPath (string): Maven项目根目录路径forceRefresh (boolean, 可选): 是否强制刷新索引,默认false示例:
{
"name": "scan_dependencies",
"arguments": {
"projectPath": "/path/to/your/maven/project",
"forceRefresh": false
}
}
反编译指定的Java类文件,返回Java源码。
参数:
className (string): 要反编译的Java类全名,如:com.example.QueryBizOrderDOprojectPath (string): Maven项目根目录路径useCache (boolean, 可选): 是否使用缓存,默认true。避免每次都重复生成。cfrPath (string, 可选): CFR反编译工具的jar包路径。已内置有,可以额外指定版本。示例:
{
"name": "decompile_class",
"arguments": {
"className": "com.example.QueryBizOrderDO",
"projectPath": "/path/to/your/maven/project",
"useCache": true,
"cfrPath": "/path/to/cfr-0.152.jar"
}
}
分析Java类的结构、方法、字段等信息。
参数:
className (string): 要分析的Java类全名projectPath (string): Maven项目根目录路径示例:
{
"name": "analyze_class",
"arguments": {
"className": "com.example.QueryBizOrderDO",
"projectPath": "/path/to/your/maven/project",
}
}
在当前工程,会生成以下缓存目录和文件。
.mcp-class-index.json: 类索引缓存文件.mcp-decompile-cache/: 反编译结果缓存目录(按包名结构).mcp-class-temp/: 临时文件目录(按包名结构)analyze_class或decompile_class时,自动检查并创建索引analyze_class或decompile_class获取类的详细信息mvn dependency:tree获取依赖树.mcp-class-index.json文件.mcp-class-temp目录(按包名结构).mcp-decompile-cache目录(按包名结构)Maven命令失败
CFR反编译失败
cfrPath参数指定CFR路径类未找到
npm install
npm run build
项目提供了独立的测试工具,可以直接测试MCP服务的各个功能,无需通过MCP客户端。
# 测试所有工具
node test-tools.js
# 测试特定工具
node test-tools.js --tool decompile_class --class com.alibaba.excel.EasyExcelFactory --project /path/to/project
# 不使用缓存
node test-tools.js --tool decompile_class --no-cache
# 指定CFR路径
node test-tools.js --tool decompile_class --cfr-path /path/to/cfr.jar
-t, --tool <工具名>: 指定要测试的工具 (scan|decompile|analyze|all)-p, --project <路径>: 项目路径-c, --class <类名>: 要分析的类名--no-refresh: 不强制刷新依赖索引--no-cache: 不使用反编译缓存--cfr-path <路径>: 指定CFR反编译工具的jar包路径-h, --help: 显示帮助信息通过 NODE_ENV 环境变量控制日志输出:
development: 输出详细调试信息production: 只输出关键信息Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for Java Class Analyzer MCP Server from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/java-class-analyzer)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.
No reviewed package or image identity; download statistics are not listed yet.
Alternative and complementary servers in the same category

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.