A powerful MCP server for intelligently reading Java source code (For Jar and local project).
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"easy-code-reader": {
"env": {},
"args": [
"easy-code-reader",
"--maven-repo",
"/custom/path/to/maven/repository",
"--project-dir",
"/path/to/projects"
],
"command": "uvx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
一个强大的本地 MCP Server,用于智能读取 Java 源代码。支持从 Maven 依赖(Jar 包)和本地项目中提取源码,配备双反编译器(CFR/Fernflower)自动选择机制,智能处理 SNAPSHOT 版本,完美支持多模块项目,让 AI 助手能够深入理解你的 Java 代码库。
This server supports HTTP transport. Be the first to test it — help the community know if it works.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
Checked ENOENT against OSV.dev.
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in developer-tools
A Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
Copy/paste detector for programming source code, supports 223 formats. AI-ready with token-efficient reporter, skill and MCP server.
XcodeBuildMCP provides tools for Xcode project management, simulator management, and app utilities.
Manage Supabase projects — databases, auth, storage, and edge functions
MCP Security Weekly
Get CVE alerts and security updates for Easy Code Reader and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
一个强大的本地 MCP Server,用于智能读取 Java 源代码。支持从 Maven 依赖(Jar 包)和本地项目中提取源码,配备双反编译器(CFR/Fernflower)自动选择机制,智能处理 SNAPSHOT 版本,完美支持多模块项目,让 AI 助手能够深入理解你的 Java 代码库。
A powerful MCP (Model Context Protocol) server for intelligently reading Java source code. Supports extracting source code from Maven dependencies and local projects, equipped with dual decompiler (CFR/Fernflower) auto-selection mechanism, intelligent SNAPSHOT version handling, and perfect multi-module project support. Empowers AI assistants to deeply understand your Java codebase.
~/.m2/repository,支持配置)中查找和读取 JAR 包源代码easy-code-reader/ 下,避免重复反编译Easy Code Reader 特别适合与 Claude、ChatGPT 等大模型配合使用,接下来以 VSCode 结合 Copilot 为例,介绍一些最佳实践:
在比较复杂的项目中一般会拆分多个微服务,某些功能的实现可能会跨多个项目调用,如果靠人梳理相关逻辑会比较耗时,所以可以将涉及的代码 clone 到本地后使用 Easy Code Reader MCP 并结合 Code Agent 进行分析。接下来我们以 Nacos 项目为例,假设我们想了解 Nacos 的服务注册功能是如何实现的,可以按照以下步骤操作。
首先,比如我们创建了一个 Nacos Client 客户端,在这段逻辑中执行服务注册:
public class Main {
private static final Logger logger = LoggerFactory.getLogger(Main.class);
public static void main(String[] args) throws NacosException, InterruptedException {
logger.info("开始初始化 Nacos 客户端...");
Properties properties = new Properties();
properties.put(PropertyKeyConst.SERVER_ADDR, "127.0.0.1:8848");
properties.put(PropertyKeyConst.NAMESPACE, "7430d8fe-99ce-4b20-866e-ed021a0652c9");
NamingService namingService = NacosFactory.createNamingService(properties);
System.out.println("=== 注册服务实例 ===");
try {
// 注册一个服务实例
namingService.registerInstance("test-service0", "127.0.0.1", 8080);
// 添加事件监听器
namingService.subscribe("test-service", event -> {
System.out.println("服务实例变化: " + event);
});
} catch (Exception e) {
System.out.println("服务注册失败(预期,因为服务器可能未启动): " + e.getMessage());
}
TimeUnit.HOURS.sleep(3);
}
}
因为我们创建 Nacos Client 执行服务注册时是由 Nacos 提供的 SDK 直接调用 NamingService#registerInstance 方法实现的,我们并不清楚底层是如何实现的,如果我们想要了解实现细节,那么就需要将 Nacos 的源码 Clone 下来,并使用 Easy Code Reader 读取相关源码,下面是一个示例 Prompt:
你是一位 Java 专家,请你帮我分析 #file:Main.java 中 namingService.registerInstance 方法的逻辑,这段逻辑的实现在本地项目的 nacos 中,所以你需要在 nacos 读取一系列相关的源码才能了解它的核心逻辑,读取 nacos 项目的代码你可以借助 easy-code-reader MCP,其中包含你可以获取项目信息、项目中所有的文件信息和某个文件的工具

如图所示,它会不断地根据源码调用链路,读取相关源码并进行分析,最终我们就能了解服务注册的实现细节,会使用到 MCP Easy Code Reader 提供的多个工具 list_all_project、list_project_files 和 read_project_code, 具体调用细节图示如下:

最终得到分析结果,节省很多时间:

在使用第三方或其他外部依赖时,Copilot 或其他 Code Agent 并不能直接读取 jar 包中的源码,往往需要我们将源码内容手动复制到提示词中才能完成,费时费力。在 Easy Code Reader 中提供了 read_jar_source 工具来读取 jar 包中的源码,帮我们完成开发实现。我们还是以如下代码为例,现在我想实现多个服务实例的注册,但是我又不了解 NamingService 的实现,便可以借助 read_jar_source 来完成:
public class Main {
private static final Logger logger = LoggerFactory.getLogger(Main.
... [View full README on GitHub](https://github.com/FangYuan33/easy-code-reader#readme)