Java JAR MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Java JAR MCP Serverfind class definition of com.example.MyClass in /home/user/project/pom.xml"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Java JAR MCP Server
An npm package that provides MCP (Model Context Protocol) server functionality for Java Maven projects. This server enables AI assistants to access Java class definitions from Maven dependencies, solving the limitation where Cursor and other VSCode-based IDEs cannot automatically read jar file classes.
Features
Class Definition Lookup: Find Java class definitions from Maven dependencies
Dependency Listing: List all Maven dependencies for a project
JAR Class Search: Search for classes within JAR files using patterns
Related MCP server: CodeAtlas MCP Server
Installation
Prerequisites
Node.js 18+
Maven installed (for Maven projects)
Using via npx
{
"mcpServers": {
"java-jar-mcp": {
"command": "npx",
"args": ["-y", "@biggerball/java-jar-mcp@latest"],
"env": {
"MAVEN_REPO_PATH": "/Users/username/.m2/repository"
}
}
}
}Usage
After configuration, the MCP server will automatically start and provide the following tools to AI assistants:
Available MCP Tools
find_class_definition
Find the definition of a Java class from Maven dependencies.
Parameters:
className(string, required): Fully qualified class name (e.g.,java.util.ArrayList)pomPath(string, required): Path to pom.xml file (e.g.,"/path/to/project/pom.xml")
Returns: Class definition with source code (if available), methods, and fields
Example:
{
"className": "com.alibaba.fastjson2.filter.BeforeFilter",
"pomPath": "/path/to/project/pom.xml"
}list_project_dependencies
List all Maven dependencies for a project.
Parameters:
pomPath(string, required): Path to pom.xml file (e.g.,"/path/to/project/pom.xml")
Returns: List of dependencies with JAR file paths
search_classes_in_jar
Search for classes matching a pattern in a JAR file.
Parameters:
jarPath(string): Path to the JAR filesearchPattern(string): Search pattern (supports wildcards*and?)
Returns: List of matching class names
Support & Donation
If you find this project helpful and would like to support its development, I'd be grateful if you could buy me a coffee! ☕
Your support helps me continue improving this project and creating more useful tools for the developer community.

If you enjoy using this project, your support would mean a lot to me. Thank you! 🙏
Local Development Installation
Clone the repository
Install dependencies and build:
npm install npm run buildUse local path in MCP configuration:
{ "mcpServers": { "java-jar-mcp": { "command": "node", "args": ["/path/to/java-jar-mcp/dist/index.js"], "env": { "MAVEN_REPO_PATH": "/Users/username/.m2/repository" } } } }
How It Works
The MCP server works through the following steps:
Parse pom.xml: Read and parse the Maven project's
pom.xmlfileLocate JAR files: Find corresponding JAR files in the local Maven repository based on Maven coordinates
Extract class definitions: Extract Java class definition information from JAR files
Development
Project Structure
java-jar-mcp/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── mavenParser.ts # pom.xml parsing
│ ├── jarLocator.ts # JAR file location
│ ├── classExtractor.ts # Class definition extraction
│ ├── tools.ts # MCP tool implementations
│ └── cache.ts # LRU cache implementation
└── dist/ # Compiled MCP serverBuilding
# Build MCP server
npm run build
# Watch mode build
npm run watchTesting
npm testFuture Improvements
Support for Gradle projects
Enhanced Maven property resolution
Automatic multi-module project detection and dependency merging
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
An MCP server that gives your AI access to the source code and docs of all public github repos
The Cortex MCP server provides read-only access to real-time engineering context from the Cortex developer portal, allowing AI coding assistants to answer natural language questions about your organization's catalog (microservices, libraries, domains, teams, infrastructure), scorecards (engineering standards and best practices), initiatives (goals and deadlines), and Engineering Intelligence metrics. It includes tools for querying documentation, tracking personal entities, and accessing AI-assisted insights across the entire Cortex ecosystem.
Ship better Java with your coding agent.
Related MCP Servers
- AlicenseBqualityBmaintenanceEnables AI tools to analyze Java dependencies by scanning Maven projects, decompiling JAR files, and extracting detailed class information including methods, fields, and inheritance relationships. Solves the problem of AI hallucinations when generating code that calls external dependencies by providing accurate class structures through decompilation.316 npm42Apache 2.0
- AlicenseAqualityCmaintenanceExposes codebase analysis data, including module structures, dependencies, and AI-generated insights, to AI assistants via the Model Context Protocol. It enables users to query project architecture and search for specific code entities across analyzed projects.1011 npm1MIT
- AlicenseAqualityAmaintenanceDecompiles Maven dependencies into readable Java source directly inside your AI agent.1012 npm1Apache 2.0
- AlicenseNot gradedqualityAmaintenanceIndexes local Maven and Gradle caches to enable AI agents to search for Java classes, method signatures, and source code, including from internal or obscure libraries.154 npm22ISC