advance-group/jar-wise
If you are the rightful owner of jar-wise and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
JarWise is a Java code analysis tool that provides a Model Context Protocol (MCP) server for understanding method call hierarchies and code relationships.
JarWise
JarWise is a Java code analysis tool that helps developers understand method call hierarchies in Java projects. It provides a Model Context Protocol (MCP) server that exposes tools for analyzing Java code structure and relationships.
What is JarWise?
JarWise uses JavaParser to analyze Java source code and JAR files, building an index of classes, methods, and their relationships. It can trace method call hierarchies, helping developers understand how different parts of a codebase interact.
The tool is particularly useful for:
- Understanding complex codebases
- Tracing method call flows
- Analyzing dependency relationships
- Exploring inheritance hierarchies
- Discovering REST API endpoints
Requirements
- Java 21 or higher
- Gradle 8.0 or higher
Operating Modes
JarWise supports two operating modes:
Local Mode (Default)
- Use case: Single Java project
- Configuration:
jar-wise.mode=LOCAL - Path: Set
jar-wise.project-pathto your Java project directory
Server Mode
- Use case: Multiple Java projects
- Configuration:
jar-wise.mode=SERVER - Path: Set
jar-wise.project-pathto root directory containing multiple Java projects
You can set these via environment variables:
JAR_WISE_MODE: Set toLOCAL(default) orSERVERJAR_WISE_PROJECT_PATH: Path to project or root directory
Building and Running JarWise on JarWise
Building the Project
./gradlew build
Jar files are important for type resolution. Always make sure you build the Java project before using JarWise. Thinjar with all dependencies and bootjar are both supported.
Running the MCP Server
JAR_WISE_PROJECT_PATH=${pwd} ./gradlew bootRun
Or using the JAR file:
JAR_WISE_PROJECT_PATH=${pwd} java -jar app/build/libs/app.jar
After running, JarWise service will scan all java source files and Jar files.
MCP Configuration
- Start the JarWise MCP server (see instructions above)
- Configure your MCP client to connect to JarWise:
{
"mcpServers": {
"jar-wise": {
"url": "http://localhost:8080/mcp",
"transportType": "streamableHttp"
}
}
}
Usage Examples
Example requests you can make through MCP-compatible clients:
- Find call hierarchy:
find_call_hierarchywith signature parameter - Get REST API summary:
find_rest_api_summaryto list all APIs - Search code:
search_codeto find classes, methods, or APIs by name - Analyze code relationships and method flows
This integration allows you to leverage JarWise's code analysis capabilities within your preferred development environment that supports MCP.
License
This project is licensed under the GNU Lesser General Public License v3.0 (LGPL-3.0) - see the file for details.
What does LGPL mean for you?
- Using the library: You can freely use this library in your applications (including commercial ones) without any restrictions
- Modifying the library: If you modify this library and distribute it, you must make the modified source code available under LGPL-3.0
- Linking: You can link this library with proprietary code without making your entire application open source