MCP.so
Sign In
M

Maven Indexer Mcp

@tangcent

About Maven Indexer Mcp

A Model Context Protocol (MCP) server that indexes your local Maven repository (~/.m2/repository) and Gradle cache (~/.gradle/caches/modules-2/files-2.1) to provide AI agents with tools to search for Java classes, method signatures, and source code.

Config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "maven-indexer": {
      "command": "npx",
      "args": [
        "-y",
        "maven-indexer-mcp@latest"
      ]
    }
  }
}

Tools

6

Retrieve the source code for a class from the local Maven/Gradle cache (containing internal company libraries). This tool identifies the containing artifact and returns the source code. It prefers actual source files but will fall back to decompilation if necessary. Use this primarily for internal company libraries that are not present in the current workspace. IMPORTANT: Even if the code compiles and imports work, the source code might not be in the current workspace (it comes from a compiled internal library). Use this tool to see the actual implementation of those internal libraries. Supports batch queries.

Search for internal company artifacts and libraries in the local Maven repository and Gradle caches by coordinate (groupId, artifactId), keyword, or class name. Use this primarily for internal company packages or to find available versions of internal projects that are locally built. Also supports searching third-party libraries in the local cache. Supports batch queries.

Search for Java classes in internal company libraries found in the local Maven/Gradle caches. Essential for finding classes in internal company libraries that are not part of the current workspace source code. Use this when you see an import (e.g., 'com.company.util.Helper') but cannot find the definition. Do not assume that because the code compiles or the import exists, the source is local. It often comes from a compiled internal library. This tool helps locate the defining artifact. Supports batch queries.

Search for internal implementations of an interface or base class. This is particularly useful for finding implementations of SPIs or base classes within internal company libraries in the local Maven/Gradle cache. Supports batch queries.

Search for resources (non-class files) inside JARs, such as properties files, XML configs, or proto files.

Trigger a re-scan of the Maven repository. This will re-index all artifacts.

Overview

What is Maven Indexer Mcp?

This server indexes your local Maven repository (~/.m2/repository) and Gradle cache (~/.gradle/caches/modules-2/files-2.1) to provide AI agents with tools to search for Java classes, method signatures, and source code. It is designed for developers who use AI assistants that may lack knowledge of internal company packages or less popular public libraries.

How to use Maven Indexer Mcp?

Add the provided JSON configuration to your MCP client: set the command to npx with args ["-y", "maven-indexer-mcp@latest"]. The server auto-detects your Maven repository and Gradle cache. Optionally, you can set environment variables (MAVEN_REPO, GRADLE_REPO_PATH, INCLUDED_PACKAGES, MAVEN_INDEXER_CFR_PATH) to customize repository paths or filter which packages are indexed.

Key features of Maven Indexer Mcp

  • Semantic class search by name or purpose.
  • Inheritance search for implementations or subclasses.
  • On-demand analysis of method signatures and Javadocs from JARs.
  • Source code retrieval when available.
  • Real-time monitoring; automatically updates index on changes.

Use cases of Maven Indexer Mcp

  • AI agent queries internal company library classes for usage.
  • Developer checks version or methods of obscure public library dependency.
  • Find all implementations of a specific interface in local dependencies.
  • Retrieve source code of a class from JAR files for debugging.

FAQ from Maven Indexer Mcp

What does this server do vs alternatives?

It indexes local Maven/Gradle caches, allowing AI to search and read code from private or obscure libraries that are not public. Unlike general code search, it focuses on dependency code.

What are the runtime requirements?

Requires Node.js and npm to run via npx. It auto-downloads and runs the latest version. An optional CFR decompiler JAR can be specified.

Where does data live?

All data is local: the index is built from your local Maven repository (~/.m2/repository) and Gradle cache. No data is sent externally.

Are there any limits?

Only indexes local caches; does not fetch remote artifacts. Filtering is possible via the INCLUDED_PACKAGES environment variable.

What transport/auth is used?

Uses standard MCP protocol (stdio). No authentication needed as it operates on local files.

Frequently asked questions

What does this server do vs alternatives?

It indexes local Maven/Gradle caches, allowing AI to search and read code from private or obscure libraries that are not public. Unlike general code search, it focuses on dependency code.

What are the runtime requirements?

Requires Node.js and npm to run via npx. It auto-downloads and runs the latest version. An optional CFR decompiler JAR can be specified.

Where does data live?

All data is local: the index is built from your local Maven repository (`~/.m2/repository`) and Gradle cache. No data is sent externally.

Are there any limits?

Only indexes local caches; does not fetch remote artifacts. Filtering is possible via the `INCLUDED_PACKAGES` environment variable.

What transport/auth is used?

Uses standard MCP protocol (stdio). No authentication needed as it operates on local files.

Comments

More Other MCP servers